@@ -574,8 +574,8 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
}
/* Copy the OS image and free temporary buffer. */
- elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
- elf.dest_size = parms.virt_kend - parms.virt_kstart;
+ elf.dest_base = (void *)parms.phys_kstart - parms.elf_paddr_offset;
+ elf.dest_size = parms.phys_kend - parms.phys_kstart;
elf_set_vcpu(&elf, v);
rc = elf_load_binary(&elf);
@@ -453,6 +453,8 @@ static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
}
virt_offset = parms->virt_base - parms->elf_paddr_offset;
+ parms->phys_kstart = elf->pstart;
+ parms->phys_kend = elf->pend;
parms->virt_kstart = elf->pstart + virt_offset;
parms->virt_kend = elf->pend + virt_offset;
@@ -464,6 +466,7 @@ static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
elf_parse_bsdsyms(elf, elf->pend);
if ( elf->bsd_symtab_pend )
parms->virt_kend = elf->bsd_symtab_pend + virt_offset;
+ parms->phys_kend = elf->bsd_symtab_pend;
}
elf_msg(elf, "ELF: addresses:\n");
@@ -434,6 +434,8 @@ struct elf_dom_parms {
/* calculated */
uint64_t virt_kstart;
uint64_t virt_kend;
+ uint64_t phys_kstart;
+ uint64_t phys_kend;
};
static inline void elf_xen_feature_set(int nr, uint32_t * addr)
The physical start and end matter for PVH. These are only used by a PVH dom0, but will help when separating the PV and PVH ELF checking in the next patch. Signed-off-by: Jason Andryuk <jandryuk@gmail.com> --- xen/arch/x86/hvm/dom0_build.c | 4 ++-- xen/common/libelf/libelf-dominfo.c | 3 +++ xen/include/xen/libelf.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-)