Skip to content

Commit d580d74

Browse files
committed
Merge tag 'x86_cpu_for_v6.12_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpuid updates from Borislav Petkov: - Add the final conversions to the new Intel VFM CPU model matching macros which include the vendor and finally drop the old ones which hardcode family 6 * tag 'x86_cpu_for_v6.12_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu/vfm: Delete all the *_FAM6_ CPU #defines x86/cpu/vfm: Delete X86_MATCH_INTEL_FAM6_MODEL[_STEPPING]() macros extcon: axp288: Switch to new Intel CPU model defines x86/cpu/intel: Replace PAT erratum model/family magic numbers with symbolic IFM references
2 parents b56dff2 + db4001f commit d580d74

File tree

4 files changed

+15
-112
lines changed

4 files changed

+15
-112
lines changed

arch/x86/include/asm/cpu_device_id.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,6 @@
192192
#define X86_MATCH_VENDOR_FAM(vendor, family, data) \
193193
X86_MATCH_VENDOR_FAM_MODEL(vendor, family, X86_MODEL_ANY, data)
194194

195-
/**
196-
* X86_MATCH_INTEL_FAM6_MODEL - Match vendor INTEL, family 6 and model
197-
* @model: The model name without the INTEL_FAM6_ prefix or ANY
198-
* The model name is expanded to INTEL_FAM6_@model internally
199-
* @data: Driver specific data or NULL. The internal storage
200-
* format is unsigned long. The supplied value, pointer
201-
* etc. is casted to unsigned long internally.
202-
*
203-
* The vendor is set to INTEL, the family to 6 and all other missing
204-
* arguments of X86_MATCH_VENDOR_FAM_MODEL_FEATURE() are set to wildcards.
205-
*
206-
* See X86_MATCH_VENDOR_FAM_MODEL_FEATURE() for further information.
207-
*/
208-
#define X86_MATCH_INTEL_FAM6_MODEL(model, data) \
209-
X86_MATCH_VENDOR_FAM_MODEL(INTEL, 6, INTEL_FAM6_##model, data)
210-
211-
#define X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(model, steppings, data) \
212-
X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE(INTEL, 6, INTEL_FAM6_##model, \
213-
steppings, X86_FEATURE_ANY, data)
214-
215195
/**
216196
* X86_MATCH_VFM - Match encoded vendor/family/model
217197
* @vfm: Encoded 8-bits each for vendor, family, model

arch/x86/include/asm/intel-family.h

Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* that group keep the CPUID for the variants sorted by model number.
1111
*
1212
* The defined symbol names have the following form:
13-
* INTEL_FAM6{OPTFAMILY}_{MICROARCH}{OPTDIFF}
13+
* INTEL_{OPTFAMILY}_{MICROARCH}{OPTDIFF}
1414
* where:
1515
* OPTFAMILY Describes the family of CPUs that this belongs to. Default
1616
* is assumed to be "_CORE" (and should be omitted). Other values
@@ -42,215 +42,136 @@
4242

4343
#define IFM(_fam, _model) VFM_MAKE(X86_VENDOR_INTEL, _fam, _model)
4444

45-
/* Wildcard match for FAM6 so X86_MATCH_INTEL_FAM6_MODEL(ANY) works */
46-
#define INTEL_FAM6_ANY X86_MODEL_ANY
47-
/* Wildcard match for FAM6 so X86_MATCH_VFM(ANY) works */
45+
/* Wildcard match so X86_MATCH_VFM(ANY) works */
4846
#define INTEL_ANY IFM(X86_FAMILY_ANY, X86_MODEL_ANY)
4947

50-
#define INTEL_FAM6_CORE_YONAH 0x0E
48+
#define INTEL_PENTIUM_PRO IFM(6, 0x01)
49+
5150
#define INTEL_CORE_YONAH IFM(6, 0x0E)
5251

53-
#define INTEL_FAM6_CORE2_MEROM 0x0F
5452
#define INTEL_CORE2_MEROM IFM(6, 0x0F)
55-
#define INTEL_FAM6_CORE2_MEROM_L 0x16
5653
#define INTEL_CORE2_MEROM_L IFM(6, 0x16)
57-
#define INTEL_FAM6_CORE2_PENRYN 0x17
5854
#define INTEL_CORE2_PENRYN IFM(6, 0x17)
59-
#define INTEL_FAM6_CORE2_DUNNINGTON 0x1D
6055
#define INTEL_CORE2_DUNNINGTON IFM(6, 0x1D)
6156

62-
#define INTEL_FAM6_NEHALEM 0x1E
6357
#define INTEL_NEHALEM IFM(6, 0x1E)
64-
#define INTEL_FAM6_NEHALEM_G 0x1F /* Auburndale / Havendale */
6558
#define INTEL_NEHALEM_G IFM(6, 0x1F) /* Auburndale / Havendale */
66-
#define INTEL_FAM6_NEHALEM_EP 0x1A
6759
#define INTEL_NEHALEM_EP IFM(6, 0x1A)
68-
#define INTEL_FAM6_NEHALEM_EX 0x2E
6960
#define INTEL_NEHALEM_EX IFM(6, 0x2E)
7061

71-
#define INTEL_FAM6_WESTMERE 0x25
7262
#define INTEL_WESTMERE IFM(6, 0x25)
73-
#define INTEL_FAM6_WESTMERE_EP 0x2C
7463
#define INTEL_WESTMERE_EP IFM(6, 0x2C)
75-
#define INTEL_FAM6_WESTMERE_EX 0x2F
7664
#define INTEL_WESTMERE_EX IFM(6, 0x2F)
7765

78-
#define INTEL_FAM6_SANDYBRIDGE 0x2A
7966
#define INTEL_SANDYBRIDGE IFM(6, 0x2A)
80-
#define INTEL_FAM6_SANDYBRIDGE_X 0x2D
8167
#define INTEL_SANDYBRIDGE_X IFM(6, 0x2D)
82-
#define INTEL_FAM6_IVYBRIDGE 0x3A
8368
#define INTEL_IVYBRIDGE IFM(6, 0x3A)
84-
#define INTEL_FAM6_IVYBRIDGE_X 0x3E
8569
#define INTEL_IVYBRIDGE_X IFM(6, 0x3E)
8670

87-
#define INTEL_FAM6_HASWELL 0x3C
8871
#define INTEL_HASWELL IFM(6, 0x3C)
89-
#define INTEL_FAM6_HASWELL_X 0x3F
9072
#define INTEL_HASWELL_X IFM(6, 0x3F)
91-
#define INTEL_FAM6_HASWELL_L 0x45
9273
#define INTEL_HASWELL_L IFM(6, 0x45)
93-
#define INTEL_FAM6_HASWELL_G 0x46
9474
#define INTEL_HASWELL_G IFM(6, 0x46)
9575

96-
#define INTEL_FAM6_BROADWELL 0x3D
9776
#define INTEL_BROADWELL IFM(6, 0x3D)
98-
#define INTEL_FAM6_BROADWELL_G 0x47
9977
#define INTEL_BROADWELL_G IFM(6, 0x47)
100-
#define INTEL_FAM6_BROADWELL_X 0x4F
10178
#define INTEL_BROADWELL_X IFM(6, 0x4F)
102-
#define INTEL_FAM6_BROADWELL_D 0x56
10379
#define INTEL_BROADWELL_D IFM(6, 0x56)
10480

105-
#define INTEL_FAM6_SKYLAKE_L 0x4E /* Sky Lake */
10681
#define INTEL_SKYLAKE_L IFM(6, 0x4E) /* Sky Lake */
107-
#define INTEL_FAM6_SKYLAKE 0x5E /* Sky Lake */
10882
#define INTEL_SKYLAKE IFM(6, 0x5E) /* Sky Lake */
109-
#define INTEL_FAM6_SKYLAKE_X 0x55 /* Sky Lake */
11083
#define INTEL_SKYLAKE_X IFM(6, 0x55) /* Sky Lake */
11184
/* CASCADELAKE_X 0x55 Sky Lake -- s: 7 */
11285
/* COOPERLAKE_X 0x55 Sky Lake -- s: 11 */
11386

114-
#define INTEL_FAM6_KABYLAKE_L 0x8E /* Sky Lake */
11587
#define INTEL_KABYLAKE_L IFM(6, 0x8E) /* Sky Lake */
11688
/* AMBERLAKE_L 0x8E Sky Lake -- s: 9 */
11789
/* COFFEELAKE_L 0x8E Sky Lake -- s: 10 */
11890
/* WHISKEYLAKE_L 0x8E Sky Lake -- s: 11,12 */
11991

120-
#define INTEL_FAM6_KABYLAKE 0x9E /* Sky Lake */
12192
#define INTEL_KABYLAKE IFM(6, 0x9E) /* Sky Lake */
12293
/* COFFEELAKE 0x9E Sky Lake -- s: 10-13 */
12394

124-
#define INTEL_FAM6_COMETLAKE 0xA5 /* Sky Lake */
12595
#define INTEL_COMETLAKE IFM(6, 0xA5) /* Sky Lake */
126-
#define INTEL_FAM6_COMETLAKE_L 0xA6 /* Sky Lake */
12796
#define INTEL_COMETLAKE_L IFM(6, 0xA6) /* Sky Lake */
12897

129-
#define INTEL_FAM6_CANNONLAKE_L 0x66 /* Palm Cove */
13098
#define INTEL_CANNONLAKE_L IFM(6, 0x66) /* Palm Cove */
13199

132-
#define INTEL_FAM6_ICELAKE_X 0x6A /* Sunny Cove */
133100
#define INTEL_ICELAKE_X IFM(6, 0x6A) /* Sunny Cove */
134-
#define INTEL_FAM6_ICELAKE_D 0x6C /* Sunny Cove */
135101
#define INTEL_ICELAKE_D IFM(6, 0x6C) /* Sunny Cove */
136-
#define INTEL_FAM6_ICELAKE 0x7D /* Sunny Cove */
137102
#define INTEL_ICELAKE IFM(6, 0x7D) /* Sunny Cove */
138-
#define INTEL_FAM6_ICELAKE_L 0x7E /* Sunny Cove */
139103
#define INTEL_ICELAKE_L IFM(6, 0x7E) /* Sunny Cove */
140-
#define INTEL_FAM6_ICELAKE_NNPI 0x9D /* Sunny Cove */
141104
#define INTEL_ICELAKE_NNPI IFM(6, 0x9D) /* Sunny Cove */
142105

143-
#define INTEL_FAM6_ROCKETLAKE 0xA7 /* Cypress Cove */
144106
#define INTEL_ROCKETLAKE IFM(6, 0xA7) /* Cypress Cove */
145107

146-
#define INTEL_FAM6_TIGERLAKE_L 0x8C /* Willow Cove */
147108
#define INTEL_TIGERLAKE_L IFM(6, 0x8C) /* Willow Cove */
148-
#define INTEL_FAM6_TIGERLAKE 0x8D /* Willow Cove */
149109
#define INTEL_TIGERLAKE IFM(6, 0x8D) /* Willow Cove */
150110

151-
#define INTEL_FAM6_SAPPHIRERAPIDS_X 0x8F /* Golden Cove */
152111
#define INTEL_SAPPHIRERAPIDS_X IFM(6, 0x8F) /* Golden Cove */
153112

154-
#define INTEL_FAM6_EMERALDRAPIDS_X 0xCF
155113
#define INTEL_EMERALDRAPIDS_X IFM(6, 0xCF)
156114

157-
#define INTEL_FAM6_GRANITERAPIDS_X 0xAD
158115
#define INTEL_GRANITERAPIDS_X IFM(6, 0xAD)
159-
#define INTEL_FAM6_GRANITERAPIDS_D 0xAE
160116
#define INTEL_GRANITERAPIDS_D IFM(6, 0xAE)
161117

162118
/* "Hybrid" Processors (P-Core/E-Core) */
163119

164-
#define INTEL_FAM6_LAKEFIELD 0x8A /* Sunny Cove / Tremont */
165120
#define INTEL_LAKEFIELD IFM(6, 0x8A) /* Sunny Cove / Tremont */
166121

167-
#define INTEL_FAM6_ALDERLAKE 0x97 /* Golden Cove / Gracemont */
168122
#define INTEL_ALDERLAKE IFM(6, 0x97) /* Golden Cove / Gracemont */
169-
#define INTEL_FAM6_ALDERLAKE_L 0x9A /* Golden Cove / Gracemont */
170123
#define INTEL_ALDERLAKE_L IFM(6, 0x9A) /* Golden Cove / Gracemont */
171124

172-
#define INTEL_FAM6_RAPTORLAKE 0xB7 /* Raptor Cove / Enhanced Gracemont */
173125
#define INTEL_RAPTORLAKE IFM(6, 0xB7) /* Raptor Cove / Enhanced Gracemont */
174-
#define INTEL_FAM6_RAPTORLAKE_P 0xBA
175126
#define INTEL_RAPTORLAKE_P IFM(6, 0xBA)
176-
#define INTEL_FAM6_RAPTORLAKE_S 0xBF
177127
#define INTEL_RAPTORLAKE_S IFM(6, 0xBF)
178128

179-
#define INTEL_FAM6_METEORLAKE 0xAC
180129
#define INTEL_METEORLAKE IFM(6, 0xAC)
181-
#define INTEL_FAM6_METEORLAKE_L 0xAA
182130
#define INTEL_METEORLAKE_L IFM(6, 0xAA)
183131

184-
#define INTEL_FAM6_ARROWLAKE_H 0xC5
185132
#define INTEL_ARROWLAKE_H IFM(6, 0xC5)
186-
#define INTEL_FAM6_ARROWLAKE 0xC6
187133
#define INTEL_ARROWLAKE IFM(6, 0xC6)
188-
#define INTEL_FAM6_ARROWLAKE_U 0xB5
189134
#define INTEL_ARROWLAKE_U IFM(6, 0xB5)
190135

191-
#define INTEL_FAM6_LUNARLAKE_M 0xBD
192136
#define INTEL_LUNARLAKE_M IFM(6, 0xBD)
193137

194138
/* "Small Core" Processors (Atom/E-Core) */
195139

196-
#define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
197140
#define INTEL_ATOM_BONNELL IFM(6, 0x1C) /* Diamondville, Pineview */
198-
#define INTEL_FAM6_ATOM_BONNELL_MID 0x26 /* Silverthorne, Lincroft */
199141
#define INTEL_ATOM_BONNELL_MID IFM(6, 0x26) /* Silverthorne, Lincroft */
200142

201-
#define INTEL_FAM6_ATOM_SALTWELL 0x36 /* Cedarview */
202143
#define INTEL_ATOM_SALTWELL IFM(6, 0x36) /* Cedarview */
203-
#define INTEL_FAM6_ATOM_SALTWELL_MID 0x27 /* Penwell */
204144
#define INTEL_ATOM_SALTWELL_MID IFM(6, 0x27) /* Penwell */
205-
#define INTEL_FAM6_ATOM_SALTWELL_TABLET 0x35 /* Cloverview */
206145
#define INTEL_ATOM_SALTWELL_TABLET IFM(6, 0x35) /* Cloverview */
207146

208-
#define INTEL_FAM6_ATOM_SILVERMONT 0x37 /* Bay Trail, Valleyview */
209147
#define INTEL_ATOM_SILVERMONT IFM(6, 0x37) /* Bay Trail, Valleyview */
210-
#define INTEL_FAM6_ATOM_SILVERMONT_D 0x4D /* Avaton, Rangely */
211148
#define INTEL_ATOM_SILVERMONT_D IFM(6, 0x4D) /* Avaton, Rangely */
212-
#define INTEL_FAM6_ATOM_SILVERMONT_MID 0x4A /* Merriefield */
213149
#define INTEL_ATOM_SILVERMONT_MID IFM(6, 0x4A) /* Merriefield */
214150

215-
#define INTEL_FAM6_ATOM_AIRMONT 0x4C /* Cherry Trail, Braswell */
216151
#define INTEL_ATOM_AIRMONT IFM(6, 0x4C) /* Cherry Trail, Braswell */
217-
#define INTEL_FAM6_ATOM_AIRMONT_MID 0x5A /* Moorefield */
218152
#define INTEL_ATOM_AIRMONT_MID IFM(6, 0x5A) /* Moorefield */
219-
#define INTEL_FAM6_ATOM_AIRMONT_NP 0x75 /* Lightning Mountain */
220153
#define INTEL_ATOM_AIRMONT_NP IFM(6, 0x75) /* Lightning Mountain */
221154

222-
#define INTEL_FAM6_ATOM_GOLDMONT 0x5C /* Apollo Lake */
223155
#define INTEL_ATOM_GOLDMONT IFM(6, 0x5C) /* Apollo Lake */
224-
#define INTEL_FAM6_ATOM_GOLDMONT_D 0x5F /* Denverton */
225156
#define INTEL_ATOM_GOLDMONT_D IFM(6, 0x5F) /* Denverton */
226157

227158
/* Note: the micro-architecture is "Goldmont Plus" */
228-
#define INTEL_FAM6_ATOM_GOLDMONT_PLUS 0x7A /* Gemini Lake */
229159
#define INTEL_ATOM_GOLDMONT_PLUS IFM(6, 0x7A) /* Gemini Lake */
230160

231-
#define INTEL_FAM6_ATOM_TREMONT_D 0x86 /* Jacobsville */
232161
#define INTEL_ATOM_TREMONT_D IFM(6, 0x86) /* Jacobsville */
233-
#define INTEL_FAM6_ATOM_TREMONT 0x96 /* Elkhart Lake */
234162
#define INTEL_ATOM_TREMONT IFM(6, 0x96) /* Elkhart Lake */
235-
#define INTEL_FAM6_ATOM_TREMONT_L 0x9C /* Jasper Lake */
236163
#define INTEL_ATOM_TREMONT_L IFM(6, 0x9C) /* Jasper Lake */
237164

238-
#define INTEL_FAM6_ATOM_GRACEMONT 0xBE /* Alderlake N */
239165
#define INTEL_ATOM_GRACEMONT IFM(6, 0xBE) /* Alderlake N */
240166

241-
#define INTEL_FAM6_ATOM_CRESTMONT_X 0xAF /* Sierra Forest */
242167
#define INTEL_ATOM_CRESTMONT_X IFM(6, 0xAF) /* Sierra Forest */
243-
#define INTEL_FAM6_ATOM_CRESTMONT 0xB6 /* Grand Ridge */
244168
#define INTEL_ATOM_CRESTMONT IFM(6, 0xB6) /* Grand Ridge */
245169

246-
#define INTEL_FAM6_ATOM_DARKMONT_X 0xDD /* Clearwater Forest */
247170
#define INTEL_ATOM_DARKMONT_X IFM(6, 0xDD) /* Clearwater Forest */
248171

249172
/* Xeon Phi */
250173

251-
#define INTEL_FAM6_XEON_PHI_KNL 0x57 /* Knights Landing */
252174
#define INTEL_XEON_PHI_KNL IFM(6, 0x57) /* Knights Landing */
253-
#define INTEL_FAM6_XEON_PHI_KNM 0x85 /* Knights Mill */
254175
#define INTEL_XEON_PHI_KNM IFM(6, 0x85) /* Knights Mill */
255176

256177
/* Family 5 */

arch/x86/kernel/cpu/intel.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,18 @@ static void early_init_intel(struct cpuinfo_x86 *c)
311311
}
312312

313313
/*
314-
* There is a known erratum on Pentium III and Core Solo
315-
* and Core Duo CPUs.
316-
* " Page with PAT set to WC while associated MTRR is UC
317-
* may consolidate to UC "
318-
* Because of this erratum, it is better to stick with
319-
* setting WC in MTRR rather than using PAT on these CPUs.
314+
* PAT is broken on early family 6 CPUs, the last of which
315+
* is "Yonah" where the erratum is named "AN7":
320316
*
321-
* Enable PAT WC only on P4, Core 2 or later CPUs.
317+
* Page with PAT (Page Attribute Table) Set to USWC
318+
* (Uncacheable Speculative Write Combine) While
319+
* Associated MTRR (Memory Type Range Register) Is UC
320+
* (Uncacheable) May Consolidate to UC
321+
*
322+
* Disable PAT and fall back to MTRR on these CPUs.
322323
*/
323-
if (c->x86 == 6 && c->x86_model < 15)
324+
if (c->x86_vfm >= INTEL_PENTIUM_PRO &&
325+
c->x86_vfm <= INTEL_CORE_YONAH)
324326
clear_cpu_cap(c, X86_FEATURE_PAT);
325327

326328
/*

drivers/extcon/extcon-axp288.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct axp288_extcon_info {
108108
};
109109

110110
static const struct x86_cpu_id cherry_trail_cpu_ids[] = {
111-
X86_MATCH_INTEL_FAM6_MODEL(ATOM_AIRMONT, NULL),
111+
X86_MATCH_VFM(INTEL_ATOM_AIRMONT, NULL),
112112
{}
113113
};
114114

0 commit comments

Comments
 (0)