From 8e255da82991eb677e616118b584561a4c757487 Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Tue, 22 May 2018 15:28:48 +0800 Subject: [PATCH] trusty: invept should go through all vcpus make invept request for all vcpus in vms. Signed-off-by: Jason Chen CJ --- hypervisor/arch/x86/trusty.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/trusty.c b/hypervisor/arch/x86/trusty.c index be0314770..f171bc40b 100644 --- a/hypervisor/arch/x86/trusty.c +++ b/hypervisor/arch/x86/trusty.c @@ -62,6 +62,8 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig, IA32E_EPT_X_BIT); void *sub_table_addr = NULL, *pml4_base = NULL; struct vm *vm0 = get_vm_from_vmid(0); + int i; + struct vcpu *vcpu; if (vm0 == NULL) { pr_err("Parse vm0 context failed."); @@ -133,9 +135,13 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig, vm->sworld_control.sworld_memory.base_hpa = hpa; vm->sworld_control.sworld_memory.length = size; - invept(vm->current_vcpu); - invept(vm0->current_vcpu); + foreach_vcpu(i, vm, vcpu) { + vcpu_make_request(vcpu, ACRN_REQUEST_EPT_FLUSH); + } + foreach_vcpu(i, vm0, vcpu) { + vcpu_make_request(vcpu, ACRN_REQUEST_EPT_FLUSH); + } } void destroy_secure_world(struct vm *vm)