Skip to content

Commit 16aaa53

Browse files
Huaitong HanIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: Alexander Kuleshov <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: David Vrabel <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Hector Marco-Gisbert <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Kees Cook <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Tony Luck <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 36f90b0 commit 16aaa53

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/x86/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ extern int force_personality32;
256256
instruction set this CPU supports. This could be done in user space,
257257
but it's not easy, and we've already done it here. */
258258

259-
#define ELF_HWCAP (boot_cpu_data.x86_capability[0])
259+
#define ELF_HWCAP (boot_cpu_data.x86_capability[CPUID_1_EDX])
260260

261261
/* This yields a string that ld.so will use to load implementation
262262
specific libraries for optimization. This is more specific in

arch/x86/kernel/mpparse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
408408
processor.cpuflag = CPU_ENABLED;
409409
processor.cpufeature = (boot_cpu_data.x86 << 8) |
410410
(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];
412412
processor.reserved[0] = 0;
413413
processor.reserved[1] = 0;
414414
for (i = 0; i < 2; i++) {

arch/x86/lguest/boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ __init void lguest_init(void)
15351535
*/
15361536
cpu_detect(&new_cpu_data);
15371537
/* 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);
15391539

15401540
/* Math is always hard! */
15411541
set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU);

arch/x86/xen/enlighten.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
16541654
cpu_detect(&new_cpu_data);
16551655
set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU);
16561656
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);
16581658
#endif
16591659

16601660
if (xen_start_info->mod_start) {

0 commit comments

Comments
 (0)