From b2662faefbb4e531aed8bcbd7ca293bbeec85f1d Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Mon, 6 Apr 2020 04:04:07 -0700 Subject: [PATCH] bios: Make sure PVH still works with "rom" feature Without this change, QEMU/CloudHV will attempt to load the ROM into the memory region below 4GiB. But something (i.e. SeaBIOS) is already there. We just pick an arbitrary address. It doesn't actually matter where it gets loaded, as the ROM code isn't used when doing PVH boot. Signed-off-by: Joe Richey --- layout.ld | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout.ld b/layout.ld index 5d198838..2c4d5a51 100644 --- a/layout.ld +++ b/layout.ld @@ -4,7 +4,9 @@ PHDRS { ram PT_LOAD FILEHDR PHDRS ; note PT_NOTE ; - rom PT_LOAD ; + /* We set the PhysAddr to an arbitrary RAM address, so that the ROM will still + boot with PVH. Without this, this PHDR conflicts with QEMU's SeaBIOS. */ + rom PT_LOAD AT(ram_max) ; } /* Loaders like to put stuff in low memory (< 1M), so we don't use it. */