hv: vm_load: set zeropage just past boot args

Which should in Linux guest gpa, not in hypervisor HVA.

Tracked-On: #1124
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1 2018-10-17 19:43:00 +08:00 committed by wenlingz
parent 9368373fd9
commit 49b476bb56

View File

@ -47,8 +47,9 @@ static uint64_t create_zero_page(struct vm *vm)
uint64_t gpa, addr; uint64_t gpa, addr;
/* Set zeropage in Linux Guest RAM region just past boot args */ /* Set zeropage in Linux Guest RAM region just past boot args */
hva = gpa2hva(vm, (uint64_t)sw_linux->bootargs_load_addr); gpa = (uint64_t)sw_linux->bootargs_load_addr + MEM_4K;
zeropage = (struct zero_page *)((char *)hva + MEM_4K); hva = gpa2hva(vm, gpa);
zeropage = hva;
/* clear the zeropage */ /* clear the zeropage */
(void)memset(zeropage, 0U, MEM_2K); (void)memset(zeropage, 0U, MEM_2K);
@ -78,9 +79,6 @@ static uint64_t create_zero_page(struct vm *vm)
/* Create/add e820 table entries in zeropage */ /* Create/add e820 table entries in zeropage */
zeropage->e820_nentries = (uint8_t)create_e820_table(zeropage->e820); zeropage->e820_nentries = (uint8_t)create_e820_table(zeropage->e820);
/* Get the host physical address of the zeropage */
gpa = hpa2gpa(vm, hva2hpa((void *)zeropage));
/* Return Physical Base Address of zeropage */ /* Return Physical Base Address of zeropage */
return gpa; return gpa;
} }