mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-07 20:00:13 +00:00
hv:Replace dynamic memory allocation for vmcs region
Replace vmcs pointer with static memory for vmcs region inside structure vcpu_arch. Tracked-On: #861 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -224,13 +224,6 @@ int create_vcpu(uint16_t pcpu_id, struct vm *vm, struct vcpu **rtn_vcpu_handle)
|
||||
|
||||
vcpu->arch_vcpu.vpid = allocate_vpid();
|
||||
|
||||
/* Allocate VMCS region for this VCPU */
|
||||
vcpu->arch_vcpu.vmcs = alloc_page();
|
||||
ASSERT(vcpu->arch_vcpu.vmcs != NULL, "");
|
||||
|
||||
/* Memset VMCS region for this VCPU */
|
||||
(void)memset(vcpu->arch_vcpu.vmcs, 0U, CPU_PAGE_SIZE);
|
||||
|
||||
/* Initialize exception field in VCPU context */
|
||||
vcpu->arch_vcpu.exception_info.exception = VECTOR_INVALID;
|
||||
|
||||
@@ -384,7 +377,6 @@ void destroy_vcpu(struct vcpu *vcpu)
|
||||
atomic_dec16(&vcpu->vm->hw.created_vcpus);
|
||||
|
||||
vlapic_free(vcpu);
|
||||
free(vcpu->arch_vcpu.vmcs);
|
||||
per_cpu(ever_run_vcpu, vcpu->pcpu_id) = NULL;
|
||||
free_pcpu(vcpu->pcpu_id);
|
||||
free(vcpu);
|
||||
|
Reference in New Issue
Block a user