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)
committerSean Christopherson <seanjc@google.com>
Thu, 30 Nov 2023 19:50:16 +0000 (11:50 -0800)
commiteefe5e6682099445f77f2d97d4c525f9ac9d9b07
treea5491fd357da20f513e3bb4701ab442fdf987e47
parent75bedc1ee90bd54ae8c5ab8be72506f8c5959584
KVM: x86: Advertise CPUID.(EAX=7,ECX=2):EDX[5:0] to userspace

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>
arch/x86/kvm/cpuid.c
arch/x86/kvm/reverse_cpuid.h