From 39838a6fb856bc5c45c4949bbedc58ea49ecbbeb Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 12 Jan 2018 16:41:18 +0000 Subject: [PATCH] tools/libelf: fix elf notes check for PVH guest MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PVH only requires PHYS32_ENTRY to be set. Return immediately if that's the case. Also remove the printk in pvh_load_kernel. Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper [remove PVH dom0 builder chunk when backporting] Signed-off-by: Roger Pau Monné --- xen/common/libelf/libelf-dominfo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c index a52900c00c..378bc05f39 100644 --- a/xen/common/libelf/libelf-dominfo.c +++ b/xen/common/libelf/libelf-dominfo.c @@ -373,6 +373,13 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary *elf, return 0; } + /* PVH only requires one ELF note to be set */ + if ( parms->phys_entry != UNSET_ADDR32 ) + { + elf_msg(elf, "ELF: Found PVH image\n"); + return 0; + } + /* Check the contents of the Xen notes or guest string. */ if ( ((strlen(parms->loader) == 0) || strncmp(parms->loader, "generic", 7)) && @@ -381,7 +388,7 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary *elf, { elf_err(elf, "ERROR: Will only load images built for the generic loader or Linux images" - " (Not '%.*s' and '%.*s')\n", + " (Not '%.*s' and '%.*s') or with PHYS32_ENTRY set\n", (int)sizeof(parms->loader), parms->loader, (int)sizeof(parms->guest_os), parms->guest_os); return -1; -- 2.39.5