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:
hangliu1
2025-10-13 11:48:08 +08:00
committed by acrnsi-robot
parent 2e4f5e79b7
commit bab6e4010c
2 changed files with 17 additions and 17 deletions

View File

@@ -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.
*

View File

@@ -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);