]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/mtrr: Modify a x86_model check to an Intel VFM check
authorSohil Mehta <sohil.mehta@intel.com>
Wed, 19 Feb 2025 18:41:22 +0000 (18:41 +0000)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Mar 2025 10:19:40 +0000 (11:19 +0100)
Simplify one of the last few Intel x86_model checks in arch/x86 by
substituting it with a VFM one.

Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/r/20250219184133.816753-5-sohil.mehta@intel.com
arch/x86/kernel/cpu/mtrr/generic.c

index 6be3cade4134cc58ddaaee5ee9f3b5b35a6726c3..e2c6b471d2302a9c694f1e83a4ecd24b518b7a43 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/processor-flags.h>
 #include <asm/cacheinfo.h>
 #include <asm/cpufeature.h>
+#include <asm/cpu_device_id.h>
 #include <asm/hypervisor.h>
 #include <asm/mshyperv.h>
 #include <asm/tlbflush.h>
@@ -1026,8 +1027,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size,
         * For Intel PPro stepping <= 7
         * must be 4 MiB aligned and not touch 0x70000000 -> 0x7003FFFF
         */
-       if (mtrr_if == &generic_mtrr_ops && boot_cpu_data.x86 == 6 &&
-           boot_cpu_data.x86_model == 1 &&
+       if (mtrr_if == &generic_mtrr_ops && boot_cpu_data.x86_vfm == INTEL_PENTIUM_PRO &&
            boot_cpu_data.x86_stepping <= 7) {
                if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
                        pr_warn("mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);