KVM: nVMX: list VMX MSRs in KVM_GET_MSR_INDEX_LIST
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 2 Jul 2019 12:45:24 +0000 (14:45 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 2 Jul 2019 15:36:18 +0000 (17:36 +0200)
commit95c5c7c77c06c7037385b3d8d4d7592ab032c3cb
treec0a27ebf5a3881d64a3dc8a5a6dcf3ac4bfe495f
parente8a70bd4e92525de459acfa5668c8e1f24664331
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>
arch/x86/kvm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c