hv:add destroy Secure world API

This patch added API destroy_secure_world, which will do:
-- clear trusty memory space
-- restore memory to SOS ept mapping
It will be called when VM is destroyed, furthermore, ept of
Secure world will be destroyed as well.

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-04-03 09:52:52 +08:00
committed by Jack Ren
parent ace23b5088
commit e5be957945
4 changed files with 31 additions and 0 deletions

View File

@@ -208,6 +208,9 @@ int shutdown_vm(struct vm *vm)
/* cleanup and free vioapic */
vioapic_cleanup(vm->arch_vm.virt_ioapic);
/* Destroy secure world */
if (vm->sworld_control.sworld_enabled)
destroy_secure_world(vm);
/* Free EPT allocated resources assigned to VM */
destroy_ept(vm);