Skip to content

Commit 325cbb0

Browse files
Jia Zhanggregkh
authored andcommitted
x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
commit b399151 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 73f231c commit 325cbb0

35 files changed

Lines changed: 73 additions & 73 deletions

‎arch/x86/events/intel/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3559,7 +3559,7 @@ static int intel_snb_pebs_broken(int cpu)
35593559
break;
35603560

35613561
case INTEL_FAM6_SANDYBRIDGE_X:
3562-
switch (cpu_data(cpu).x86_mask) {
3562+
switch (cpu_data(cpu).x86_stepping) {
35633563
case 6: rev = 0x618; break;
35643564
case 7: rev = 0x70c; break;
35653565
}

‎arch/x86/events/intel/lbr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ void __init intel_pmu_lbr_init_atom(void)
11861186
* on PMU interrupt
11871187
*/
11881188
if (boot_cpu_data.x86_model == 28
1189-
&& boot_cpu_data.x86_mask < 10) {
1189+
&& boot_cpu_data.x86_stepping < 10) {
11901190
pr_cont("LBR disabled due to erratum");
11911191
return;
11921192
}

‎arch/x86/events/intel/p6.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static __initconst const struct x86_pmu p6_pmu = {
234234

235235
static __init void p6_pmu_rdpmc_quirk(void)
236236
{
237-
if (boot_cpu_data.x86_mask < 9) {
237+
if (boot_cpu_data.x86_stepping < 9) {
238238
/*
239239
* PPro erratum 26; fixed in stepping 9 and above.
240240
*/

‎arch/x86/include/asm/acpi.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
9494
if (boot_cpu_data.x86 == 0x0F &&
9595
boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
9696
boot_cpu_data.x86_model <= 0x05 &&
97-
boot_cpu_data.x86_mask < 0x0A)
97+
boot_cpu_data.x86_stepping < 0x0A)
9898
return 1;
9999
else if (boot_cpu_has(X86_BUG_AMD_APIC_C1E))
100100
return 1;

‎arch/x86/include/asm/processor.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct cpuinfo_x86 {
9191
__u8 x86; /* CPU family */
9292
__u8 x86_vendor; /* CPU vendor */
9393
__u8 x86_model;
94-
__u8 x86_mask;
94+
__u8 x86_stepping;
9595
#ifdef CONFIG_X86_64
9696
/* Number of 4K pages in DTLB/ITLB combined(in pages): */
9797
int x86_tlbsize;

‎arch/x86/kernel/amd_nb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ int amd_cache_northbridges(void)
235235
if (boot_cpu_data.x86 == 0x10 &&
236236
boot_cpu_data.x86_model >= 0x8 &&
237237
(boot_cpu_data.x86_model > 0x9 ||
238-
boot_cpu_data.x86_mask >= 0x1))
238+
boot_cpu_data.x86_stepping >= 0x1))
239239
amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE;
240240

241241
if (boot_cpu_data.x86 == 0x15)

‎arch/x86/kernel/apic/apic.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
553553

554554
static u32 hsx_deadline_rev(void)
555555
{
556-
switch (boot_cpu_data.x86_mask) {
556+
switch (boot_cpu_data.x86_stepping) {
557557
case 0x02: return 0x3a; /* EP */
558558
case 0x04: return 0x0f; /* EX */
559559
}
@@ -563,7 +563,7 @@ static u32 hsx_deadline_rev(void)
563563

564564
static u32 bdx_deadline_rev(void)
565565
{
566-
switch (boot_cpu_data.x86_mask) {
566+
switch (boot_cpu_data.x86_stepping) {
567567
case 0x02: return 0x00000011;
568568
case 0x03: return 0x0700000e;
569569
case 0x04: return 0x0f00000c;
@@ -575,7 +575,7 @@ static u32 bdx_deadline_rev(void)
575575

576576
static u32 skx_deadline_rev(void)
577577
{
578-
switch (boot_cpu_data.x86_mask) {
578+
switch (boot_cpu_data.x86_stepping) {
579579
case 0x03: return 0x01000136;
580580
case 0x04: return 0x02000014;
581581
}

‎arch/x86/kernel/asm-offsets_32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void foo(void)
1818
OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
1919
OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
2020
OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
21-
OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask);
21+
OFFSET(CPUINFO_x86_stepping, cpuinfo_x86, x86_stepping);
2222
OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
2323
OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
2424
OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);

‎arch/x86/kernel/cpu/amd.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
119119
return;
120120
}
121121

122-
if (c->x86_model == 6 && c->x86_mask == 1) {
122+
if (c->x86_model == 6 && c->x86_stepping == 1) {
123123
const int K6_BUG_LOOP = 1000000;
124124
int n;
125125
void (*f_vide)(void);
@@ -149,7 +149,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
149149

150150
/* K6 with old style WHCR */
151151
if (c->x86_model < 8 ||
152-
(c->x86_model == 8 && c->x86_mask < 8)) {
152+
(c->x86_model == 8 && c->x86_stepping < 8)) {
153153
/* We can only write allocate on the low 508Mb */
154154
if (mbytes > 508)
155155
mbytes = 508;
@@ -168,7 +168,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
168168
return;
169169
}
170170

171-
if ((c->x86_model == 8 && c->x86_mask > 7) ||
171+
if ((c->x86_model == 8 && c->x86_stepping > 7) ||
172172
c->x86_model == 9 || c->x86_model == 13) {
173173
/* The more serious chips .. */
174174

@@ -221,7 +221,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
221221
* are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx
222222
* As per AMD technical note 27212 0.2
223223
*/
224-
if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) {
224+
if ((c->x86_model == 8 && c->x86_stepping >= 1) || (c->x86_model > 8)) {
225225
rdmsr(MSR_K7_CLK_CTL, l, h);
226226
if ((l & 0xfff00000) != 0x20000000) {
227227
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)
241241
* but they are not certified as MP capable.
242242
*/
243243
/* Athlon 660/661 is valid. */
244-
if ((c->x86_model == 6) && ((c->x86_mask == 0) ||
245-
(c->x86_mask == 1)))
244+
if ((c->x86_model == 6) && ((c->x86_stepping == 0) ||
245+
(c->x86_stepping == 1)))
246246
return;
247247

248248
/* Duron 670 is valid */
249-
if ((c->x86_model == 7) && (c->x86_mask == 0))
249+
if ((c->x86_model == 7) && (c->x86_stepping == 0))
250250
return;
251251

252252
/*
@@ -256,8 +256,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
256256
* See http://www.heise.de/newsticker/data/jow-18.10.01-000 for
257257
* more.
258258
*/
259-
if (((c->x86_model == 6) && (c->x86_mask >= 2)) ||
260-
((c->x86_model == 7) && (c->x86_mask >= 1)) ||
259+
if (((c->x86_model == 6) && (c->x86_stepping >= 2)) ||
260+
((c->x86_model == 7) && (c->x86_stepping >= 1)) ||
261261
(c->x86_model > 7))
262262
if (cpu_has(c, X86_FEATURE_MP))
263263
return;
@@ -583,7 +583,7 @@ static void early_init_amd(struct cpuinfo_x86 *c)
583583
/* Set MTRR capability flag if appropriate */
584584
if (c->x86 == 5)
585585
if (c->x86_model == 13 || c->x86_model == 9 ||
586-
(c->x86_model == 8 && c->x86_mask >= 8))
586+
(c->x86_model == 8 && c->x86_stepping >= 8))
587587
set_cpu_cap(c, X86_FEATURE_K6_MTRR);
588588
#endif
589589
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
@@ -769,7 +769,7 @@ static void init_amd_zn(struct cpuinfo_x86 *c)
769769
* Fix erratum 1076: CPB feature bit not being set in CPUID. It affects
770770
* all up to and including B1.
771771
*/
772-
if (c->x86_model <= 1 && c->x86_mask <= 1)
772+
if (c->x86_model <= 1 && c->x86_stepping <= 1)
773773
set_cpu_cap(c, X86_FEATURE_CPB);
774774
}
775775

@@ -880,11 +880,11 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
880880
/* AMD errata T13 (order #21922) */
881881
if ((c->x86 == 6)) {
882882
/* Duron Rev A0 */
883-
if (c->x86_model == 3 && c->x86_mask == 0)
883+
if (c->x86_model == 3 && c->x86_stepping == 0)
884884
size = 64;
885885
/* Tbird rev A1/A2 */
886886
if (c->x86_model == 4 &&
887-
(c->x86_mask == 0 || c->x86_mask == 1))
887+
(c->x86_stepping == 0 || c->x86_stepping == 1))
888888
size = 256;
889889
}
890890
return size;
@@ -1021,7 +1021,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
10211021
}
10221022

10231023
/* OSVW unavailable or ID unknown, match family-model-stepping range */
1024-
ms = (cpu->x86_model << 4) | cpu->x86_mask;
1024+
ms = (cpu->x86_model << 4) | cpu->x86_stepping;
10251025
while ((range = *erratum++))
10261026
if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
10271027
(ms >= AMD_MODEL_RANGE_START(range)) &&

‎arch/x86/kernel/cpu/centaur.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
136136
clear_cpu_cap(c, X86_FEATURE_TSC);
137137
break;
138138
case 8:
139-
switch (c->x86_mask) {
139+
switch (c->x86_stepping) {
140140
default:
141141
name = "2";
142142
break;
@@ -211,7 +211,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
211211
* - Note, it seems this may only be in engineering samples.
212212
*/
213213
if ((c->x86 == 6) && (c->x86_model == 9) &&
214-
(c->x86_mask == 1) && (size == 65))
214+
(c->x86_stepping == 1) && (size == 65))
215215
size -= 1;
216216
return size;
217217
}

0 commit comments

Comments
 (0)