hv: Rename get_ept_entry() to get_eptp()

get_ept_entry() actually returns the EPTP of a VM. So rename it to
get_eptp() for readability.

Tracked-On: #5923
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shuo A Liu 2021-06-04 09:35:17 +08:00 committed by wenlingz
parent ad7b8fa3e8
commit 387ea23961
4 changed files with 6 additions and 6 deletions

View File

@ -440,7 +440,7 @@ EPT
.. doxygenfunction:: ept_flush_leaf_page
:project: Project ACRN
.. doxygenfunction:: get_ept_entry
.. doxygenfunction:: get_eptp
:project: Project ACRN
.. doxygenfunction:: walk_ept_table

View File

@ -234,7 +234,7 @@ uint64_t local_gpa2hpa(struct acrn_vm *vm, uint64_t gpa, uint32_t *size)
uint64_t pg_size = 0UL;
void *eptp;
eptp = get_ept_entry(vm);
eptp = get_eptp(vm);
pgentry = pgtable_lookup_entry((uint64_t *)eptp, gpa, &pg_size, &vm->arch_vm.ept_pgtable);
if (pgentry != NULL) {
hpa = (((*pgentry & (~EPT_PFN_HIGH_MASK)) & (~(pg_size - 1UL)))
@ -392,7 +392,7 @@ void ept_flush_leaf_page(uint64_t *pge, uint64_t size)
/**
* @pre: vm != NULL.
*/
void *get_ept_entry(struct acrn_vm *vm)
void *get_eptp(struct acrn_vm *vm)
{
void *eptp;
struct acrn_vcpu *vcpu = vcpu_from_pid(vm, get_pcpu_id());
@ -416,7 +416,7 @@ void walk_ept_table(struct acrn_vm *vm, pge_handler cb)
uint64_t i, j, k, m;
for (i = 0UL; i < PTRS_PER_PML4E; i++) {
pml4e = pml4e_offset((uint64_t *)get_ept_entry(vm), i << PML4E_SHIFT);
pml4e = pml4e_offset((uint64_t *)get_eptp(vm), i << PML4E_SHIFT);
if (table->pgentry_present(*pml4e) == 0UL) {
continue;
}

View File

@ -258,7 +258,7 @@ static uint64_t generate_shadow_ept_entry(struct acrn_vcpu *vcpu, uint64_t guest
*/
if (is_leaf_ept_entry(guest_ept_entry, guest_ept_level)) {
ASSERT(guest_ept_level == IA32E_PT, "Only support 4K page for guest EPT!");
ept_entry = get_leaf_entry((guest_ept_entry & EPT_ENTRY_PFN_MASK), get_ept_entry(vcpu->vm), &ept_level);
ept_entry = get_leaf_entry((guest_ept_entry & EPT_ENTRY_PFN_MASK), get_eptp(vcpu->vm), &ept_level);
if (ept_entry != 0UL) {
/*
* TODO:

View File

@ -140,7 +140,7 @@ void ept_flush_leaf_page(uint64_t *pge, uint64_t size);
* @retval If the current context of vm is SECURE_WORLD, return EPT pointer of
* secure world, otherwise return EPT pointer of normal world.
*/
void *get_ept_entry(struct acrn_vm *vm);
void *get_eptp(struct acrn_vm *vm);
/**
* @brief Walking through EPT table