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:
Li, Fei1
2019-07-24 18:03:44 +08:00
committed by ACRN System Integration
parent 40475e22b8
commit 11cf9a4a8a
5 changed files with 33 additions and 5 deletions

View File

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