mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-13 09:02:53 +00:00
hv: multiarch: move set_pgentry/get_pgentry
move the two function to common Tracked-On: #8831 Signed-off-by: hangliu1 <hang1.liu@intel.com> Reviewed-by: Fei Li <fei1.li@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
@@ -355,23 +355,6 @@ static inline uint64_t *pte_offset(const uint64_t *pde, uint64_t addr)
|
||||
return pde_page_vaddr(*pde) + pte_index(addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* pgentry may means pml4e/pdpte/pde/pte
|
||||
*/
|
||||
static inline uint64_t get_pgentry(const uint64_t *pte)
|
||||
{
|
||||
return *pte;
|
||||
}
|
||||
|
||||
/*
|
||||
* pgentry may means pml4e/pdpte/pde/pte
|
||||
*/
|
||||
static inline void set_pgentry(uint64_t *ptep, uint64_t pte, const struct pgtable *table)
|
||||
{
|
||||
*ptep = pte;
|
||||
table->flush_cache_pagewalk(ptep);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether the PS flag of the specified page directory table entry(PDE) is 1 or not.
|
||||
*
|
||||
|
||||
@@ -57,6 +57,23 @@ struct pgtable {
|
||||
void (*recover_exe_right)(uint64_t *entry);
|
||||
};
|
||||
|
||||
/*
|
||||
* pgentry may means generic page table entry
|
||||
*/
|
||||
static inline uint64_t get_pgentry(const uint64_t *pte)
|
||||
{
|
||||
return *pte;
|
||||
}
|
||||
|
||||
/*
|
||||
* pgentry may means generic page table entry
|
||||
*/
|
||||
static inline void set_pgentry(uint64_t *ptep, uint64_t pte, const struct pgtable *table)
|
||||
{
|
||||
*ptep = pte;
|
||||
table->flush_cache_pagewalk(ptep);
|
||||
}
|
||||
|
||||
void init_page_pool(struct page_pool *pool, uint64_t *page_base,
|
||||
uint64_t *bitmap_base, int page_num);
|
||||
struct page *alloc_page(struct page_pool *pool);
|
||||
|
||||
Reference in New Issue
Block a user