return -1;
elf_parse_binary(elf);
- elf_xen_parse(elf, &parms);
+ elf_xen_parse(elf, &parms, false);
+ elf_xen_parse(elf, &parms, true);
return 0;
}
* or else we might be trying to load a plain ELF.
*/
elf_parse_binary(&elf);
- rc = elf_xen_parse(&elf, dom->parms);
+ rc = elf_xen_parse(&elf, dom->parms,
+ dom->container_type == XC_DOM_HVM_CONTAINER);
if ( rc != 0 )
return rc;
/* parse binary and get xen meta info */
elf_parse_binary(elf);
- if ( elf_xen_parse(elf, dom->parms) != 0 )
+ if ( elf_xen_parse(elf, dom->parms,
+ dom->container_type == XC_DOM_HVM_CONTAINER) != 0 )
{
rc = -EINVAL;
goto out;
* else we might be trying to load a PV kernel.
*/
elf_parse_binary(&elf);
- rc = elf_xen_parse(&elf, dom->parms);
+ rc = elf_xen_parse(&elf, dom->parms, true);
if ( rc == 0 )
return -EINVAL;
elf_set_verbose(&elf);
#endif
elf_parse_binary(&elf);
- if ( (rc = elf_xen_parse(&elf, &parms)) != 0 )
+ if ( (rc = elf_xen_parse(&elf, &parms, true)) != 0 )
{
printk("Unable to parse kernel for ELFNOTES\n");
return rc;
elf_set_verbose(&elf);
elf_parse_binary(&elf);
- if ( (rc = elf_xen_parse(&elf, &parms)) != 0 )
+ if ( (rc = elf_xen_parse(&elf, &parms, false)) != 0 )
goto out;
/* compatibility check */
/* glue it all together ... */
elf_errorstatus elf_xen_parse(struct elf_binary *elf,
- struct elf_dom_parms *parms)
+ struct elf_dom_parms *parms, bool hvm)
{
ELF_HANDLE_DECL(elf_shdr) shdr;
ELF_HANDLE_DECL(elf_phdr) phdr;
}
- /*
- * Finally fall back to the __xen_guest section.
- */
- if ( xen_elfnotes == 0 )
+ /* Finally fall back to the __xen_guest section for PV guests only. */
+ if ( xen_elfnotes == 0 && !hvm )
{
shdr = elf_shdr_by_name(elf, "__xen_guest");
if ( ELF_HANDLE_VALID(shdr) )
int elf_xen_parse_guest_info(struct elf_binary *elf,
struct elf_dom_parms *parms);
int elf_xen_parse(struct elf_binary *elf,
- struct elf_dom_parms *parms);
+ struct elf_dom_parms *parms, bool hvm);
static inline void *elf_memcpy_unchecked(void *dest, const void *src, size_t n)
{ return memcpy(dest, src, n); }