]> Pileus Git - ~andy/linux/commitdiff
x86: Add cpu_has_topoext
authorAndreas Herrmann <andreas.herrmann3@amd.com>
Fri, 19 Oct 2012 08:58:13 +0000 (10:58 +0200)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 13 Nov 2012 19:22:28 +0000 (11:22 -0800)
Introduce cpu_has_topoext to check for AMD's CPUID topology extensions
support. It indicates support for
CPUID Fn8000_001D_EAX_x[N:0]-CPUID Fn8000_001E_EDX

See AMD's CPUID Specification, Publication # 25481
(as of Rev. 2.34 September 2010)

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Link: http://lkml.kernel.org/r/20121019085813.GD26718@alberich
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/cpufeature.h
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/smpboot.c

index 8c297aa53eef1cdcc8de35d058ae7b0b933f5dbb..c22a492daf573acc3a5d03f63449358e141aae79 100644 (file)
@@ -311,6 +311,7 @@ extern const char * const x86_power_flags[32];
 #define cpu_has_cx8            boot_cpu_has(X86_FEATURE_CX8)
 #define cpu_has_cx16           boot_cpu_has(X86_FEATURE_CX16)
 #define cpu_has_eager_fpu      boot_cpu_has(X86_FEATURE_EAGER_FPU)
+#define cpu_has_topoext                boot_cpu_has(X86_FEATURE_TOPOEXT)
 
 #if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
 # define cpu_has_invlpg                1
index f7e98a2c0d123ae0ebe7f61f1521f7dd7090a335..64e9ad4e49a022dd662180ba97d51c3c0b0010d7 100644 (file)
@@ -304,7 +304,7 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c)
        int cpu = smp_processor_id();
 
        /* get information required for multi-node processors */
-       if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
+       if (cpu_has_topoext) {
                u32 eax, ebx, ecx, edx;
 
                cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
index c80a33bc528b8e33ec6a1b9b4e6ca02964c21d7e..732bf5cff6456e73f3df1a76f9621e97da9b0a16 100644 (file)
@@ -313,7 +313,7 @@ do {                                                                        \
 
 static bool __cpuinit match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
 {
-       if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
+       if (cpu_has_topoext) {
                int cpu1 = c->cpu_index, cpu2 = o->cpu_index;
 
                if (c->phys_proc_id == o->phys_proc_id &&