Commit 0bcd13a05308afc6bb95479be9ca876e68f68951

Authored by Bandan Das
Committed by Greg Kroah-Hartman
1 parent 3e038e9d2d

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

... ... @@ -2377,12 +2377,12 @@
2377 2377 nested_vmx_secondary_ctls_low = 0;
2378 2378 nested_vmx_secondary_ctls_high &=
2379 2379 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
2380   - SECONDARY_EXEC_UNRESTRICTED_GUEST |
2381 2380 SECONDARY_EXEC_WBINVD_EXITING;
2382 2381  
2383 2382 if (enable_ept) {
2384 2383 /* nested EPT: emulate EPT also to L1 */
2385   - nested_vmx_secondary_ctls_high |= SECONDARY_EXEC_ENABLE_EPT;
  2384 + nested_vmx_secondary_ctls_high |= SECONDARY_EXEC_ENABLE_EPT |
  2385 + SECONDARY_EXEC_UNRESTRICTED_GUEST;
2386 2386 nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT |
2387 2387 VMX_EPTP_WB_BIT | VMX_EPT_2MB_PAGE_BIT |
2388 2388 VMX_EPT_INVEPT_BIT;