Skip to content

Commit 878b5a0

Browse files
JasonChenCJjren1
authored andcommitted
mmu: refine functions for invept
- rename mmu_invept to invept - panic if HW doesn't support invept Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent a68850e commit 878b5a0

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

hypervisor/arch/x86/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ int acrn_do_intr_process(struct vcpu *vcpu)
289289
uint64_t *pending_intr_bits = &vcpu->arch_vcpu.pending_intr;
290290

291291
if (bitmap_test_and_clear(ACRN_REQUEST_TLB_FLUSH, pending_intr_bits))
292-
mmu_invept(vcpu);
292+
invept(vcpu);
293293

294294
if (bitmap_test_and_clear(ACRN_REQUEST_TMR_UPDATE, pending_intr_bits))
295295
vioapic_update_tmr(vcpu);

hypervisor/arch/x86/mmu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ static void check_mmu_capability(void)
118118
cpuid(CPUID_EXTEND_FUNCTION_1, &eax, &ebx, &ecx, &edx);
119119
mm_caps.mmu_1gb_page_supported = (edx & CPUID_EDX_PAGE1GB) ?
120120
(true) : (false);
121+
122+
if (!mm_caps.invept_supported)
123+
panic("invept must be supported");
121124
}
122125

123126
static inline bool check_invept_single_support(void)
@@ -132,7 +135,7 @@ static inline bool check_invept_global_support(void)
132135
mm_caps.invept_global_context_supported;
133136
}
134137

135-
void mmu_invept(struct vcpu *vcpu)
138+
void invept(struct vcpu *vcpu)
136139
{
137140
struct invept_desc desc = {0};
138141

hypervisor/arch/x86/trusty.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig,
174174
vm->sworld_control.sworld_memory.base_hpa = hpa;
175175
vm->sworld_control.sworld_memory.length = size;
176176

177-
mmu_invept(vm->current_vcpu);
178-
mmu_invept(vm0->current_vcpu);
177+
invept(vm->current_vcpu);
178+
invept(vm0->current_vcpu);
179179

180180
}
181181

hypervisor/include/arch/x86/mmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ int unmap_mem(struct map_params *map_params, void *paddr, void *vaddr,
324324
uint64_t size, uint32_t flags);
325325
int modify_mem(struct map_params *map_params, void *paddr, void *vaddr,
326326
uint64_t size, uint32_t flags);
327-
void mmu_invept(struct vcpu *vcpu);
327+
void invept(struct vcpu *vcpu);
328328
bool check_continuous_hpa(struct vm *vm, uint64_t gpa, uint64_t size);
329329
int obtain_last_page_table_entry(struct map_params *map_params,
330330
struct entry_params *entry, void *addr, bool direct);

0 commit comments

Comments
 (0)