]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: x86: Advertise AVX512 Bit Matrix Multiply (BMM) to userspace
authorNikunj A Dadhania <nikunj@amd.com>
Tue, 10 Feb 2026 05:35:11 +0000 (05:35 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 12 Mar 2026 17:56:36 +0000 (10:56 -0700)
Advertise AVX512 Bit Matrix Multiply (BMM) and Bit Reversal instructions to
userspace via CPUID leaf 0x80000021_EAX[23]. This feature enables bit
matrix multiply operations and bit reversal.  Like most AVX instructions,
there are no intercept controls for individual instructions, and no extra
work is needed in KVM to enable correct execution of the instructions in
the guest.

The instructions and CPUID feature are first described in:

  AMD64 Bit Matrix Multiply and Bit Reversal Instructions
  Publication #69192 Revision: 1.00
  Issue Date: January 2026

While at it, reorder PREFETCHI in KVM's initialization sequence to match
the CPUID bit position order for better organization.

Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Link: https://patch.msgid.link/20260210053511.1612505-1-nikunj@amd.com
[sean: massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/cpufeatures.h
arch/x86/kvm/cpuid.c

index dbe104df339b8c4d567949f5463e77e147b8d0d4..de7bd88e539db36cb051c919d8d6d4da4289732d 100644 (file)
 #define X86_FEATURE_GP_ON_USER_CPUID   (20*32+17) /* User CPUID faulting */
 
 #define X86_FEATURE_PREFETCHI          (20*32+20) /* Prefetch Data/Instruction to Cache Level */
+#define X86_FEATURE_AVX512_BMM         (20*32+23) /* AVX512 Bit Matrix Multiply instructions */
 #define X86_FEATURE_ERAPS              (20*32+24) /* Enhanced Return Address Predictor Security */
 #define X86_FEATURE_SBPB               (20*32+27) /* Selective Branch Prediction Barrier */
 #define X86_FEATURE_IBPB_BRTYPE                (20*32+28) /* MSR_PRED_CMD[IBPB] flushes all branch type predictions */
index baf9a2860d985ee24c4eae9a73431b8878190712..d740c45039c9c4896889c1d76b6f6a13fbae71d1 100644 (file)
@@ -1243,11 +1243,12 @@ void kvm_initialize_cpu_caps(void)
                F(NULL_SEL_CLR_BASE),
                /* UpperAddressIgnore */
                F(AUTOIBRS),
-               F(PREFETCHI),
                EMULATED_F(NO_SMM_CTL_MSR),
                /* PrefetchCtlMsr */
                /* GpOnUserCpuid */
                /* EPSF */
+               F(PREFETCHI),
+               F(AVX512_BMM),
                F(ERAPS),
                SYNTHESIZED_F(SBPB),
                SYNTHESIZED_F(IBPB_BRTYPE),