bootparam: bug fix on address convertion
Before pasing commandline from boot param, switch the phisical address of param to virtaul address. Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
This commit is contained in:
parent
2a37a4de71
commit
db4e3f87bf
|
@ -103,7 +103,7 @@ int parse_hv_cmdline(void)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
mbi = (struct multiboot_info *)((uint64_t)boot_regs[1]);
|
||||
mbi = (struct multiboot_info *)(HPA2HVA((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)) {
|
||||
|
@ -111,7 +111,7 @@ int parse_hv_cmdline(void)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
start = (char *)(uint64_t)mbi->mi_cmdline;
|
||||
start = (char *)HPA2HVA((uint64_t)mbi->mi_cmdline);
|
||||
dev_dbg(ACRN_DBG_PARSE, "hv cmdline: %s", start);
|
||||
|
||||
do {
|
||||
|
|
|
@ -176,12 +176,12 @@ static void efi_init(void)
|
|||
if (boot_regs[0] != MULTIBOOT_INFO_MAGIC)
|
||||
ASSERT(0, "no multiboot info found");
|
||||
|
||||
mbi = (struct multiboot_info *)((uint64_t)(uint32_t)boot_regs[1]);
|
||||
mbi = (struct multiboot_info *)HPA2HVA(((uint64_t)(uint32_t)boot_regs[1]));
|
||||
|
||||
if (!(mbi->mi_flags & MULTIBOOT_INFO_HAS_DRIVES))
|
||||
ASSERT(0, "no multiboot drivers for uefi found");
|
||||
|
||||
efi_ctx = (struct efi_ctx *)(uint64_t)mbi->mi_drives_addr;
|
||||
efi_ctx = (struct efi_ctx *)HPA2HVA((uint64_t)mbi->mi_drives_addr);
|
||||
ASSERT(efi_ctx != NULL, "no uefi context found");
|
||||
|
||||
vm_sw_loader = uefi_sw_loader;
|
||||
|
|
Loading…
Reference in New Issue