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

@@ -24,7 +24,7 @@ int32_t parse_hv_cmdline(void)
return -EINVAL;
}
mbi = (struct multiboot_info *)(hpa2hva((uint64_t)boot_regs[1]));
mbi = (struct multiboot_info *)(hpa2hva_early((uint64_t)boot_regs[1]));
dev_dbg(ACRN_DBG_PARSE, "Multiboot detected, flag=0x%x", mbi->mi_flags);
if ((mbi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) == 0U) {
@@ -32,7 +32,7 @@ int32_t parse_hv_cmdline(void)
return -EINVAL;
}
start = (char *)hpa2hva((uint64_t)mbi->mi_cmdline);
start = (char *)hpa2hva_early((uint64_t)mbi->mi_cmdline);
dev_dbg(ACRN_DBG_PARSE, "hv cmdline: %s", start);
do {