summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-07-02 14:45:24 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-07-02 17:36:18 +0200
commit95c5c7c77c06c7037385b3d8d4d7592ab032c3cb (patch)
treec0a27ebf5a3881d64a3dc8a5a6dcf3ac4bfe495f /arch/x86/kvm/vmx
parente8a70bd4e92525de459acfa5668c8e1f24664331 (diff)
downloadlinux-stable-95c5c7c77c06c7037385b3d8d4d7592ab032c3cb.tar.gz
linux-stable-95c5c7c77c06c7037385b3d8d4d7592ab032c3cb.tar.bz2
linux-stable-95c5c7c77c06c7037385b3d8d4d7592ab032c3cb.zip
KVM: nVMX: list VMX MSRs in KVM_GET_MSR_INDEX_LIST
This allows userspace to know which MSRs are supported by the hypervisor. Unfortunately userspace must resort to tricks for everything except MSR_IA32_VMX_VMFUNC (which was just added in the previous patch). One possibility is to use the feature control MSR, which is tied to nested VMX as well and is present on all KVM versions that support feature MSRs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx')
-rw-r--r--arch/x86/kvm/vmx/vmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index a35459ce7e29..c43635942693 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -6223,6 +6223,8 @@ static bool vmx_has_emulated_msr(int index)
* real mode.
*/
return enable_unrestricted_guest || emulate_invalid_guest_state;
+ case MSR_IA32_VMX_BASIC ... MSR_IA32_VMX_VMFUNC:
+ return nested;
case MSR_AMD64_VIRT_SPEC_CTRL:
/* This is AMD only. */
return false;