aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHuaitong Han <huaitong.han@intel.com>2016-01-25 14:41:47 -0500
committerIngo Molnar <mingo@kernel.org>2016-02-01 04:46:48 -0500
commit16aaa53756501914a863ae7a15fcb070dc27c3d7 (patch)
tree2011a3e9e23f50f6ace1570fade4dc00169c2bbe /arch
parent36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff)
x86/cpufeature: Use enum cpuid_leafs instead of magic numbers
Most of the magic numbers in x86_capability[] have been converted to 'enum cpuid_leafs', and this patch updates the remaining part. Signed-off-by: Huaitong Han <huaitong.han@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Alexander Kuleshov <kuleshovmail@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Hector Marco-Gisbert <hecmargi@upv.es> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Kees Cook <keescook@chromium.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: lguest@lists.ozlabs.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/1453750913-4781-3-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/elf.h2
-rw-r--r--arch/x86/kernel/mpparse.c2
-rw-r--r--arch/x86/lguest/boot.c2
-rw-r--r--arch/x86/xen/enlighten.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 1514753fd435..15340e36ddcb 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -256,7 +256,7 @@ extern int force_personality32;
256 instruction set this CPU supports. This could be done in user space, 256 instruction set this CPU supports. This could be done in user space,
257 but it's not easy, and we've already done it here. */ 257 but it's not easy, and we've already done it here. */
258 258
259#define ELF_HWCAP (boot_cpu_data.x86_capability[0]) 259#define ELF_HWCAP (boot_cpu_data.x86_capability[CPUID_1_EDX])
260 260
261/* This yields a string that ld.so will use to load implementation 261/* This yields a string that ld.so will use to load implementation
262 specific libraries for optimization. This is more specific in 262 specific libraries for optimization. This is more specific in
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 30ca7607cbbb..97340f2c437c 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -408,7 +408,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
408 processor.cpuflag = CPU_ENABLED; 408 processor.cpuflag = CPU_ENABLED;
409 processor.cpufeature = (boot_cpu_data.x86 << 8) | 409 processor.cpufeature = (boot_cpu_data.x86 << 8) |
410 (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; 410 (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
411 processor.featureflag = boot_cpu_data.x86_capability[0]; 411 processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX];
412 processor.reserved[0] = 0; 412 processor.reserved[0] = 0;
413 processor.reserved[1] = 0; 413 processor.reserved[1] = 0;
414 for (i = 0; i < 2; i++) { 414 for (i = 0; i < 2; i++) {
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 4ba229ac3f4f..a9033ae13369 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -1535,7 +1535,7 @@ __init void lguest_init(void)
1535 */ 1535 */
1536 cpu_detect(&new_cpu_data); 1536 cpu_detect(&new_cpu_data);
1537 /* head.S usually sets up the first capability word, so do it here. */ 1537 /* head.S usually sets up the first capability word, so do it here. */
1538 new_cpu_data.x86_capability[0] = cpuid_edx(1); 1538 new_cpu_data.x86_capability[CPUID_1_EDX] = cpuid_edx(1);
1539 1539
1540 /* Math is always hard! */ 1540 /* Math is always hard! */
1541 set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU); 1541 set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU);
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index d09e4c9d7cc5..2c261082eadf 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1654,7 +1654,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
1654 cpu_detect(&new_cpu_data); 1654 cpu_detect(&new_cpu_data);
1655 set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU); 1655 set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU);
1656 new_cpu_data.wp_works_ok = 1; 1656 new_cpu_data.wp_works_ok = 1;
1657 new_cpu_data.x86_capability[0] = cpuid_edx(1); 1657 new_cpu_data.x86_capability[CPUID_1_EDX] = cpuid_edx(1);
1658#endif 1658#endif
1659 1659
1660 if (xen_start_info->mod_start) { 1660 if (xen_start_info->mod_start) {