summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx/evmcs.h
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2020-02-05 13:30:33 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-02-05 15:55:06 +0100
commit31de3d2500e49e9f44fdda1830a37f4d9735bcdd (patch)
tree0f1d1ebeab2e9cfd7a2e63abc7547446345c25da /arch/x86/kvm/vmx/evmcs.h
parentkvm: mmu: Separate generating and setting mmio ptes (diff)
downloadlinux-31de3d2500e49e9f44fdda1830a37f4d9735bcdd.tar.xz
linux-31de3d2500e49e9f44fdda1830a37f4d9735bcdd.zip
x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs()
With fine grained VMX feature enablement QEMU>=4.2 tries to do KVM_SET_MSRS with default (matching CPU model) values and in case eVMCS is also enabled, fails. It would be possible to drop VMX feature filtering completely and make this a guest's responsibility: if it decides to use eVMCS it should know which fields are available and which are not. Hyper-V mostly complies to this, however, there are some problematic controls: SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES VM_{ENTRY,EXIT}_LOAD_IA32_PERF_GLOBAL_CTRL which Hyper-V enables. As there are no corresponding fields in eVMCS, we can't handle this properly in KVM. This is a Hyper-V issue. Move VMX controls sanitization from nested_enable_evmcs() to vmx_get_msr(), and do the bare minimum (only clear controls which are known to cause issues). This allows userspace to keep setting controls it wants and at the same time hides them from the guest. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/evmcs.h')
-rw-r--r--arch/x86/kvm/vmx/evmcs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/evmcs.h b/arch/x86/kvm/vmx/evmcs.h
index 07ebf6882a45..b88d9807a796 100644
--- a/arch/x86/kvm/vmx/evmcs.h
+++ b/arch/x86/kvm/vmx/evmcs.h
@@ -201,5 +201,6 @@ bool nested_enlightened_vmentry(struct kvm_vcpu *vcpu, u64 *evmcs_gpa);
uint16_t nested_get_evmcs_version(struct kvm_vcpu *vcpu);
int nested_enable_evmcs(struct kvm_vcpu *vcpu,
uint16_t *vmcs_version);
+void nested_evmcs_filter_control_msr(u32 msr_index, u64 *pdata);
#endif /* __KVM_X86_VMX_EVMCS_H */