]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Advertise AMX CPUIDs in subleaf 0x1E.0x1 to userspace
authorZhao Liu <zhao1.liu@intel.com>
Thu, 20 Nov 2025 05:07:18 +0000 (13:07 +0800)
committerSean Christopherson <seanjc@google.com>
Fri, 23 Jan 2026 17:59:57 +0000 (09:59 -0800)
commit58cbaf64e6530fa37752ff1362129842ac94fee0
treec3ca0d88a95d9c9b26831f15d2e524dcc1270d84
parentf24ef0093dd8cf60ed7f93a82fb16335fdcbc310
KVM: x86: Advertise AMX CPUIDs in subleaf 0x1E.0x1 to userspace

Define and advertise AMX CPUIDs (0x1E.0x1) to userspace when the leaf is
supported by the host.

Intel Diamond Rapids adds new AMX instructions to support new formats
and memory operations [*], and introduces the CPUID subleaf 0x1E.0x1
to centralize the discrete AMX feature bits within EAX.

Since these AMX features have no actual kernel usages, define them as
KVM-only features in reverse_cpuid.h.

In addition to the new features, CPUID 0x1E.0x1.EAX[bits 0-3] are
aliaseed positions of existing AMX feature bits distributed across the
0x7 leaves. To avoid duplicate feature names, name these aliases with an
*_ALIAS suffix, and define them in reverse_cpuid.h as KVM-only features
as well.

Advertise new CPUID subleaf 0x1E.0x1 with its AMX CPUID feature bits to
userspace for guest use. It's safe since no additional enabling work
is needed in the host kernel.

[*]: Intel Architecture Instruction Set Extensions and Future Features
     (rev.059).

Tested-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://patch.msgid.link/20251120050720.931449-3-zhao1.liu@intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/reverse_cpuid.h