diff --git a/hypervisor/arch/x86/ept.c b/hypervisor/arch/x86/ept.c index a5e185c65..ce72602be 100644 --- a/hypervisor/arch/x86/ept.c +++ b/hypervisor/arch/x86/ept.c @@ -279,7 +279,8 @@ int ept_mr_add(const struct vm *vm, uint64_t *pml4_page, } ret = mmu_add(pml4_page, hpa, gpa, size, prot, PTT_EPT); - if (ret == 0) { + /* No need to create inverted page tables for trusty memory */ + if (ret == 0 && ((void *)pml4_page == vm->arch_vm.nworld_eptp)) { ret = mmu_add((uint64_t *)vm->arch_vm.m2p, gpa, hpa, size, prot, PTT_EPT); } diff --git a/hypervisor/arch/x86/trusty.c b/hypervisor/arch/x86/trusty.c index 85312855b..a85eb7991 100644 --- a/hypervisor/arch/x86/trusty.c +++ b/hypervisor/arch/x86/trusty.c @@ -127,7 +127,6 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig, } /* Map [gpa_rebased, gpa_rebased + size) to secure ept mapping - * TODO: not create inverted page tables for trusty memory */ ept_mr_add(vm, (uint64_t *)vm->arch_vm.sworld_eptp, hpa, gpa_rebased, size, EPT_RWX | EPT_WB);