linux/arch/x86/kvm/vmx
Vitaly Kuznetsov 31de3d2500 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>
2020-02-05 15:55:06 +01:00
..
capabilities.h kvm/svm: PKU not currently supported 2020-01-27 19:59:35 +01:00
evmcs.c x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs() 2020-02-05 15:55:06 +01:00
evmcs.h x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs() 2020-02-05 15:55:06 +01:00
nested.c KVM: nVMX: Remove stale comment from nested_vmx_load_cr3() 2020-02-05 15:31:25 +01:00
nested.h Merge branch 'kvm-tsx-ctrl' into HEAD 2019-11-21 12:03:40 +01:00
ops.h KVM: VMX: Add error handling to VMREAD helper 2019-09-25 15:30:09 +02:00
pmu_intel.c KVM: x86: Protect pmu_intel.c from Spectre-v1/L1TF attacks 2020-01-27 19:59:44 +01:00
vmcs12.c
vmcs12.h KVM/arm updates for 5.3 2019-07-11 15:14:16 +02:00
vmcs_shadow_fields.h KVM: Fix some out-dated function names in comment 2020-01-21 13:57:27 +01:00
vmcs.h KVM: VMX: Leave preemption timer running when it's disabled 2019-06-18 17:10:46 +02:00
vmenter.S x86/asm: Change all ENTRY+ENDPROC to SYM_FUNC_* 2019-10-18 11:58:33 +02:00
vmx.c x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs() 2020-02-05 15:55:06 +01:00
vmx.h x86/msr-index: Clean up bit defines for IA32_FEATURE_CONTROL MSR 2020-01-13 17:23:08 +01:00