Skip to content

Commit 0bcd13a

Browse files
Bandan Dasgregkh
authored andcommitted
KVM: nVMX: Disable unrestricted mode if ept=0
commit 78051e3 upstream. If L0 has disabled EPT, don't advertise unrestricted mode at all since it depends on EPT to run real mode code. Fixes: 92fbc7b 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>
1 parent 3e038e9 commit 0bcd13a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/x86/kvm/vmx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,12 +2377,12 @@ static __init void nested_vmx_setup_ctls_msrs(void)
23772377
nested_vmx_secondary_ctls_low = 0;
23782378
nested_vmx_secondary_ctls_high &=
23792379
SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
2380-
SECONDARY_EXEC_UNRESTRICTED_GUEST |
23812380
SECONDARY_EXEC_WBINVD_EXITING;
23822381

23832382
if (enable_ept) {
23842383
/* 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;
23862386
nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT |
23872387
VMX_EPTP_WB_BIT | VMX_EPT_2MB_PAGE_BIT |
23882388
VMX_EPT_INVEPT_BIT;

0 commit comments

Comments
 (0)