]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: VMX: Switch to new Intel CPU model infrastructure
authorTony Luck <tony.luck@intel.com>
Mon, 20 May 2024 22:45:40 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 3 Jun 2024 16:10:43 +0000 (09:10 -0700)
Use x86_vfm (vendor, family, module) to detect CPUs that are affected by
PERF_GLOBAL_CTRL bugs instead of manually checking the family and model.
The new VFM infrastructure encodes all information in one handy location.

No functional change intended.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20240520224620.9480-10-tony.luck@intel.com
[sean: massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c

index 6051fad5945fa08f9a348fc380799ead2d415991..ceb0c1e6275a13b2841fa591b789f6e95f9dba62 100644 (file)
@@ -2525,17 +2525,15 @@ static bool cpu_has_sgx(void)
  */
 static bool cpu_has_perf_global_ctrl_bug(void)
 {
-       if (boot_cpu_data.x86 == 0x6) {
-               switch (boot_cpu_data.x86_model) {
-               case INTEL_FAM6_NEHALEM_EP:     /* AAK155 */
-               case INTEL_FAM6_NEHALEM:        /* AAP115 */
-               case INTEL_FAM6_WESTMERE:       /* AAT100 */
-               case INTEL_FAM6_WESTMERE_EP:    /* BC86,AAY89,BD102 */
-               case INTEL_FAM6_NEHALEM_EX:     /* BA97 */
-                       return true;
-               default:
-                       break;
-               }
+       switch (boot_cpu_data.x86_vfm) {
+       case INTEL_NEHALEM_EP:  /* AAK155 */
+       case INTEL_NEHALEM:     /* AAP115 */
+       case INTEL_WESTMERE:    /* AAT100 */
+       case INTEL_WESTMERE_EP: /* BC86,AAY89,BD102 */
+       case INTEL_NEHALEM_EX:  /* BA97 */
+               return true;
+       default:
+               break;
        }
 
        return false;