mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 04:33:55 +00:00
hv:remove need_cleanup flag in create_vm
remove this redundancy flag. Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
67ec1b7708
commit
7f96465407
@ -460,7 +460,6 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
|
|||||||
{
|
{
|
||||||
struct acrn_vm *vm = NULL;
|
struct acrn_vm *vm = NULL;
|
||||||
int32_t status = 0;
|
int32_t status = 0;
|
||||||
bool need_cleanup = false;
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
uint16_t pcpu_id;
|
uint16_t pcpu_id;
|
||||||
|
|
||||||
@ -483,9 +482,6 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
|
|||||||
prepare_sos_vm_memmap(vm);
|
prepare_sos_vm_memmap(vm);
|
||||||
|
|
||||||
status = init_vm_boot_info(vm);
|
status = init_vm_boot_info(vm);
|
||||||
if (status != 0) {
|
|
||||||
need_cleanup = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* For PRE_LAUNCHED_VM and POST_LAUNCHED_VM */
|
/* For PRE_LAUNCHED_VM and POST_LAUNCHED_VM */
|
||||||
if ((vm_config->guest_flags & GUEST_FLAG_SECURE_WORLD_ENABLED) != 0U) {
|
if ((vm_config->guest_flags & GUEST_FLAG_SECURE_WORLD_ENABLED) != 0U) {
|
||||||
@ -560,14 +556,6 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
|
|||||||
status = set_vcpuid_entries(vm);
|
status = set_vcpuid_entries(vm);
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
vm->state = VM_CREATED;
|
vm->state = VM_CREATED;
|
||||||
} else {
|
|
||||||
need_cleanup = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_cleanup) {
|
|
||||||
if (vm->arch_vm.nworld_eptp != NULL) {
|
|
||||||
(void)memset(vm->arch_vm.nworld_eptp, 0U, PAGE_SIZE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,6 +573,10 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((status != 0) && (vm->arch_vm.nworld_eptp != NULL)) {
|
||||||
|
(void)memset(vm->arch_vm.nworld_eptp, 0U, PAGE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user