x86, amd: Get multi-node CPU info from NodeId MSR instead of PCI config space
Use newly introduced NodeId MSR to get NodeId and number of nodes per processor.
--- arch/x86/include/asm/cpufeature.h | 1 + arch/x86/kernel/cpu/amd.c | 53 ++++++++++-------------------------- 2 files changed, 16 insertions(+), 38 deletions(-)
Hi,
this is .32 material.
Diffed against .32-rc5.
Please apply.
Thanks,
Andreas
arch/x86/include/asm/cpufeature.h +1 -0
@@ -153,6 +153,7 @@#define X86_FEATURE_SSE5 (6*32+11)/* SSE-5 */ #define X86_FEATURE_SKINIT (6*32+12)/* SKINIT/STGI instructions */ #define X86_FEATURE_WDT (6*32+13)/* Watchdog timer */ +#define X86_FEATURE_NODEID_MSR (6*32+19)/* NodeId MSR */ /* * Auxiliary flags: Linux defined - For features scattered in various
arch/x86/kernel/cpu/amd.c +15 -38
74 lines not on this page · raw message
Signature · 1 line
1.6.5
Quoted 2 lines · Andreas Herrmann
Use newly introduced NodeId MSR to get NodeId and number of nodes per processor.
What will happen on CPUs that dont have this MSR and got this info from the PCI config space:
Quoted 7 lines
static void
__cpuinitamd_fixup_dcm(struct cpuinfo_x86 *c){arch/x86/kernel/cpu/amd.c +0
-3-#ifdef CONFIG_PCI -u32 t, cpn; -u8 n, n_id;int cpu =smp_processor_id ();
arch/x86/kernel/cpu/amd.c static int __cpuinit nearby_node(int apicid) · line 279
Quoted 10 lines
arch/x86/kernel/cpu/amd.c +0
-3/* fixup topology information only once for a core */ if (cpu_has (c,X86_FEATURE_AMD_DCM ))return ; -/* check for multi-node processor on boot cpu */ - t =read_pci_config (0 ,24 ,3 ,0xe8 ); -if (!(t & (1 <<29 )))return ;set_cpu_cap (c,X86_FEATURE_AMD_DCM );
are there any such CPUs? I.e. we want to know the effect of this patch on various models of AMD CPUs - is the change really .32 safe? Does it solve any problem that makes it .32 material versus being for .33?
Ingo
Quoted 8 lines · Ingo Molnar
Quoted 2 lines · Andreas Herrmann
Use newly introduced NodeId MSR to get NodeId and number of nodes per processor.
What will happen on CPUs that dont have this MSR and got this info from the PCI config space:
No PCI config space needed as all Magny-Cours CPUs should support this when launched.
Quoted 11 lines
Quoted 11 lines
static void
__cpuinitamd_fixup_dcm(struct cpuinfo_x86 *c){arch/x86/kernel/cpu/amd.c +0
-3-#ifdef CONFIG_PCI -u32 t, cpn; -u8 n, n_id;int cpu =smp_processor_id ();/* fixup topology information only once for a core */ if (cpu_has (c,X86_FEATURE_AMD_DCM ))return ;
Quoted 8 lines
arch/x86/kernel/cpu/amd.c static int __cpuinit nearby_node(int apicid) · line 279
Quoted 6 lines
arch/x86/kernel/cpu/amd.c +0
-3-/* check for multi-node processor on boot cpu */ - t =read_pci_config (0 ,24 ,3 ,0xe8 ); -if (!(t & (1 <<29 )))return ;set_cpu_cap (c,X86_FEATURE_AMD_DCM );are there any such CPUs?
Only Magny-Cours so far.
Quoted 3 lines
I.e. we want to know the effect of this patch
on various models of AMD CPUs - is the change really .32 safe? Does it solve any problem that makes it .32 material versus being for .33?
IMHO getting rid of the PCI config space accesses as soon as possible is a benefit, I think.
Andreas
Quoted 10 lines · Andreas Herrmann
Quoted 1 line
are there any such CPUs?
Only Magny-Cours so far.
Quoted 3 lines
I.e. we want to know the effect of this patch on various models of AMD CPUs - is the change really .32 safe? Does it solve any problem that makes it .32 material versus being for .33?
IMHO getting rid of the PCI config space accesses as soon as possible is a benefit, I think.
Agreed.
Is the patch an identity transformation? Or are there CPUs where the information from the PCI config space is different from the MSR derived one?
Ingo
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Andreas Herrmann
Quoted 1 line
are there any such CPUs?
Only Magny-Cours so far.
Quoted 3 lines
I.e. we want to know the effect of this patch on various models of AMD CPUs - is the change really .32 safe? Does it solve any problem that makes it .32 material versus being for .33?
Quoted 8 lines
Quoted 2 lines
IMHO getting rid of the PCI config space accesses as soon as possible is a benefit, I think.
Agreed.
Is the patch an identity transformation? Or are there CPUs where the information from the PCI config space is different from the MSR derived one?
On production hardware it's an identity transformation.
Regards,
Andreas
PATCH RESEND 1/1 x86, amd: Get multi-node CPU info from NodeId MSR instead of PCI config space
In reply to Andreas HerrmannUse newly introduced NodeId MSR to get NodeId and number of nodes per processor. Production systems will support this from scratch. Thus the PCI config space accesses are superfluous and should be removed asap.
--- arch/x86/include/asm/cpufeature.h | 1 + arch/x86/kernel/cpu/amd.c | 53 ++++++++++-------------------------- 2 files changed, 16 insertions(+), 38 deletions(-)
Please apply for .32.
Thanks,
Andreas
arch/x86/include/asm/cpufeature.h +1 -0
@@ -153,6 +153,7 @@#define X86_FEATURE_SSE5 (6*32+11)/* SSE-5 */ #define X86_FEATURE_SKINIT (6*32+12)/* SKINIT/STGI instructions */ #define X86_FEATURE_WDT (6*32+13)/* Watchdog timer */ +#define X86_FEATURE_NODEID_MSR (6*32+19)/* NodeId MSR */ /* * Auxiliary flags: Linux defined - For features scattered in various
arch/x86/kernel/cpu/amd.c +15 -38
74 lines not on this page · raw message
Signature · 1 line
1.6.0.4