hv:Replace dynamic memory with static for vm

-- Replace dynamic memory allocation with static memory
-- Remove the parameter check if the vm is NULL

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-09-26 11:24:38 +08:00
committed by wenlingz
parent ff3f9bd1e6
commit b8e59e1638
7 changed files with 40 additions and 60 deletions

View File

@@ -19,7 +19,6 @@ static void fire_vhm_interrupt(void)
struct vcpu *vcpu;
vm0 = get_vm_from_vmid(0U);
ASSERT(vm0 != NULL, "VM Pointer is NULL");
vcpu = vcpu_from_vid(vm0, 0U);
ASSERT(vcpu != NULL, "vcpu_from_vid failed");

View File

@@ -115,6 +115,9 @@ int load_guest(struct vm *vm, struct vcpu *vcpu)
return ret;
}
/*
* @pre vm != NULL
*/
int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
{
int32_t ret = 0;
@@ -125,8 +128,6 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
struct sw_linux *sw_linux = &(vm->sw.linux_info);
struct sw_kernel_info *sw_kernel = &(vm->sw.kernel_info);
ASSERT(vm != NULL, "Incorrect argument");
pr_dbg("Loading guest to run-time location");
/* ACRN in partiton mode boots all VMs without devicemodel */