Skip to content

Commit eaa472f

Browse files
sohilmehIngo Molnar
authored andcommitted
x86/cpu/intel: Replace early Family 6 checks with VFM ones
Introduce names for some old pentium models and replace the x86_model checks with VFM ones. Signed-off-by: Sohil Mehta <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a8cb451 commit eaa472f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@
4545
/* Wildcard match so X86_MATCH_VFM(ANY) works */
4646
#define INTEL_ANY IFM(X86_FAMILY_ANY, X86_MODEL_ANY)
4747

48+
/* Family 6 */
4849
#define INTEL_PENTIUM_PRO IFM(6, 0x01)
50+
#define INTEL_PENTIUM_II_KLAMATH IFM(6, 0x03)
4951
#define INTEL_PENTIUM_III_DESCHUTES IFM(6, 0x05)
52+
#define INTEL_PENTIUM_III_TUALATIN IFM(6, 0x0B)
53+
#define INTEL_PENTIUM_M_DOTHAN IFM(6, 0x0D)
5054

5155
#define INTEL_CORE_YONAH IFM(6, 0x0E)
5256

arch/x86/kernel/cpu/intel.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void intel_unlock_cpuid_leafs(struct cpuinfo_x86 *c)
186186
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
187187
return;
188188

189-
if (c->x86 < 6 || (c->x86 == 6 && c->x86_model < 0xd))
189+
if (c->x86_vfm < INTEL_PENTIUM_M_DOTHAN)
190190
return;
191191

192192
/*
@@ -341,9 +341,7 @@ static void bsp_init_intel(struct cpuinfo_x86 *c)
341341
int ppro_with_ram_bug(void)
342342
{
343343
/* Uses data from early_cpu_detect now */
344-
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
345-
boot_cpu_data.x86 == 6 &&
346-
boot_cpu_data.x86_model == 1 &&
344+
if (boot_cpu_data.x86_vfm == INTEL_PENTIUM_PRO &&
347345
boot_cpu_data.x86_stepping < 8) {
348346
pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n");
349347
return 1;
@@ -404,7 +402,8 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
404402
* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until
405403
* model 3 mask 3
406404
*/
407-
if ((c->x86<<8 | c->x86_model<<4 | c->x86_stepping) < 0x633)
405+
if ((c->x86_vfm == INTEL_PENTIUM_II_KLAMATH && c->x86_stepping < 3) ||
406+
c->x86_vfm < INTEL_PENTIUM_II_KLAMATH)
408407
clear_cpu_cap(c, X86_FEATURE_SEP);
409408

410409
/*
@@ -606,7 +605,7 @@ static unsigned int intel_size_cache(struct cpuinfo_x86 *c, unsigned int size)
606605
* to determine which, so we use a boottime override
607606
* for the 512kb model, and assume 256 otherwise.
608607
*/
609-
if ((c->x86 == 6) && (c->x86_model == 11) && (size == 0))
608+
if (c->x86_vfm == INTEL_PENTIUM_III_TUALATIN && size == 0)
610609
size = 256;
611610

612611
/*

0 commit comments

Comments
 (0)