diff options
author | Jia Zhang <qianyue.zj@alibaba-inc.com> | 2017-12-31 20:52:10 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-02-14 19:15:52 -0500 |
commit | b399151cb48db30ad1e0e93dd40d68c6d007b637 (patch) | |
tree | 91d908a4d004adbef9c7a9563c32d28550bc8abc /arch/x86/kernel/cpu/intel.c | |
parent | 961888b1d76d84efc66a8f5604b06ac12ac2f978 (diff) |
x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
x86_mask is a confusing name which is hard to associate with the
processor's stepping.
Additionally, correct an indent issue in lib/cpu.c.
Signed-off-by: Jia Zhang <qianyue.zj@alibaba-inc.com>
[ Updated it to more recent kernels. ]
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: tony.luck@intel.com
Link: http://lkml.kernel.org/r/1514771530-70829-1-git-send-email-qianyue.zj@alibaba-inc.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/intel.c')
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index ef796f14f7ae..d19e903214b4 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -146,7 +146,7 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c) | |||
146 | 146 | ||
147 | for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { | 147 | for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { |
148 | if (c->x86_model == spectre_bad_microcodes[i].model && | 148 | if (c->x86_model == spectre_bad_microcodes[i].model && |
149 | c->x86_mask == spectre_bad_microcodes[i].stepping) | 149 | c->x86_stepping == spectre_bad_microcodes[i].stepping) |
150 | return (c->microcode <= spectre_bad_microcodes[i].microcode); | 150 | return (c->microcode <= spectre_bad_microcodes[i].microcode); |
151 | } | 151 | } |
152 | return false; | 152 | return false; |
@@ -193,7 +193,7 @@ static void early_init_intel(struct cpuinfo_x86 *c) | |||
193 | * need the microcode to have already been loaded... so if it is | 193 | * need the microcode to have already been loaded... so if it is |
194 | * not, recommend a BIOS update and disable large pages. | 194 | * not, recommend a BIOS update and disable large pages. |
195 | */ | 195 | */ |
196 | if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2 && | 196 | if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_stepping <= 2 && |
197 | c->microcode < 0x20e) { | 197 | c->microcode < 0x20e) { |
198 | pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n"); | 198 | pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n"); |
199 | clear_cpu_cap(c, X86_FEATURE_PSE); | 199 | clear_cpu_cap(c, X86_FEATURE_PSE); |
@@ -209,7 +209,7 @@ static void early_init_intel(struct cpuinfo_x86 *c) | |||
209 | 209 | ||
210 | /* CPUID workaround for 0F33/0F34 CPU */ | 210 | /* CPUID workaround for 0F33/0F34 CPU */ |
211 | if (c->x86 == 0xF && c->x86_model == 0x3 | 211 | if (c->x86 == 0xF && c->x86_model == 0x3 |
212 | && (c->x86_mask == 0x3 || c->x86_mask == 0x4)) | 212 | && (c->x86_stepping == 0x3 || c->x86_stepping == 0x4)) |
213 | c->x86_phys_bits = 36; | 213 | c->x86_phys_bits = 36; |
214 | 214 | ||
215 | /* | 215 | /* |
@@ -307,7 +307,7 @@ int ppro_with_ram_bug(void) | |||
307 | if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && | 307 | if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && |
308 | boot_cpu_data.x86 == 6 && | 308 | boot_cpu_data.x86 == 6 && |
309 | boot_cpu_data.x86_model == 1 && | 309 | boot_cpu_data.x86_model == 1 && |
310 | boot_cpu_data.x86_mask < 8) { | 310 | boot_cpu_data.x86_stepping < 8) { |
311 | pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n"); | 311 | pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n"); |
312 | return 1; | 312 | return 1; |
313 | } | 313 | } |
@@ -324,7 +324,7 @@ static void intel_smp_check(struct cpuinfo_x86 *c) | |||
324 | * Mask B, Pentium, but not Pentium MMX | 324 | * Mask B, Pentium, but not Pentium MMX |
325 | */ | 325 | */ |
326 | if (c->x86 == 5 && | 326 | if (c->x86 == 5 && |
327 | c->x86_mask >= 1 && c->x86_mask <= 4 && | 327 | c->x86_stepping >= 1 && c->x86_stepping <= 4 && |
328 | c->x86_model <= 3) { | 328 | c->x86_model <= 3) { |
329 | /* | 329 | /* |
330 | * Remember we have B step Pentia with bugs | 330 | * Remember we have B step Pentia with bugs |
@@ -367,7 +367,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) | |||
367 | * SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until | 367 | * SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until |
368 | * model 3 mask 3 | 368 | * model 3 mask 3 |
369 | */ | 369 | */ |
370 | if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) | 370 | if ((c->x86<<8 | c->x86_model<<4 | c->x86_stepping) < 0x633) |
371 | clear_cpu_cap(c, X86_FEATURE_SEP); | 371 | clear_cpu_cap(c, X86_FEATURE_SEP); |
372 | 372 | ||
373 | /* | 373 | /* |
@@ -385,7 +385,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) | |||
385 | * P4 Xeon erratum 037 workaround. | 385 | * P4 Xeon erratum 037 workaround. |
386 | * Hardware prefetcher may cause stale data to be loaded into the cache. | 386 | * Hardware prefetcher may cause stale data to be loaded into the cache. |
387 | */ | 387 | */ |
388 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { | 388 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_stepping == 1)) { |
389 | if (msr_set_bit(MSR_IA32_MISC_ENABLE, | 389 | if (msr_set_bit(MSR_IA32_MISC_ENABLE, |
390 | MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) { | 390 | MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) { |
391 | pr_info("CPU: C0 stepping P4 Xeon detected.\n"); | 391 | pr_info("CPU: C0 stepping P4 Xeon detected.\n"); |
@@ -400,7 +400,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) | |||
400 | * Specification Update"). | 400 | * Specification Update"). |
401 | */ | 401 | */ |
402 | if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 && | 402 | if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 && |
403 | (c->x86_mask < 0x6 || c->x86_mask == 0xb)) | 403 | (c->x86_stepping < 0x6 || c->x86_stepping == 0xb)) |
404 | set_cpu_bug(c, X86_BUG_11AP); | 404 | set_cpu_bug(c, X86_BUG_11AP); |
405 | 405 | ||
406 | 406 | ||
@@ -647,7 +647,7 @@ static void init_intel(struct cpuinfo_x86 *c) | |||
647 | case 6: | 647 | case 6: |
648 | if (l2 == 128) | 648 | if (l2 == 128) |
649 | p = "Celeron (Mendocino)"; | 649 | p = "Celeron (Mendocino)"; |
650 | else if (c->x86_mask == 0 || c->x86_mask == 5) | 650 | else if (c->x86_stepping == 0 || c->x86_stepping == 5) |
651 | p = "Celeron-A"; | 651 | p = "Celeron-A"; |
652 | break; | 652 | break; |
653 | 653 | ||