hv: nested: fixed vmxoff_vmexit_handler() issue

In VMXOFF vmexit handler, it's supposed to remove VMCS shadowing.

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Zide Chen 2021-09-20 13:15:15 -07:00 committed by wenlingz
parent 45b036e028
commit a62dd6ad8a

View File

@ -18,6 +18,7 @@
/* Cache the content of MSR_IA32_VMX_BASIC */
static uint32_t vmx_basic;
static void disable_vmcs_shadowing(void);
static void clear_vvmcs(struct acrn_vcpu *vcpu, struct acrn_vvmcs *vvmcs);
/* The only purpose of this array is to serve the is_vmx_msr() function */
@ -801,6 +802,8 @@ bool check_vmx_permission(struct acrn_vcpu *vcpu)
int32_t vmxoff_vmexit_handler(struct acrn_vcpu *vcpu)
{
if (check_vmx_permission(vcpu)) {
disable_vmcs_shadowing();
vcpu->arch.nested.vmxon = false;
vcpu->arch.nested.in_l2_guest = false;