Commit b399151c authored by Jia Zhang's avatar Jia Zhang Committed by Ingo Molnar

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: default avatarJia 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.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 961888b1
...@@ -3559,7 +3559,7 @@ static int intel_snb_pebs_broken(int cpu) ...@@ -3559,7 +3559,7 @@ static int intel_snb_pebs_broken(int cpu)
break; break;
case INTEL_FAM6_SANDYBRIDGE_X: case INTEL_FAM6_SANDYBRIDGE_X:
switch (cpu_data(cpu).x86_mask) { switch (cpu_data(cpu).x86_stepping) {
case 6: rev = 0x618; break; case 6: rev = 0x618; break;
case 7: rev = 0x70c; break; case 7: rev = 0x70c; break;
} }
......
...@@ -1186,7 +1186,7 @@ void __init intel_pmu_lbr_init_atom(void) ...@@ -1186,7 +1186,7 @@ void __init intel_pmu_lbr_init_atom(void)
* on PMU interrupt * on PMU interrupt
*/ */
if (boot_cpu_data.x86_model == 28 if (boot_cpu_data.x86_model == 28
&& boot_cpu_data.x86_mask < 10) { && boot_cpu_data.x86_stepping < 10) {
pr_cont("LBR disabled due to erratum"); pr_cont("LBR disabled due to erratum");
return; return;
} }
......
...@@ -234,7 +234,7 @@ static __initconst const struct x86_pmu p6_pmu = { ...@@ -234,7 +234,7 @@ static __initconst const struct x86_pmu p6_pmu = {
static __init void p6_pmu_rdpmc_quirk(void) static __init void p6_pmu_rdpmc_quirk(void)
{ {
if (boot_cpu_data.x86_mask < 9) { if (boot_cpu_data.x86_stepping < 9) {
/* /*
* PPro erratum 26; fixed in stepping 9 and above. * PPro erratum 26; fixed in stepping 9 and above.
*/ */
......
...@@ -94,7 +94,7 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate) ...@@ -94,7 +94,7 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
if (boot_cpu_data.x86 == 0x0F && if (boot_cpu_data.x86 == 0x0F &&
boot_cpu_data.x86_vendor == X86_VENDOR_AMD && boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
boot_cpu_data.x86_model <= 0x05 && boot_cpu_data.x86_model <= 0x05 &&
boot_cpu_data.x86_mask < 0x0A) boot_cpu_data.x86_stepping < 0x0A)
return 1; return 1;
else if (boot_cpu_has(X86_BUG_AMD_APIC_C1E)) else if (boot_cpu_has(X86_BUG_AMD_APIC_C1E))
return 1; return 1;
......
...@@ -91,7 +91,7 @@ struct cpuinfo_x86 { ...@@ -91,7 +91,7 @@ struct cpuinfo_x86 {
__u8 x86; /* CPU family */ __u8 x86; /* CPU family */
__u8 x86_vendor; /* CPU vendor */ __u8 x86_vendor; /* CPU vendor */
__u8 x86_model; __u8 x86_model;
__u8 x86_mask; __u8 x86_stepping;
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
/* Number of 4K pages in DTLB/ITLB combined(in pages): */ /* Number of 4K pages in DTLB/ITLB combined(in pages): */
int x86_tlbsize; int x86_tlbsize;
......
...@@ -235,7 +235,7 @@ int amd_cache_northbridges(void) ...@@ -235,7 +235,7 @@ int amd_cache_northbridges(void)
if (boot_cpu_data.x86 == 0x10 && if (boot_cpu_data.x86 == 0x10 &&
boot_cpu_data.x86_model >= 0x8 && boot_cpu_data.x86_model >= 0x8 &&
(boot_cpu_data.x86_model > 0x9 || (boot_cpu_data.x86_model > 0x9 ||
boot_cpu_data.x86_mask >= 0x1)) boot_cpu_data.x86_stepping >= 0x1))
amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE; amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE;
if (boot_cpu_data.x86 == 0x15) if (boot_cpu_data.x86 == 0x15)
......
...@@ -546,7 +546,7 @@ static DEFINE_PER_CPU(struct clock_event_device, lapic_events); ...@@ -546,7 +546,7 @@ static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
static u32 hsx_deadline_rev(void) static u32 hsx_deadline_rev(void)
{ {
switch (boot_cpu_data.x86_mask) { switch (boot_cpu_data.x86_stepping) {
case 0x02: return 0x3a; /* EP */ case 0x02: return 0x3a; /* EP */
case 0x04: return 0x0f; /* EX */ case 0x04: return 0x0f; /* EX */
} }
...@@ -556,7 +556,7 @@ static u32 hsx_deadline_rev(void) ...@@ -556,7 +556,7 @@ static u32 hsx_deadline_rev(void)
static u32 bdx_deadline_rev(void) static u32 bdx_deadline_rev(void)
{ {
switch (boot_cpu_data.x86_mask) { switch (boot_cpu_data.x86_stepping) {
case 0x02: return 0x00000011; case 0x02: return 0x00000011;
case 0x03: return 0x0700000e; case 0x03: return 0x0700000e;
case 0x04: return 0x0f00000c; case 0x04: return 0x0f00000c;
...@@ -568,7 +568,7 @@ static u32 bdx_deadline_rev(void) ...@@ -568,7 +568,7 @@ static u32 bdx_deadline_rev(void)
static u32 skx_deadline_rev(void) static u32 skx_deadline_rev(void)
{ {
switch (boot_cpu_data.x86_mask) { switch (boot_cpu_data.x86_stepping) {
case 0x03: return 0x01000136; case 0x03: return 0x01000136;
case 0x04: return 0x02000014; case 0x04: return 0x02000014;
} }
......
...@@ -18,7 +18,7 @@ void foo(void) ...@@ -18,7 +18,7 @@ void foo(void)
OFFSET(CPUINFO_x86, cpuinfo_x86, x86); OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); OFFSET(CPUINFO_x86_stepping, cpuinfo_x86, x86_stepping);
OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
......
...@@ -119,7 +119,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c) ...@@ -119,7 +119,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
return; return;
} }
if (c->x86_model == 6 && c->x86_mask == 1) { if (c->x86_model == 6 && c->x86_stepping == 1) {
const int K6_BUG_LOOP = 1000000; const int K6_BUG_LOOP = 1000000;
int n; int n;
void (*f_vide)(void); void (*f_vide)(void);
...@@ -149,7 +149,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c) ...@@ -149,7 +149,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
/* K6 with old style WHCR */ /* K6 with old style WHCR */
if (c->x86_model < 8 || if (c->x86_model < 8 ||
(c->x86_model == 8 && c->x86_mask < 8)) { (c->x86_model == 8 && c->x86_stepping < 8)) {
/* We can only write allocate on the low 508Mb */ /* We can only write allocate on the low 508Mb */
if (mbytes > 508) if (mbytes > 508)
mbytes = 508; mbytes = 508;
...@@ -168,7 +168,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c) ...@@ -168,7 +168,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
return; return;
} }
if ((c->x86_model == 8 && c->x86_mask > 7) || if ((c->x86_model == 8 && c->x86_stepping > 7) ||
c->x86_model == 9 || c->x86_model == 13) { c->x86_model == 9 || c->x86_model == 13) {
/* The more serious chips .. */ /* The more serious chips .. */
...@@ -221,7 +221,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c) ...@@ -221,7 +221,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
* are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx * are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx
* As per AMD technical note 27212 0.2 * As per AMD technical note 27212 0.2
*/ */
if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) { if ((c->x86_model == 8 && c->x86_stepping >= 1) || (c->x86_model > 8)) {
rdmsr(MSR_K7_CLK_CTL, l, h); rdmsr(MSR_K7_CLK_CTL, l, h);
if ((l & 0xfff00000) != 0x20000000) { if ((l & 0xfff00000) != 0x20000000) {
pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n", pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
...@@ -241,12 +241,12 @@ static void init_amd_k7(struct cpuinfo_x86 *c) ...@@ -241,12 +241,12 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
* but they are not certified as MP capable. * but they are not certified as MP capable.
*/ */
/* Athlon 660/661 is valid. */ /* Athlon 660/661 is valid. */
if ((c->x86_model == 6) && ((c->x86_mask == 0) || if ((c->x86_model == 6) && ((c->x86_stepping == 0) ||
(c->x86_mask == 1))) (c->x86_stepping == 1)))
return; return;
/* Duron 670 is valid */ /* Duron 670 is valid */
if ((c->x86_model == 7) && (c->x86_mask == 0)) if ((c->x86_model == 7) && (c->x86_stepping == 0))
return; return;
/* /*
...@@ -256,8 +256,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c) ...@@ -256,8 +256,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
* See http://www.heise.de/newsticker/data/jow-18.10.01-000 for * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for
* more. * more.
*/ */
if (((c->x86_model == 6) && (c->x86_mask >= 2)) || if (((c->x86_model == 6) && (c->x86_stepping >= 2)) ||
((c->x86_model == 7) && (c->x86_mask >= 1)) || ((c->x86_model == 7) && (c->x86_stepping >= 1)) ||
(c->x86_model > 7)) (c->x86_model > 7))
if (cpu_has(c, X86_FEATURE_MP)) if (cpu_has(c, X86_FEATURE_MP))
return; return;
...@@ -583,7 +583,7 @@ static void early_init_amd(struct cpuinfo_x86 *c) ...@@ -583,7 +583,7 @@ static void early_init_amd(struct cpuinfo_x86 *c)
/* Set MTRR capability flag if appropriate */ /* Set MTRR capability flag if appropriate */
if (c->x86 == 5) if (c->x86 == 5)
if (c->x86_model == 13 || c->x86_model == 9 || if (c->x86_model == 13 || c->x86_model == 9 ||
(c->x86_model == 8 && c->x86_mask >= 8)) (c->x86_model == 8 && c->x86_stepping >= 8))
set_cpu_cap(c, X86_FEATURE_K6_MTRR); set_cpu_cap(c, X86_FEATURE_K6_MTRR);
#endif #endif
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
...@@ -769,7 +769,7 @@ static void init_amd_zn(struct cpuinfo_x86 *c) ...@@ -769,7 +769,7 @@ static void init_amd_zn(struct cpuinfo_x86 *c)
* Fix erratum 1076: CPB feature bit not being set in CPUID. It affects * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects
* all up to and including B1. * all up to and including B1.
*/ */
if (c->x86_model <= 1 && c->x86_mask <= 1) if (c->x86_model <= 1 && c->x86_stepping <= 1)
set_cpu_cap(c, X86_FEATURE_CPB); set_cpu_cap(c, X86_FEATURE_CPB);
} }
...@@ -880,11 +880,11 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size) ...@@ -880,11 +880,11 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
/* AMD errata T13 (order #21922) */ /* AMD errata T13 (order #21922) */
if ((c->x86 == 6)) { if ((c->x86 == 6)) {
/* Duron Rev A0 */ /* Duron Rev A0 */
if (c->x86_model == 3 && c->x86_mask == 0) if (c->x86_model == 3 && c->x86_stepping == 0)
size = 64; size = 64;
/* Tbird rev A1/A2 */ /* Tbird rev A1/A2 */
if (c->x86_model == 4 && if (c->x86_model == 4 &&
(c->x86_mask == 0 || c->x86_mask == 1)) (c->x86_stepping == 0 || c->x86_stepping == 1))
size = 256; size = 256;
} }
return size; return size;
...@@ -1021,7 +1021,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) ...@@ -1021,7 +1021,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
} }
/* OSVW unavailable or ID unknown, match family-model-stepping range */ /* OSVW unavailable or ID unknown, match family-model-stepping range */
ms = (cpu->x86_model << 4) | cpu->x86_mask; ms = (cpu->x86_model << 4) | cpu->x86_stepping;
while ((range = *erratum++)) while ((range = *erratum++))
if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
(ms >= AMD_MODEL_RANGE_START(range)) && (ms >= AMD_MODEL_RANGE_START(range)) &&
......
...@@ -136,7 +136,7 @@ static void init_centaur(struct cpuinfo_x86 *c) ...@@ -136,7 +136,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
clear_cpu_cap(c, X86_FEATURE_TSC); clear_cpu_cap(c, X86_FEATURE_TSC);
break; break;
case 8: case 8:
switch (c->x86_mask) { switch (c->x86_stepping) {
default: default:
name = "2"; name = "2";
break; break;
...@@ -211,7 +211,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) ...@@ -211,7 +211,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
* - Note, it seems this may only be in engineering samples. * - Note, it seems this may only be in engineering samples.
*/ */
if ((c->x86 == 6) && (c->x86_model == 9) && if ((c->x86 == 6) && (c->x86_model == 9) &&
(c->x86_mask == 1) && (size == 65)) (c->x86_stepping == 1) && (size == 65))
size -= 1; size -= 1;
return size; return size;
} }
......
...@@ -731,7 +731,7 @@ void cpu_detect(struct cpuinfo_x86 *c) ...@@ -731,7 +731,7 @@ void cpu_detect(struct cpuinfo_x86 *c)
cpuid(0x00000001, &tfms, &misc, &junk, &cap0); cpuid(0x00000001, &tfms, &misc, &junk, &cap0);
c->x86 = x86_family(tfms); c->x86 = x86_family(tfms);
c->x86_model = x86_model(tfms); c->x86_model = x86_model(tfms);
c->x86_mask = x86_stepping(tfms); c->x86_stepping = x86_stepping(tfms);
if (cap0 & (1<<19)) { if (cap0 & (1<<19)) {
c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
...@@ -1186,7 +1186,7 @@ static void identify_cpu(struct cpuinfo_x86 *c) ...@@ -1186,7 +1186,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
c->loops_per_jiffy = loops_per_jiffy; c->loops_per_jiffy = loops_per_jiffy;
c->x86_cache_size = -1; c->x86_cache_size = -1;
c->x86_vendor = X86_VENDOR_UNKNOWN; c->x86_vendor = X86_VENDOR_UNKNOWN;
c->x86_model = c->x86_mask = 0; /* So far unknown... */ c->x86_model = c->x86_stepping = 0; /* So far unknown... */
c->x86_vendor_id[0] = '\0'; /* Unset */ c->x86_vendor_id[0] = '\0'; /* Unset */
c->x86_model_id[0] = '\0'; /* Unset */ c->x86_model_id[0] = '\0'; /* Unset */
c->x86_max_cores = 1; c->x86_max_cores = 1;
...@@ -1378,8 +1378,8 @@ void print_cpu_info(struct cpuinfo_x86 *c) ...@@ -1378,8 +1378,8 @@ void print_cpu_info(struct cpuinfo_x86 *c)
pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model); pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
if (c->x86_mask || c->cpuid_level >= 0) if (c->x86_stepping || c->cpuid_level >= 0)
pr_cont(", stepping: 0x%x)\n", c->x86_mask); pr_cont(", stepping: 0x%x)\n", c->x86_stepping);
else else
pr_cont(")\n"); pr_cont(")\n");
} }
......
...@@ -215,7 +215,7 @@ static void init_cyrix(struct cpuinfo_x86 *c) ...@@ -215,7 +215,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
/* common case step number/rev -- exceptions handled below */ /* common case step number/rev -- exceptions handled below */
c->x86_model = (dir1 >> 4) + 1; c->x86_model = (dir1 >> 4) + 1;
c->x86_mask = dir1 & 0xf; c->x86_stepping = dir1 & 0xf;
/* Now cook; the original recipe is by Channing Corn, from Cyrix. /* Now cook; the original recipe is by Channing Corn, from Cyrix.
* We do the same thing for each generation: we work out * We do the same thing for each generation: we work out
......
...@@ -146,7 +146,7 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c) ...@@ -146,7 +146,7 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) {
if (c->x86_model == spectre_bad_microcodes[i].model && if (c->x86_model == spectre_bad_microcodes[i].model &&
c->x86_mask == spectre_bad_microcodes[i].stepping) c->x86_stepping == spectre_bad_microcodes[i].stepping)
return (c->microcode <= spectre_bad_microcodes[i].microcode); return (c->microcode <= spectre_bad_microcodes[i].microcode);
} }
return false; return false;
...@@ -193,7 +193,7 @@ static void early_init_intel(struct cpuinfo_x86 *c) ...@@ -193,7 +193,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
* need the microcode to have already been loaded... so if it is * need the microcode to have already been loaded... so if it is
* not, recommend a BIOS update and disable large pages. * not, recommend a BIOS update and disable large pages.
*/ */
if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2 && if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_stepping <= 2 &&
c->microcode < 0x20e) { c->microcode < 0x20e) {
pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n"); pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n");
clear_cpu_cap(c, X86_FEATURE_PSE); clear_cpu_cap(c, X86_FEATURE_PSE);
...@@ -209,7 +209,7 @@ static void early_init_intel(struct cpuinfo_x86 *c) ...@@ -209,7 +209,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
/* CPUID workaround for 0F33/0F34 CPU */ /* CPUID workaround for 0F33/0F34 CPU */
if (c->x86 == 0xF && c->x86_model == 0x3 if (c->x86 == 0xF && c->x86_model == 0x3
&& (c->x86_mask == 0x3 || c->x86_mask == 0x4)) && (c->x86_stepping == 0x3 || c->x86_stepping == 0x4))
c->x86_phys_bits = 36; c->x86_phys_bits = 36;
/* /*
...@@ -307,7 +307,7 @@ int ppro_with_ram_bug(void) ...@@ -307,7 +307,7 @@ int ppro_with_ram_bug(void)
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
boot_cpu_data.x86 == 6 && boot_cpu_data.x86 == 6 &&
boot_cpu_data.x86_model == 1 && boot_cpu_data.x86_model == 1 &&
boot_cpu_data.x86_mask < 8) { boot_cpu_data.x86_stepping < 8) {
pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n"); pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n");
return 1; return 1;
} }
...@@ -324,7 +324,7 @@ static void intel_smp_check(struct cpuinfo_x86 *c) ...@@ -324,7 +324,7 @@ static void intel_smp_check(struct cpuinfo_x86 *c)
* Mask B, Pentium, but not Pentium MMX * Mask B, Pentium, but not Pentium MMX
*/ */
if (c->x86 == 5 && if (c->x86 == 5 &&
c->x86_mask >= 1 && c->x86_mask <= 4 && c->x86_stepping >= 1 && c->x86_stepping <= 4 &&
c->x86_model <= 3) { c->x86_model <= 3) {
/* /*
* Remember we have B step Pentia with bugs * Remember we have B step Pentia with bugs
...@@ -367,7 +367,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) ...@@ -367,7 +367,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until * SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until
* model 3 mask 3 * model 3 mask 3
*/ */
if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) if ((c->x86<<8 | c->x86_model<<4 | c->x86_stepping) < 0x633)
clear_cpu_cap(c, X86_FEATURE_SEP); clear_cpu_cap(c, X86_FEATURE_SEP);
/* /*
...@@ -385,7 +385,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) ...@@ -385,7 +385,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
* P4 Xeon erratum 037 workaround. * P4 Xeon erratum 037 workaround.
* Hardware prefetcher may cause stale data to be loaded into the cache. * Hardware prefetcher may cause stale data to be loaded into the cache.
*/ */
if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_stepping == 1)) {
if (msr_set_bit(MSR_IA32_MISC_ENABLE, if (msr_set_bit(MSR_IA32_MISC_ENABLE,
MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) { MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) > 0) {
pr_info("CPU: C0 stepping P4 Xeon detected.\n"); pr_info("CPU: C0 stepping P4 Xeon detected.\n");
...@@ -400,7 +400,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) ...@@ -400,7 +400,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
* Specification Update"). * Specification Update").
*/ */
if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 && if (boot_cpu_has(X86_FEATURE_APIC) && (c->x86<<8 | c->x86_model<<4) == 0x520 &&
(c->x86_mask < 0x6 || c->x86_mask == 0xb)) (c->x86_stepping < 0x6 || c->x86_stepping == 0xb))
set_cpu_bug(c, X86_BUG_11AP); set_cpu_bug(c, X86_BUG_11AP);
...@@ -647,7 +647,7 @@ static void init_intel(struct cpuinfo_x86 *c) ...@@ -647,7 +647,7 @@ static void init_intel(struct cpuinfo_x86 *c)
case 6: case 6:
if (l2 == 128) if (l2 == 128)
p = "Celeron (Mendocino)"; p = "Celeron (Mendocino)";
else if (c->x86_mask == 0 || c->x86_mask == 5) else if (c->x86_stepping == 0 || c->x86_stepping == 5)
p = "Celeron-A"; p = "Celeron-A";
break; break;
......
...@@ -771,7 +771,7 @@ static __init void rdt_quirks(void) ...@@ -771,7 +771,7 @@ static __init void rdt_quirks(void)
cache_alloc_hsw_probe(); cache_alloc_hsw_probe();
break; break;
case INTEL_FAM6_SKYLAKE_X: case INTEL_FAM6_SKYLAKE_X:
if (boot_cpu_data.x86_mask <= 4) if (boot_cpu_data.x86_stepping <= 4)
set_rdt_options("!cmt,!mbmtotal,!mbmlocal,!l3cat"); set_rdt_options("!cmt,!mbmtotal,!mbmlocal,!l3cat");
} }
} }
......
...@@ -921,7 +921,7 @@ static bool is_blacklisted(unsigned int cpu) ...@@ -921,7 +921,7 @@ static bool is_blacklisted(unsigned int cpu)
*/ */
if (c->x86 == 6 && if (c->x86 == 6 &&
c->x86_model == INTEL_FAM6_BROADWELL_X && c->x86_model == INTEL_FAM6_BROADWELL_X &&
c->x86_mask == 0x01 && c->x86_stepping == 0x01 &&
llc_size_per_core > 2621440 && llc_size_per_core > 2621440 &&
c->microcode < 0x0b000021) { c->microcode < 0x0b000021) {
pr_err_once("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n", c->microcode); pr_err_once("Erratum BDF90: late loading with revision < 0x0b000021 (0x%x) disabled.\n", c->microcode);
...@@ -944,7 +944,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device, ...@@ -944,7 +944,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
return UCODE_NFOUND; return UCODE_NFOUND;
sprintf(name, "intel-ucode/%02x-%02x-%02x", sprintf(name, "intel-ucode/%02x-%02x-%02x",
c->x86, c->x86_model, c->x86_mask); c->x86, c->x86_model, c->x86_stepping);
if (request_firmware_direct(&firmware, name, device)) { if (request_firmware_direct(&firmware, name, device)) {
pr_debug("data file %s load failed\n", name); pr_debug("data file %s load failed\n", name);
......
...@@ -859,7 +859,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size, ...@@ -859,7 +859,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size,
*/ */
if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 && if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 &&
boot_cpu_data.x86_model == 1 && boot_cpu_data.x86_model == 1 &&
boot_cpu_data.x86_mask <= 7) { boot_cpu_data.x86_stepping <= 7) {
if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) { if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
pr_warn("mtrr: base(0x%lx000) is not 4 MiB aligned\n", base); pr_warn("mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);
return -EINVAL; return -EINVAL;
......
...@@ -711,8 +711,8 @@ void __init mtrr_bp_init(void) ...@@ -711,8 +711,8 @@ void __init mtrr_bp_init(void)
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
boot_cpu_data.x86 == 0xF && boot_cpu_data.x86 == 0xF &&
boot_cpu_data.x86_model == 0x3 && boot_cpu_data.x86_model == 0x3 &&
(boot_cpu_data.x86_mask == 0x3 || (boot_cpu_data.x86_stepping == 0x3 ||
boot_cpu_data.x86_mask == 0x4)) boot_cpu_data.x86_stepping == 0x4))
phys_addr = 36; phys_addr = 36;
size_or_mask = SIZE_OR_MASK_BITS(phys_addr); size_or_mask = SIZE_OR_MASK_BITS(phys_addr);
......
...@@ -72,8 +72,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -72,8 +72,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
c->x86_model, c->x86_model,
c->x86_model_id[0] ? c->x86_model_id : "unknown"); c->x86_model_id[0] ? c->x86_model_id : "unknown");
if (c->x86_mask || c->cpuid_level >= 0) if (c->x86_stepping || c->cpuid_level >= 0)
seq_printf(m, "stepping\t: %d\n", c->x86_mask); seq_printf(m, "stepping\t: %d\n", c->x86_stepping);
else else
seq_puts(m, "stepping\t: unknown\n"); seq_puts(m, "stepping\t: unknown\n");
if (c->microcode) if (c->microcode)
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define X86 new_cpu_data+CPUINFO_x86 #define X86 new_cpu_data+CPUINFO_x86
#define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor #define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor
#define X86_MODEL new_cpu_data+CPUINFO_x86_model #define X86_MODEL new_cpu_data+CPUINFO_x86_model
#define X86_MASK new_cpu_data+CPUINFO_x86_mask #define X86_STEPPING new_cpu_data+CPUINFO_x86_stepping
#define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math #define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math
#define X86_CPUID new_cpu_data+CPUINFO_cpuid_level #define X86_CPUID new_cpu_data+CPUINFO_cpuid_level
#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
...@@ -332,7 +332,7 @@ ENTRY(startup_32_smp) ...@@ -332,7 +332,7 @@ ENTRY(startup_32_smp)
shrb $4,%al shrb $4,%al
movb %al,X86_MODEL movb %al,X86_MODEL
andb $0x0f,%cl # mask mask revision andb $0x0f,%cl # mask mask revision
movb %cl,X86_MASK movb %cl,X86_STEPPING
movl %edx,X86_CAPABILITY movl %edx,X86_CAPABILITY
.Lis486: .Lis486:
......
...@@ -407,7 +407,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) ...@@ -407,7 +407,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
processor.apicver = mpc_default_type > 4 ? 0x10 : 0x01; processor.apicver = mpc_default_type > 4 ? 0x10 : 0x01;
processor.cpuflag = CPU_ENABLED; processor.cpuflag = CPU_ENABLED;
processor.cpufeature = (boot_cpu_data.x86 << 8) | processor.cpufeature = (boot_cpu_data.x86 << 8) |
(boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_stepping;
processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX]; processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX];
processor.reserved[0] = 0; processor.reserved[0] = 0;
processor.reserved[1] = 0; processor.reserved[1] = 0;
......
...@@ -18,7 +18,7 @@ unsigned int x86_model(unsigned int sig) ...@@ -18,7 +18,7 @@ unsigned int x86_model(unsigned int sig)
{ {
unsigned int fam, model; unsigned int fam, model;
fam = x86_family(sig); fam = x86_family(sig);
model = (sig >> 4) & 0xf; model = (sig >> 4) & 0xf;
......
...@@ -162,7 +162,7 @@ static int via_rng_init(struct hwrng *rng) ...@@ -162,7 +162,7 @@ static int via_rng_init(struct hwrng *rng)
/* Enable secondary noise source on CPUs where it is present. */ /* Enable secondary noise source on CPUs where it is present. */
/* Nehemiah stepping 8 and higher */ /* Nehemiah stepping 8 and higher */
if ((c->x86_model == 9) && (c->x86_mask > 7)) if ((c->x86_model == 9) && (c->x86_stepping > 7))
lo |= VIA_NOISESRC2; lo |= VIA_NOISESRC2;
/* Esther */ /* Esther */
......
...@@ -629,7 +629,7 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c) ...@@ -629,7 +629,7 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
if (c->x86_vendor == X86_VENDOR_INTEL) { if (c->x86_vendor == X86_VENDOR_INTEL) {
if ((c->x86 == 15) && if ((c->x86 == 15) &&
(c->x86_model == 6) && (c->x86_model == 6) &&
(c->x86_mask == 8)) { (c->x86_stepping == 8)) {
pr_info("Intel(R) Xeon(R) 7100 Errata AL30, processors may lock up on frequency changes: disabling acpi-cpufreq\n"); pr_info("Intel(R) Xeon(R) 7100 Errata AL30, processors may lock up on frequency changes: disabling acpi-cpufreq\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -775,7 +775,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) ...@@ -775,7 +775,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
break; break;
case 7: case 7:
switch (c->x86_mask) { switch (c->x86_stepping) {
case 0: case 0:
longhaul_version = TYPE_LONGHAUL_V1; longhaul_version = TYPE_LONGHAUL_V1;
cpu_model = CPU_SAMUEL2; cpu_model = CPU_SAMUEL2;
...@@ -787,7 +787,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) ...@@ -787,7 +787,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
break; break;
case 1 ... 15: case 1 ... 15:
longhaul_version = TYPE_LONGHAUL_V2; longhaul_version = TYPE_LONGHAUL_V2;
if (c->x86_mask < 8) { if (c->x86_stepping < 8) {
cpu_model = CPU_SAMUEL2; cpu_model = CPU_SAMUEL2;
cpuname = "C3 'Samuel 2' [C5B]"; cpuname = "C3 'Samuel 2' [C5B]";
} else { } else {
...@@ -814,7 +814,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) ...@@ -814,7 +814,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
numscales = 32; numscales = 32;
memcpy(mults, nehemiah_mults, sizeof(nehemiah_mults)); memcpy(mults, nehemiah_mults, sizeof(nehemiah_mults));
memcpy(eblcr, nehemiah_eblcr, sizeof(nehemiah_eblcr)); memcpy(eblcr, nehemiah_eblcr, sizeof(nehemiah_eblcr));
switch (c->x86_mask) { switch (c->x86_stepping) {
case 0 ... 1: case 0 ... 1:
cpu_model = CPU_NEHEMIAH; cpu_model = CPU_NEHEMIAH;
cpuname = "C3 'Nehemiah A' [C5XLOE]"; cpuname = "C3 'Nehemiah A' [C5XLOE]";
......
...@@ -168,7 +168,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) ...@@ -168,7 +168,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
#endif #endif
/* Errata workaround */ /* Errata workaround */
cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_mask; cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_stepping;
switch (cpuid) { switch (cpuid) {
case 0x0f07: case 0x0f07:
case 0x0f0a: case 0x0f0a:
......
...@@ -131,7 +131,7 @@ static int check_powernow(void) ...@@ -131,7 +131,7 @@ static int check_powernow(void)
return 0; return 0;
} }
if ((c->x86_model == 6) && (c->x86_mask == 0)) { if ((c->x86_model == 6) && (c->x86_stepping == 0)) {
pr_info("K7 660[A0] core detected, enabling errata workarounds\n"); pr_info("K7 660[A0] core detected, enabling errata workarounds\n");
have_a0 = 1; have_a0 = 1;
} }
......
...@@ -37,7 +37,7 @@ struct cpu_id ...@@ -37,7 +37,7 @@ struct cpu_id
{ {
__u8 x86; /* CPU family */ __u8 x86; /* CPU family */
__u8 x86_model; /* model */ __u8 x86_model; /* model */
__u8 x86_mask; /* stepping */ __u8 x86_stepping; /* stepping */
}; };
enum { enum {
...@@ -277,7 +277,7 @@ static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c, ...@@ -277,7 +277,7 @@ static int centrino_verify_cpu_id(const struct cpuinfo_x86 *c,
{ {
if ((c->x86 == x->x86) && if ((c->x86 == x->x86) &&
(c->x86_model == x->x86_model) && (c->x86_model == x->x86_model) &&
(c->x86_mask == x->x86_mask)) (c->x86_stepping == x->x86_stepping))
return 1; return 1;
return 0; return 0;
} }
......
...@@ -272,9 +272,9 @@ unsigned int speedstep_detect_processor(void) ...@@ -272,9 +272,9 @@ unsigned int speedstep_detect_processor(void)
ebx = cpuid_ebx(0x00000001); ebx = cpuid_ebx(0x00000001);
ebx &= 0x000000FF; ebx &= 0x000000FF;
pr_debug("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); pr_debug("ebx value is %x, x86_stepping is %x\n", ebx, c->x86_stepping);
switch (c->x86_mask) { switch (c->x86_stepping) {
case 4: case 4:
/* /*
* B-stepping [M-P4-M] * B-stepping [M-P4-M]
...@@ -361,7 +361,7 @@ unsigned int speedstep_detect_processor(void) ...@@ -361,7 +361,7 @@ unsigned int speedstep_detect_processor(void)
msr_lo, msr_hi); msr_lo, msr_hi);
if ((msr_hi & (1<<18)) && if ((msr_hi & (1<<18)) &&
(relaxed_check ? 1 : (msr_hi & (3<<24)))) { (relaxed_check ? 1 : (msr_hi & (3<<24)))) {
if (c->x86_mask == 0x01) { if (c->x86_stepping == 0x01) {
pr_debug("early PIII version\n"); pr_debug("early PIII version\n");
return SPEEDSTEP_CPU_PIII_C_EARLY; return SPEEDSTEP_CPU_PIII_C_EARLY;
} else } else
......
...@@ -512,7 +512,7 @@ static int __init padlock_init(void) ...@@ -512,7 +512,7 @@ static int __init padlock_init(void)
printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n"); printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
if (c->x86 == 6 && c->x86_model == 15 && c->x86_mask == 2) { if (c->x86 == 6 && c->x86_model == 15 && c->x86_stepping == 2) {
ecb_fetch_blocks = MAX_ECB_FETCH_BLOCKS; ecb_fetch_blocks = MAX_ECB_FETCH_BLOCKS;
cbc_fetch_blocks = MAX_CBC_FETCH_BLOCKS; cbc_fetch_blocks = MAX_CBC_FETCH_BLOCKS;
printk(KERN_NOTICE PFX "VIA Nano stepping 2 detected: enabling workaround.\n"); printk(KERN_NOTICE PFX "VIA Nano stepping 2 detected: enabling workaround.\n");
......
...@@ -3147,7 +3147,7 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt) ...@@ -3147,7 +3147,7 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
struct amd64_family_type *fam_type = NULL; struct amd64_family_type *fam_type = NULL;
pvt->ext_model = boot_cpu_data.x86_model >> 4; pvt->ext_model = boot_cpu_data.x86_model >> 4;
pvt->stepping = boot_cpu_data.x86_mask; pvt->stepping = boot_cpu_data.x86_stepping;
pvt->model = boot_cpu_data.x86_model; pvt->model = boot_cpu_data.x86_model;
pvt->fam = boot_cpu_data.x86; pvt->fam = boot_cpu_data.x86;
......
...@@ -268,13 +268,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) ...@@ -268,13 +268,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
for (i = 0; i < ARRAY_SIZE(tjmax_model_table); i++) { for (i = 0; i < ARRAY_SIZE(tjmax_model_table); i++) {
const struct tjmax_model *tm = &tjmax_model_table[i]; const struct tjmax_model *tm = &tjmax_model_table[i];
if (c->x86_model == tm->model && if (c->x86_model == tm->model &&
(tm->mask == ANY || c->x86_mask == tm->mask)) (tm->mask == ANY || c->x86_stepping == tm->mask))
return tm->tjmax; return tm->tjmax;
} }
/* Early chips have no MSR for TjMax */ /* Early chips have no MSR for TjMax */
if (c->x86_model == 0xf && c->x86_mask < 4) if (c->x86_model == 0xf && c->x86_stepping < 4)
usemsr_ee = 0; usemsr_ee = 0;
if (c->x86_model > 0xe && usemsr_ee) { if (c->x86_model > 0xe && usemsr_ee) {
...@@ -425,7 +425,7 @@ static int chk_ucode_version(unsigned int cpu) ...@@ -425,7 +425,7 @@ static int chk_ucode_version(unsigned int cpu)
* Readings might stop update when processor visited too deep sleep, * Readings might stop update when processor visited too deep sleep,
* fixed for stepping D0 (6EC). * fixed for stepping D0 (6EC).
*/ */
if (c->x86_model == 0xe && c->x86_mask < 0xc && c->microcode < 0x39) { if (c->x86_model == 0xe && c->x86_stepping < 0xc && c->microcode < 0x39) {
pr_err("Errata AE18 not fixed, update BIOS or microcode of the CPU!\n"); pr_err("Errata AE18 not fixed, update BIOS or microcode of the CPU!\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -293,7 +293,7 @@ u8 vid_which_vrm(void) ...@@ -293,7 +293,7 @@ u8 vid_which_vrm(void)
if (c->x86 < 6) /* Any CPU with family lower than 6 */ if (c->x86 < 6) /* Any CPU with family lower than 6 */
return 0; /* doesn't have VID */ return 0; /* doesn't have VID */
vrm_ret = find_vrm(c->x86, c->x86_model, c->x86_mask, c->x86_vendor); vrm_ret = find_vrm(c->x86, c->x86_model, c->x86_stepping, c->x86_vendor);
if (vrm_ret == 134) if (vrm_ret == 134)
vrm_ret = get_via_model_d_vrm(); vrm_ret = get_via_model_d_vrm();
if (vrm_ret == 0) if (vrm_ret == 0)
......
...@@ -226,7 +226,7 @@ static bool has_erratum_319(struct pci_dev *pdev) ...@@ -226,7 +226,7 @@ static bool has_erratum_319(struct pci_dev *pdev)
* and AM3 formats, but that's the best we can do. * and AM3 formats, but that's the best we can do.
*/ */
return boot_cpu_data.x86_model < 4 || return boot_cpu_data.x86_model < 4 ||
(boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask <= 2); (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_stepping <= 2);
} }
static int k10temp_probe(struct pci_dev *pdev, static int k10temp_probe(struct pci_dev *pdev,
......
...@@ -187,7 +187,7 @@ static int k8temp_probe(struct pci_dev *pdev, ...@@ -187,7 +187,7 @@ static int k8temp_probe(struct pci_dev *pdev,
return -ENOMEM; return -ENOMEM;
model = boot_cpu_data.x86_model; model = boot_cpu_data.x86_model;
stepping = boot_cpu_data.x86_mask; stepping = boot_cpu_data.x86_stepping;
/* feature available since SH-C0, exclude older revisions */ /* feature available since SH-C0, exclude older revisions */
if ((model == 4 && stepping == 0) || if ((model == 4 && stepping == 0) ||
......
...@@ -127,7 +127,7 @@ void gx_set_dclk_frequency(struct fb_info *info) ...@@ -127,7 +127,7 @@ void gx_set_dclk_frequency(struct fb_info *info)
int timeout = 1000; int timeout = 1000;
/* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */ /* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */
if (cpu_data(0).x86_mask == 1) { if (cpu_data(0).x86_stepping == 1) {
pll_table = gx_pll_table_14MHz; pll_table = gx_pll_table_14MHz;
pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz); pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment