mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-05 02:11:23 +00:00
HV: handle trusty on vm reset
- clear run context when reset vcpu; - destroy trusty without erase trusty memory when reset vm; changelog: v1 -> v2: fix misra violation on calling memset(); Signed-off-by: Sun Victor <victor.sun@intel.com> Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
c55b696a92
commit
76e43ac7ce
@ -396,6 +396,7 @@ void destroy_vcpu(struct vcpu *vcpu)
|
|||||||
*/
|
*/
|
||||||
void reset_vcpu(struct vcpu *vcpu)
|
void reset_vcpu(struct vcpu *vcpu)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
struct acrn_vlapic *vlapic;
|
struct acrn_vlapic *vlapic;
|
||||||
|
|
||||||
pr_dbg("vcpu%hu reset", vcpu->vcpu_id);
|
pr_dbg("vcpu%hu reset", vcpu->vcpu_id);
|
||||||
@ -419,6 +420,12 @@ void reset_vcpu(struct vcpu *vcpu)
|
|||||||
vcpu->arch_vcpu.inject_event_pending = false;
|
vcpu->arch_vcpu.inject_event_pending = false;
|
||||||
(void)memset(vcpu->arch_vcpu.vmcs, 0U, CPU_PAGE_SIZE);
|
(void)memset(vcpu->arch_vcpu.vmcs, 0U, CPU_PAGE_SIZE);
|
||||||
|
|
||||||
|
for (i = 0; i < NR_WORLD; i++) {
|
||||||
|
(void)memset(&vcpu->arch_vcpu.contexts[i], 0U,
|
||||||
|
sizeof(struct run_context));
|
||||||
|
}
|
||||||
|
vcpu->arch_vcpu.cur_context = NORMAL_WORLD;
|
||||||
|
|
||||||
vlapic = vcpu->arch_vcpu.vlapic;
|
vlapic = vcpu->arch_vcpu.vlapic;
|
||||||
vlapic_reset(vlapic);
|
vlapic_reset(vlapic);
|
||||||
}
|
}
|
||||||
|
@ -366,6 +366,8 @@ int reset_vm(struct vm *vm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
vioapic_reset(vm->arch_vm.virt_ioapic);
|
vioapic_reset(vm->arch_vm.virt_ioapic);
|
||||||
|
destroy_secure_world(vm, false);
|
||||||
|
vm->sworld_control.flag.active = 0UL;
|
||||||
|
|
||||||
start_vm(vm);
|
start_vm(vm);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user