]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/mm/pat: Replace Intel x86_model checks with VFM ones
authorSohil Mehta <sohil.mehta@intel.com>
Wed, 19 Feb 2025 18:41:30 +0000 (18:41 +0000)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Mar 2025 10:19:53 +0000 (11:19 +0100)
Introduce markers and names for some Family 6 and Family 15 models and
replace x86_model checks with VFM ones.

Since the VFM checks are closed ended and only applicable to Intel, get
rid of the explicit Intel vendor check as well.

Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20250219184133.816753-13-sohil.mehta@intel.com
arch/x86/include/asm/intel-family.h
arch/x86/mm/pat/memtype.c

index 51ea36656edd881a6244ebf6be37b7cc06e06fd2..6cd08da64684fe1e2932f075ed2d89317fccde22 100644 (file)
 /* Family 15 - NetBurst */
 #define INTEL_P4_WILLAMETTE            IFM(15, 0x01) /* Also Xeon Foster */
 #define INTEL_P4_PRESCOTT              IFM(15, 0x03)
+#define INTEL_P4_CEDARMILL             IFM(15, 0x06) /* Also Xeon Dempsey */
 
 /* Family 19 */
 #define INTEL_PANTHERCOVE_X            IFM(19, 0x01) /* Diamond Rapids */
index feb8cc6a12bf23a53ad9d248e940218c876745dd..e40861c9cb90ae3b67c0017e5933f50e43ce5f39 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/fs.h>
 #include <linux/rbtree.h>
 
+#include <asm/cpu_device_id.h>
 #include <asm/cacheflush.h>
 #include <asm/cacheinfo.h>
 #include <asm/processor.h>
@@ -290,9 +291,8 @@ void __init pat_bp_init(void)
                return;
        }
 
-       if ((c->x86_vendor == X86_VENDOR_INTEL) &&
-           (((c->x86 == 0x6) && (c->x86_model <= 0xd)) ||
-            ((c->x86 == 0xf) && (c->x86_model <= 0x6)))) {
+       if ((c->x86_vfm >= INTEL_PENTIUM_PRO   && c->x86_vfm <= INTEL_PENTIUM_M_DOTHAN) ||
+           (c->x86_vfm >= INTEL_P4_WILLAMETTE && c->x86_vfm <= INTEL_P4_CEDARMILL)) {
                /*
                 * PAT support with the lower four entries. Intel Pentium 2,
                 * 3, M, and 4 are affected by PAT errata, which makes the