mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
hv: mmu: add hpa2hva_early API for earlt boot
When need hpa and hva translation before init_paging, we need hpa2hva_early and hva2hpa_early since init_paging may modify hva2hpa to not be identical mapping. Tracked-On: #2987 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
40475e22b8
commit
11cf9a4a8a
@@ -145,6 +145,29 @@
|
||||
* @{
|
||||
*/
|
||||
/* hpa <--> hva, now it is 1:1 mapping */
|
||||
/**
|
||||
* @brief Translate host-physical address to host-virtual address
|
||||
*
|
||||
* @param[in] x The specified host-physical address
|
||||
*
|
||||
* @return The translated host-virtual address
|
||||
*/
|
||||
static inline void *hpa2hva_early(uint64_t x)
|
||||
{
|
||||
return (void *)x;
|
||||
}
|
||||
/**
|
||||
* @brief Translate host-virtual address to host-physical address
|
||||
*
|
||||
* @param[in] x The specified host-virtual address
|
||||
*
|
||||
* @return The translated host-physical address
|
||||
*/
|
||||
static inline uint64_t hva2hpa_early(void *x)
|
||||
{
|
||||
return (uint64_t)x;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Translate host-physical address to host-virtual address
|
||||
*
|
||||
|
Reference in New Issue
Block a user