• Wanpeng Li's avatar
    KVM: VMX: Don't expose unrestricted_guest is enabled if ept is disabled · 8ad8182e
    Wanpeng Li authored
    SDM mentioned:
    
     "If either the “unrestricted guest†VM-execution control or the “mode-based
      execute control for EPT†VM- execution control is 1, the “enable EPTâ€
      VM-execution control must also be 1."
    
    However, we can still observe unrestricted_guest is Y after inserting the kvm-intel.ko
    w/ ept=N. It depends on later starts a guest in order that the function
    vmx_compute_secondary_exec_control() can be executed, then both the module parameter
    and exec control fields will be amended.
    
    This patch fixes it by amending module parameter immediately during vmcs data setup.
    Reviewed-by: default avatarJim Mattson <jmattson@google.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Jim Mattson <jmattson@google.com>
    Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    8ad8182e
vmx.c 343 KB