diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2019-03-07 15:43:02 -0800 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-08-13 12:38:57 +0100 |
commit | 25f144c9799d974445d683ccd9569e45417ea643 (patch) | |
tree | 55fe46835016248b677de7a2a57ab8563c68968f /arch/x86/include | |
parent | 0824675ce7b01210b2e35b6f10b690c3f6ca0d93 (diff) |
KVM: x86: Emulate MSR_IA32_ARCH_CAPABILITIES on AMD hosts
commit 0cf9135b773bf32fba9dd8e6699c1b331ee4b749 upstream.
The CPUID flag ARCH_CAPABILITIES is unconditioinally exposed to host
userspace for all x86 hosts, i.e. KVM advertises ARCH_CAPABILITIES
regardless of hardware support under the pretense that KVM fully
emulates MSR_IA32_ARCH_CAPABILITIES. Unfortunately, only VMX hosts
handle accesses to MSR_IA32_ARCH_CAPABILITIES (despite KVM_GET_MSRS
also reporting MSR_IA32_ARCH_CAPABILITIES for all hosts).
Move the MSR_IA32_ARCH_CAPABILITIES handling to common x86 code so
that it's emulated on AMD hosts.
Fixes: 1eaafe91a0df4 ("kvm: x86: IA32_ARCH_CAPABILITIES is always supported")
Reported-by: Xiaoyao Li <xiaoyao.li@linux.intel.com>
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[bwh: Backported to 3.16:
- Keep using guest_cpuid_has_arch_capabilities() to check the CPUID
- Keep using rdmsrl() to get the initial value of IA32_ARCH_CAPABILITIES
- Adjust filenames, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index e9eae4fbdde2..de6c067a2cb4 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -363,6 +363,7 @@ struct kvm_vcpu_arch { int mp_state; u64 ia32_misc_enable_msr; bool tpr_access_reporting; + u64 arch_capabilities; /* * Paging state of the vcpu |