mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 11:47:30 +00:00
HV: Add ept_flush_leaf_page API
The ept_flush_leaf_page API is used to flush address space from a ept page entry, user can use it to match walk_ept_mr to flush VM address space. Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Reviewed-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
f320130d58
commit
7018a13cb6
@ -156,6 +156,23 @@ void ept_del_mr(struct acrn_vm *vm, uint64_t *pml4_page, uint64_t gpa, uint64_t
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre pge != NULL && size > 0.
|
||||
*/
|
||||
void ept_flush_leaf_page(uint64_t *pge, uint64_t size)
|
||||
{
|
||||
uint64_t hpa = INVALID_HPA;
|
||||
void *hva = NULL;
|
||||
|
||||
if ((*pge & EPT_MT_MASK) != EPT_UNCACHED) {
|
||||
hpa = (*pge & (~(size - 1UL)));
|
||||
hva = hpa2hva(hpa);
|
||||
stac();
|
||||
flush_address_space(hva, size);
|
||||
clac();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre: vm != NULL.
|
||||
*/
|
||||
|
@ -106,6 +106,17 @@ void ept_modify_mr(struct acrn_vm *vm, uint64_t *pml4_page, uint64_t gpa,
|
||||
void ept_del_mr(struct acrn_vm *vm, uint64_t *pml4_page, uint64_t gpa,
|
||||
uint64_t size);
|
||||
|
||||
/**
|
||||
* @brief Flush address space from the page entry
|
||||
*
|
||||
* @param[in] pge the pointer that points to the page entry
|
||||
*
|
||||
* @param[in] size the size of the page
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void ept_flush_leaf_page(uint64_t *pge, uint64_t size);
|
||||
|
||||
/**
|
||||
* @brief Get EPT pointer of the vm
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user