mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
hv: mmu: reimplement mmu_add to add page table mapping
The ept_mr_add still use the old map_mem. The old API will keep for a peroid until the SOS the same refine be merged. Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -324,6 +324,9 @@ void enable_smep(void);
|
||||
void init_paging(void);
|
||||
int map_mem(struct map_params *map_params, void *paddr, void *vaddr,
|
||||
uint64_t size, uint32_t flags);
|
||||
int mmu_add(uint64_t *pml4_page, uint64_t paddr_base,
|
||||
uint64_t vaddr_base, uint64_t size,
|
||||
uint64_t prot, enum _page_table_type ptt);
|
||||
int mmu_modify_or_del(uint64_t *pml4_page,
|
||||
uint64_t vaddr_base, uint64_t size,
|
||||
uint64_t prot_set, uint64_t prot_clr,
|
||||
|
@@ -68,12 +68,18 @@ static inline uint64_t *pte_offset(uint64_t *pde, uint64_t addr)
|
||||
return pde_page_vaddr(*pde) + pte_index(addr);
|
||||
}
|
||||
|
||||
static inline uint64_t get_pte(uint64_t *pte)
|
||||
/*
|
||||
* pgentry may means pml4e/pdpte/pde/pte
|
||||
*/
|
||||
static inline uint64_t get_pgentry(uint64_t *pte)
|
||||
{
|
||||
return *pte;
|
||||
}
|
||||
|
||||
static inline void set_pte(uint64_t *ptep, uint64_t pte)
|
||||
/*
|
||||
* pgentry may means pml4e/pdpte/pde/pte
|
||||
*/
|
||||
static inline void set_pgentry(uint64_t *ptep, uint64_t pte)
|
||||
{
|
||||
*ptep = pte;
|
||||
}
|
||||
|
Reference in New Issue
Block a user