Commit b48f65688dc020cc1a7eb3718be910a3e5681685

Authored by Bandan Das
Committed by Greg Kroah-Hartman
1 parent dbb49267de

KVM: nVMX: Disable unrestricted mode if ept=0

commit 78051e3b7e35722ad3f31dd611f1b34770bddab8 upstream.

If L0 has disabled EPT, don't advertise unrestricted
mode at all since it depends on EPT to run real mode code.

Fixes: 92fbc7b195b824e201d9f06f2b93105f72384d65
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -2320,12 +2320,12 @@
2320 2320 nested_vmx_secondary_ctls_low = 0;
2321 2321 nested_vmx_secondary_ctls_high &=
2322 2322 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
2323   - SECONDARY_EXEC_UNRESTRICTED_GUEST |
2324 2323 SECONDARY_EXEC_WBINVD_EXITING;
2325 2324  
2326 2325 if (enable_ept) {
2327 2326 /* nested EPT: emulate EPT also to L1 */
2328   - nested_vmx_secondary_ctls_high |= SECONDARY_EXEC_ENABLE_EPT;
  2327 + nested_vmx_secondary_ctls_high |= SECONDARY_EXEC_ENABLE_EPT |
  2328 + SECONDARY_EXEC_UNRESTRICTED_GUEST;
2329 2329 nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT |
2330 2330 VMX_EPTP_WB_BIT | VMX_EPT_2MB_PAGE_BIT |
2331 2331 VMX_EPT_INVEPT_BIT;