Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-17 Thread Borislav Petkov
On Thu, Sep 17, 2020 at 02:44:25PM -0500, Yazen Ghannam wrote: > Yes, I think so. "Die" is not defined in CPUID(0xb), only SMT and Core, > so the cpu_die_id value is not valid. Right. > In which case, we can overwrite it. CPUID(0xb) doesn't have anything > equivalent to AMD NodeId. So on systems

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-17 Thread Yazen Ghannam
On Thu, Sep 17, 2020 at 06:40:48PM +0200, Borislav Petkov wrote: > On Thu, Sep 17, 2020 at 11:20:53AM -0500, Yazen Ghannam wrote: > > But newer systems support CPUID Leaf 0xB, so cpu_die_id will get > > explicitly set by detect_extended_topology(). The value set is > > different from the AMD NodeId

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-17 Thread Borislav Petkov
On Thu, Sep 17, 2020 at 11:20:53AM -0500, Yazen Ghannam wrote: > But newer systems support CPUID Leaf 0xB, so cpu_die_id will get > explicitly set by detect_extended_topology(). The value set is > different from the AMD NodeId. And at that point I shied away from > doing any override or fixup. Wel

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-17 Thread Yazen Ghannam
On Thu, Sep 17, 2020 at 12:37:20PM +0200, Borislav Petkov wrote: > On Wed, Sep 16, 2020 at 02:51:52PM -0500, Yazen Ghannam wrote: > > What do you think? > > Yeah, forget logical_proc_id - the galactic senate of x86 maintainers > said that we're keeping that for when BIOS vendors f*ck up with the >

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-17 Thread Borislav Petkov
On Wed, Sep 16, 2020 at 02:51:52PM -0500, Yazen Ghannam wrote: > What do you think? Yeah, forget logical_proc_id - the galactic senate of x86 maintainers said that we're keeping that for when BIOS vendors f*ck up with the phys_proc_id enumeration on AMD. Then we'll need that as a workaround. Look

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-16 Thread Yazen Ghannam
On Tue, Sep 15, 2020 at 10:35:15AM +0200, Borislav Petkov wrote: ... > > Yeah, I think example 4b works here. The mismatch though is with > > phys_proc_id and package on AMD systems. You can see above that > > phys_proc_id gives a socket number, and the AMD NodeId gives a package > > number. > > O

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-15 Thread Borislav Petkov
On Mon, Sep 14, 2020 at 02:20:39PM -0500, Yazen Ghannam wrote: > Yes, that's right. > > I called it "node_id" based on the AMD documentation and what it's > called today in the Linux code. It's called other things like nb_id and > nid too. > > I think we can call it something else to avoid confus

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-14 Thread Yazen Ghannam
On Thu, Sep 10, 2020 at 12:14:43PM +0200, Borislav Petkov wrote: > On Wed, Sep 09, 2020 at 03:17:55PM -0500, Yazen Ghannam wrote: > > We need to access specific instances of hardware registers in the > > Northbridge or Data Fabric. The code in arch/x86/kernel/amd_nb.c does > > this. > > So you don

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-10 Thread Borislav Petkov
On Wed, Sep 09, 2020 at 03:17:55PM -0500, Yazen Ghannam wrote: > We need to access specific instances of hardware registers in the > Northbridge or Data Fabric. The code in arch/x86/kernel/amd_nb.c does > this. So you don't need the node_id - you need the northbridge/data fabric ID? I'm guessing N

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-09 Thread Yazen Ghannam
On Wed, Sep 09, 2020 at 08:06:47PM +0200, Borislav Petkov wrote: > On Thu, Sep 03, 2020 at 08:01:37PM +, Yazen Ghannam wrote: > > From: Yazen Ghannam > > > > AMD systems provide a "NodeId" value that represents a global ID > > indicating to which "Node" a logical CPU belongs. The "Node" is a

Re: [PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-09 Thread Borislav Petkov
On Thu, Sep 03, 2020 at 08:01:37PM +, Yazen Ghannam wrote: > From: Yazen Ghannam > > AMD systems provide a "NodeId" value that represents a global ID > indicating to which "Node" a logical CPU belongs. The "Node" is a > physical structure equivalent to a Die, and it should not be confused > w

[PATCH v2 1/8] x86/CPU/AMD: Save NodeId on AMD-based systems

2020-09-03 Thread Yazen Ghannam
From: Yazen Ghannam AMD systems provide a "NodeId" value that represents a global ID indicating to which "Node" a logical CPU belongs. The "Node" is a physical structure equivalent to a Die, and it should not be confused with logical structures like NUMA node. Logical nodes can be adjusted based