mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
hv: nested: initial implementation of struct acrn_vvmcs
Add an array of struct acrn_vvmcs to struct acrn_nested, so it is possible to cache multiple active VMCS12s. This patch declares the size of this array to 1, meaning that there is only one active VMCS12. This is to minimize the logical code changes. Add pointer current_vvmcs to struct acrn_nested, which refers to the current vvmcs[] entry. In this patch, if any VMCS12 is active, it always points to vvmcs[0]. Tracked-On: #6289 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -329,11 +329,14 @@ int32_t vmlaunch_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int32_t invvpid_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
|
||||
#ifdef CONFIG_NVMX_ENABLED
|
||||
struct acrn_nested {
|
||||
struct acrn_vvmcs {
|
||||
uint8_t vmcs02[PAGE_SIZE]; /* VMCS to run L2 and as Link Pointer in VMCS01 */
|
||||
|
||||
/* TODO: change this to uint8_t vmcs12[PAGE_SIZE] */
|
||||
struct acrn_vmcs12 vmcs12; /* To cache L1's VMCS12*/
|
||||
} __aligned(PAGE_SIZE);
|
||||
|
||||
struct acrn_nested {
|
||||
struct acrn_vvmcs vvmcs[1];
|
||||
struct acrn_vvmcs *current_vvmcs; /* Refer to the current loaded VMCS12 */
|
||||
uint64_t current_vmcs12_ptr; /* GPA */
|
||||
uint64_t vmxon_ptr; /* GPA */
|
||||
bool vmxon; /* To indicate if vCPU entered VMX operation */
|
||||
|
Reference in New Issue
Block a user