Skip to content

Commit 06be007

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 b0809f5 commit 06be007

34 files changed

Lines changed: 69 additions & 69 deletions

arch/x86/events/intel/core.c

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

33653365
case INTEL_FAM6_SANDYBRIDGE_X:
3366-
switch (cpu_data(cpu).x86_mask) {
3366+
switch (cpu_data(cpu).x86_stepping) {
33673367
case 6: rev = 0x618; break;
33683368
case 7: rev = 0x70c; break;
33693369
}

arch/x86/events/intel/lbr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ void __init intel_pmu_lbr_init_atom(void)
11311131
* on PMU interrupt
11321132
*/
11331133
if (boot_cpu_data.x86_model == 28
1134-
&& boot_cpu_data.x86_mask < 10) {
1134+
&& boot_cpu_data.x86_stepping < 10) {
11351135
pr_cont("LBR disabled due to erratum");
11361136
return;
11371137
}

arch/x86/events/intel/p6.c

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

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

arch/x86/include/asm/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
9292
if (boot_cpu_data.x86 == 0x0F &&
9393
boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
9494
boot_cpu_data.x86_model <= 0x05 &&
95-
boot_cpu_data.x86_mask < 0x0A)
95+
boot_cpu_data.x86_stepping < 0x0A)
9696
return 1;
9797
else if (amd_e400_c1e_detected)
9898
return 1;

arch/x86/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct cpuinfo_x86 {
8888
__u8 x86; /* CPU family */
8989
__u8 x86_vendor; /* CPU vendor */
9090
__u8 x86_model;
91-
__u8 x86_mask;
91+
__u8 x86_stepping;
9292
#ifdef CONFIG_X86_32
9393
char wp_works_ok; /* It doesn't on 386's */
9494

arch/x86/kernel/amd_nb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int amd_cache_northbridges(void)
105105
if (boot_cpu_data.x86 == 0x10 &&
106106
boot_cpu_data.x86_model >= 0x8 &&
107107
(boot_cpu_data.x86_model > 0x9 ||
108-
boot_cpu_data.x86_mask >= 0x1))
108+
boot_cpu_data.x86_stepping >= 0x1))
109109
amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE;
110110

111111
if (boot_cpu_data.x86 == 0x15)

arch/x86/kernel/asm-offsets_32.c

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

arch/x86/kernel/cpu/amd.c

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

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

148148
/* K6 with old style WHCR */
149149
if (c->x86_model < 8 ||
150-
(c->x86_model == 8 && c->x86_mask < 8)) {
150+
(c->x86_model == 8 && c->x86_stepping < 8)) {
151151
/* We can only write allocate on the low 508Mb */
152152
if (mbytes > 508)
153153
mbytes = 508;
@@ -166,7 +166,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
166166
return;
167167
}
168168

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

@@ -219,7 +219,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
219219
* are more robust with CLK_CTL set to 200xxxxx instead of 600xxxxx
220220
* As per AMD technical note 27212 0.2
221221
*/
222-
if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) {
222+
if ((c->x86_model == 8 && c->x86_stepping >= 1) || (c->x86_model > 8)) {
223223
rdmsr(MSR_K7_CLK_CTL, l, h);
224224
if ((l & 0xfff00000) != 0x20000000) {
225225
pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
@@ -239,12 +239,12 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
239239
* but they are not certified as MP capable.
240240
*/
241241
/* Athlon 660/661 is valid. */
242-
if ((c->x86_model == 6) && ((c->x86_mask == 0) ||
243-
(c->x86_mask == 1)))
242+
if ((c->x86_model == 6) && ((c->x86_stepping == 0) ||
243+
(c->x86_stepping == 1)))
244244
return;
245245

246246
/* Duron 670 is valid */
247-
if ((c->x86_model == 7) && (c->x86_mask == 0))
247+
if ((c->x86_model == 7) && (c->x86_stepping == 0))
248248
return;
249249

250250
/*
@@ -254,8 +254,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
254254
* See http://www.heise.de/newsticker/data/jow-18.10.01-000 for
255255
* more.
256256
*/
257-
if (((c->x86_model == 6) && (c->x86_mask >= 2)) ||
258-
((c->x86_model == 7) && (c->x86_mask >= 1)) ||
257+
if (((c->x86_model == 6) && (c->x86_stepping >= 2)) ||
258+
((c->x86_model == 7) && (c->x86_stepping >= 1)) ||
259259
(c->x86_model > 7))
260260
if (cpu_has(c, X86_FEATURE_MP))
261261
return;
@@ -569,7 +569,7 @@ static void early_init_amd(struct cpuinfo_x86 *c)
569569
/* Set MTRR capability flag if appropriate */
570570
if (c->x86 == 5)
571571
if (c->x86_model == 13 || c->x86_model == 9 ||
572-
(c->x86_model == 8 && c->x86_mask >= 8))
572+
(c->x86_model == 8 && c->x86_stepping >= 8))
573573
set_cpu_cap(c, X86_FEATURE_K6_MTRR);
574574
#endif
575575
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
@@ -834,11 +834,11 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
834834
/* AMD errata T13 (order #21922) */
835835
if ((c->x86 == 6)) {
836836
/* Duron Rev A0 */
837-
if (c->x86_model == 3 && c->x86_mask == 0)
837+
if (c->x86_model == 3 && c->x86_stepping == 0)
838838
size = 64;
839839
/* Tbird rev A1/A2 */
840840
if (c->x86_model == 4 &&
841-
(c->x86_mask == 0 || c->x86_mask == 1))
841+
(c->x86_stepping == 0 || c->x86_stepping == 1))
842842
size = 256;
843843
}
844844
return size;
@@ -975,7 +975,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
975975
}
976976

977977
/* OSVW unavailable or ID unknown, match family-model-stepping range */
978-
ms = (cpu->x86_model << 4) | cpu->x86_mask;
978+
ms = (cpu->x86_model << 4) | cpu->x86_stepping;
979979
while ((range = *erratum++))
980980
if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
981981
(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
@@ -134,7 +134,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
134134
clear_cpu_cap(c, X86_FEATURE_TSC);
135135
break;
136136
case 8:
137-
switch (c->x86_mask) {
137+
switch (c->x86_stepping) {
138138
default:
139139
name = "2";
140140
break;
@@ -209,7 +209,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
209209
* - Note, it seems this may only be in engineering samples.
210210
*/
211211
if ((c->x86 == 6) && (c->x86_model == 9) &&
212-
(c->x86_mask == 1) && (size == 65))
212+
(c->x86_stepping == 1) && (size == 65))
213213
size -= 1;
214214
return size;
215215
}

arch/x86/kernel/cpu/common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ void cpu_detect(struct cpuinfo_x86 *c)
699699
cpuid(0x00000001, &tfms, &misc, &junk, &cap0);
700700
c->x86 = x86_family(tfms);
701701
c->x86_model = x86_model(tfms);
702-
c->x86_mask = x86_stepping(tfms);
702+
c->x86_stepping = x86_stepping(tfms);
703703

704704
if (cap0 & (1<<19)) {
705705
c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
@@ -1146,7 +1146,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
11461146
c->loops_per_jiffy = loops_per_jiffy;
11471147
c->x86_cache_size = -1;
11481148
c->x86_vendor = X86_VENDOR_UNKNOWN;
1149-
c->x86_model = c->x86_mask = 0; /* So far unknown... */
1149+
c->x86_model = c->x86_stepping = 0; /* So far unknown... */
11501150
c->x86_vendor_id[0] = '\0'; /* Unset */
11511151
c->x86_model_id[0] = '\0'; /* Unset */
11521152
c->x86_max_cores = 1;
@@ -1391,8 +1391,8 @@ void print_cpu_info(struct cpuinfo_x86 *c)
13911391

13921392
pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
13931393

1394-
if (c->x86_mask || c->cpuid_level >= 0)
1395-
pr_cont(", stepping: 0x%x)\n", c->x86_mask);
1394+
if (c->x86_stepping || c->cpuid_level >= 0)
1395+
pr_cont(", stepping: 0x%x)\n", c->x86_stepping);
13961396
else
13971397
pr_cont(")\n");
13981398

0 commit comments

Comments
 (0)