linux/arch/x86/kvm/vmx
Vitaly Kuznetsov 8d68bad6d8 KVM: nVMX: Filter out all unsupported controls when eVMCS was activated
Windows Server 2022 with Hyper-V role enabled failed to boot on KVM when
enlightened VMCS is advertised. Debugging revealed there are two exposed
secondary controls it is not happy with: SECONDARY_EXEC_ENABLE_VMFUNC and
SECONDARY_EXEC_SHADOW_VMCS. These controls are known to be unsupported,
as there are no corresponding fields in eVMCSv1 (see the comment above
EVMCS1_UNSUPPORTED_2NDEXEC definition).

Previously, commit 31de3d2500 ("x86/kvm/hyper-v: move VMX controls
sanitization out of nested_enable_evmcs()") introduced the required
filtering mechanism for VMX MSRs but for some reason put only known
to be problematic (and not full EVMCS1_UNSUPPORTED_* lists) controls
there.

Note, Windows Server 2022 seems to have gained some sanity check for VMX
MSRs: it doesn't even try to launch a guest when there's something it
doesn't like, nested_evmcs_check_controls() mechanism can't catch the
problem.

Let's be bold this time and instead of playing whack-a-mole just filter out
all unsupported controls from VMX MSRs.

Fixes: 31de3d2500 ("x86/kvm/hyper-v: move VMX controls sanitization out of nested_enable_evmcs()")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210907163530.110066-1-vkuznets@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-22 10:33:15 -04:00
..
capabilities.h KVM: x86: Use common 'enable_apicv' variable for both APICv and AVIC 2021-06-17 13:09:33 -04:00
evmcs.c KVM: nVMX: Filter out all unsupported controls when eVMCS was activated 2021-09-22 10:33:15 -04:00
evmcs.h KVM: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04:00
nested.c KVM: nVMX: Fix nested bus lock VM exit 2021-09-22 10:33:12 -04:00
nested.h KVM: nVMX: Introduce 'EVMPTR_MAP_PENDING' post-migration state 2021-06-17 13:09:49 -04:00
pmu_intel.c KVM: x86/pmu: Introduce pmc->is_paused to reduce the call time of perf interfaces 2021-08-04 05:55:56 -04:00
posted_intr.c KVM: VMX: update vcpu posted-interrupt descriptor when assigning device 2021-05-27 07:58:23 -04:00
posted_intr.h KVM: VMX: update vcpu posted-interrupt descriptor when assigning device 2021-05-27 07:58:23 -04:00
sgx.c KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
sgx.h KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
vmcs12.c KVM: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04:00
vmcs12.h KVM: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04: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: x86: Clean up redundant ROL16(val, n) macro definition 2021-08-13 03:35:16 -04:00
vmenter.S KVM/nVMX: Use __vmx_vcpu_run in nested_vmx_check_vmentry_hw 2021-02-04 05:27:32 -05:00
vmx_ops.h KVM: x86: Move declaration of kvm_spurious_fault() to x86.h 2021-08-13 03:35:16 -04:00
vmx.c KVM: nVMX: Filter out all unsupported controls when eVMCS was activated 2021-09-22 10:33:15 -04:00
vmx.h KVM: VMX: Remove defunct "nr_active_uret_msrs" field 2021-09-22 10:33:09 -04:00