Skip to content

Commit 8e255da

Browse files
JasonChenCJlijinxia
authored andcommitted
trusty: invept should go through all vcpus
make invept request for all vcpus in vms. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent c84766a commit 8e255da

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

hypervisor/arch/x86/trusty.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig,
6262
IA32E_EPT_X_BIT);
6363
void *sub_table_addr = NULL, *pml4_base = NULL;
6464
struct vm *vm0 = get_vm_from_vmid(0);
65+
int i;
66+
struct vcpu *vcpu;
6567

6668
if (vm0 == NULL) {
6769
pr_err("Parse vm0 context failed.");
@@ -133,9 +135,13 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig,
133135
vm->sworld_control.sworld_memory.base_hpa = hpa;
134136
vm->sworld_control.sworld_memory.length = size;
135137

136-
invept(vm->current_vcpu);
137-
invept(vm0->current_vcpu);
138+
foreach_vcpu(i, vm, vcpu) {
139+
vcpu_make_request(vcpu, ACRN_REQUEST_EPT_FLUSH);
140+
}
138141

142+
foreach_vcpu(i, vm0, vcpu) {
143+
vcpu_make_request(vcpu, ACRN_REQUEST_EPT_FLUSH);
144+
}
139145
}
140146

141147
void destroy_secure_world(struct vm *vm)

0 commit comments

Comments
 (0)