hv: nested: merge gpa_field_dirty and control_field_dirty flag

In run time, it's rare for L1 to write to the intercepted non host-state
VMCS fields, and using multiple dirty flags is not necessary.

This patch uses one single dirty flag to manage all non host-state VMCS
fields.  This helps to simplify current code and in the future we may
not need to declare new dirty flags when we intercept more VMCS fields.

Tracked-On: #5923
Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Zide Chen
2021-08-27 17:02:48 -07:00
committed by wenlingz
parent 6376d5a0d3
commit 1ab65825ba
2 changed files with 21 additions and 61 deletions

View File

@@ -339,8 +339,7 @@ struct acrn_nested {
bool vmxon; /* To indicate if vCPU entered VMX operation */
bool in_l2_guest; /* To indicate if vCPU is currently in Guest mode (from L1's perspective) */
bool host_state_dirty; /* To indicate need to merge VMCS12 host-state fields to VMCS01 */
bool gpa_field_dirty;
bool control_field_dirty; /* for VM-execution, VM-exit, VM-entry control fields */
bool control_fields_dirty; /* For all other non-host-state fields that need to be merged */
} __aligned(PAGE_SIZE);
void init_nested_vmx(__unused struct acrn_vm *vm);