[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Xen boot failure on QEMU (WAS: Re: [PATCH v3] xen:arm: Populate arm64 image header)

On 8 October 2018 at 19:00, Julien Grall <julien.grall@xxxxxxx> wrote:
> Per the Linux arm64 booting protocol [1], the load offset can definitely be
> 0. The bootloader (here QEMU) should not assume a specific text offset,
> Linux actually provides an option to randomize the text offset in order to
> test that assumption (see ARM64_RANDOMIZE_TEXT_OFFSET).
> I have CCed Stefano and Peter who could give more details on how QEMU is
> handling the Image protocol.

QEMU's code to handle this is in hw/arm/boot.c/load_aarch64_image().
We do have code to handle reading the text offset from the Image
header. The error message
rom: requested regions overlap (rom bootloader.
free=0x00000000400d0150, addr=0x0000000040000000)

suggests that we have correctly pulled the text offset from the
Image file, but it overlaps with something else. Specifically,
for the virt board we write our startup "bootloader" (about
a dozen insns of assembly that do the job of jumping to the kernel)
at the very bottom of RAM, so you can't use that bit of RAM for
the image. In theory boot.c could notice that the image is where
it would by default put the bootloader code and move that somewhere
else (it is IIRC position-independent), but that would be quite
complicated code for a corner case, and it doesn't help you with
existing deployed versions of QEMU anyway.

-- PMM

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.