mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
hv:Refine destroy_secure_world API
-- add clear trusty memory flag In some cases such as UOS power off or UOS full reset, need to clear trusty memory,no need to clear memory such as UOS S3 or UOS system reset,then add a flag to distinguish it when destroy secure world. -- Restore trusty memory to guest normal world. -- Moved free trusty EPT inside destroy_secure_world In some cases such as UOS S3 or UOS system reset, only need to free trusty EPT, this patch move free trusty EPT inside destroy_secure_world. Because PD/PT are shared in both secure world's EPT and normal world's EPT,before freeing trusty EPT, it will memset all PDPTEs except trusty memory, then call 'free_ept_mem', it can only free trusty EPT, and does't affect shared normal world EPT. v2-->v3: -- Used new mmu api ept_mr_add when restore trusty memory to SOS and normal world -- Dropped this patch "Removed reverted page tables for trusty memory" because map_mem will be removed in future It will have a patch, need to update this api(ept_mr_add), it will not create inverted page tables for trusty memory. v1-->v2: -- free trusty ept still use free_ept_mem, not add a new api,but need to memset pdptes except trusty memory -- Removed reverted page tables for trusty memory. Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -389,7 +389,7 @@ int ept_mr_modify(struct vm *vm, uint64_t *pml4_page,
|
||||
uint64_t prot_set, uint64_t prot_clr);
|
||||
int ept_mr_del(struct vm *vm, uint64_t *pml4_page,
|
||||
uint64_t gpa, uint64_t size);
|
||||
|
||||
void free_ept_mem(void *pml4_addr);
|
||||
int ept_violation_vmexit_handler(struct vcpu *vcpu);
|
||||
int ept_misconfig_vmexit_handler(__unused struct vcpu *vcpu);
|
||||
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#define TRUSTY_EPT_REBASE_GPA (511UL * 1024UL * 1024UL * 1024UL)
|
||||
#define TRUSTY_MEMORY_SIZE 0x01000000
|
||||
|
||||
#define NON_TRUSTY_PDPT_ENTRIES 511U
|
||||
|
||||
/* Structure of seed info */
|
||||
struct seed_info {
|
||||
uint8_t cse_svn;
|
||||
@@ -127,7 +129,7 @@ struct trusty_startup_param {
|
||||
|
||||
void switch_world(struct vcpu *vcpu, int next_world);
|
||||
bool initialize_trusty(struct vcpu *vcpu, uint64_t param);
|
||||
void destroy_secure_world(struct vm *vm);
|
||||
void destroy_secure_world(struct vm *vm, bool need_clr_mem);
|
||||
void save_sworld_context(struct vcpu *vcpu);
|
||||
void restore_sworld_context(struct vcpu *vcpu);
|
||||
void trusty_set_dseed(void *dseed, uint8_t dseed_num);
|
||||
|
Reference in New Issue
Block a user