On 03/03/2020 11:52, Roger Pau Monne wrote: > Don't assume there's going to be enough space at the tail of the > loaded kernel and instead try to find a suitable memory area where the > initrd and metadata can be loaded. > > Reported-by: Andrew Cooper <andrew.coop...@citrix.com> > Signed-off-by: Roger Pau Monné <roger....@citrix.com>
I can confirm that this fixes the "failed to boot PVH" on my Rome system. Tested-by: Andrew Cooper <andrew.coop...@citrix.com> We've still got the excessive-time-to-construct issues to look at, but this definitely brings things to a better position. > diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c > index eded87eaf5..33520ec1bc 100644 > --- a/xen/arch/x86/hvm/dom0_build.c > +++ b/xen/arch/x86/hvm/dom0_build.c > @@ -490,6 +490,45 @@ static int __init pvh_populate_p2m(struct domain *d) > #undef MB1_PAGES > } > > +static paddr_t find_memory(const struct domain *d, const struct elf_binary > *elf, > + size_t size) > +{ > + paddr_t kernel_start = (paddr_t)elf->dest_base; > + paddr_t kernel_end = (paddr_t)(elf->dest_base + elf->dest_size); > + unsigned int i; > + > + for ( i = 0; i < d->arch.nr_e820; i++ ) > + { > + paddr_t start, end = d->arch.e820[i].addr + d->arch.e820[i].size; > + > + /* Don't use memory below 1MB, as it could overwrite the BDA/EBDA. */ The BDA is in mfn 0 so is special for other reasons*. The EBDA and IBFT are the problem datastructures. ~Andrew [*] Thinking about it, how should a PVH hardware domain reconcile its paravirtualised boot with finding itself on a BIOS or EFI system... _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel