]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Advertise CPUID.(EAX=7,ECX=2):EDX[5:0] to userspace
authorJim Mattson <jmattson@google.com>
Tue, 24 Oct 2023 00:16:35 +0000 (17:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:15 +0000 (15:28 +0200)
commit688313fb139e3373dca7ce0cd1857f21e66ac4d0
treea9f558e3acb00869ed92bd39c7d0678d25839ca0
parent5c7587f69194bc9fc714953ab4c7203e6e68885b
KVM: x86: Advertise CPUID.(EAX=7,ECX=2):EDX[5:0] to userspace

commit eefe5e6682099445f77f2d97d4c525f9ac9d9b07 upstream.

The low five bits {INTEL_PSFD, IPRED_CTRL, RRSBA_CTRL, DDPD_U, BHI_CTRL}
advertise the availability of specific bits in IA32_SPEC_CTRL. Since KVM
dynamically determines the legal IA32_SPEC_CTRL bits for the underlying
hardware, the hard work has already been done. Just let userspace know
that a guest can use these IA32_SPEC_CTRL bits.

The sixth bit (MCDT_NO) states that the processor does not exhibit MXCSR
Configuration Dependent Timing (MCDT) behavior. This is an inherent
property of the physical processor that is inherited by the virtual
CPU. Pass that information on to userspace.

Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Chao Gao <chao.gao@intel.com>
Link: https://lore.kernel.org/r/20231024001636.890236-1-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/cpuid.c
arch/x86/kvm/reverse_cpuid.h