(+ Peter Maydell and Stefano)
Hi Steward,
Thank you for the bug report.
On 05/10/2018 23:17, Stewart Hildebrand wrote:
On 11/09/2018 17:48, Amit Singh Tomar wrote:
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index d63734f..ef87b5c 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -120,8 +127,8 @@ efi_head:
add x13, x18, #0x16
b real_start /* branch to kernel start */
.quad 0 /* Image load offset from start of RAM
*/
- .quad 0 /* reserved */
- .quad 0 /* reserved */
+ .quad _end - start /* Effective size of kernel image,
little-endian */
+ .quad __HEAD_FLAGS /* Informative flags, little-endian */
.quad 0 /* reserved */
.quad 0 /* reserved */
.quad 0 /* reserved */
Since 17bd254a xen:arm: Populate arm64 image header, qemu-system-aarch64 has
not been too happy about booting Xen.
Trying to launch qemu-system-aarch64 gives the following error:
rom: requested regions overlap (rom bootloader. free=0x00000000400d0150,
addr=0x0000000040000000)
qemu-system-aarch64: rom check and register reset failed
Reverting 17bd254a allowed it to boot again. Alternatively, setting the image
offset to some value allowed it to boot again.
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index ef87b5c..8879c77 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -126,7 +126,7 @@ efi_head:
*/
add x13, x18, #0x16
b real_start /* branch to kernel start */
- .quad 0 /* Image load offset from start of RAM */
+ .quad 0x00080000 /* Image load offset from start of RAM */
.quad _end - start /* Effective size of kernel image,
little-endian */
.quad __HEAD_FLAGS /* Informative flags, little-endian */
.quad 0 /* reserved */
I'm not sure if this is a fault of qemu, or if Xen should put some value in the
image load offset field?
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.
For reference, I'm using the following script to build and launch qemu+Xen
https://gist.github.com/stewdk/110f43e0cc1d905fc6ed4c7e10d8d35e
Cheers,
[1] https://www.kernel.org/doc/Documentation/arm64/booting.txt
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel