aboutsummaryrefslogtreecommitdiff
path: root/tables.c
diff options
context:
space:
mode:
authorLiam Merwick <liam.merwick@oracle.com>2018-11-20 13:01:47 +0000
committerPaolo Bonzini <bonzini@gnu.org>2018-12-28 14:31:29 +0100
commitfec27f4d23b7335a72c4c6a4bb75e94e7500669a (patch)
tree51186d1df58fec3a27874708888bc58fccdf5089 /tables.c
parent281da37f5907f48b10c62622551446e8f14aea09 (diff)
downloadqboot-fec27f4d23b7335a72c4c6a4bb75e94e7500669a.zip
qboot-fec27f4d23b7335a72c4c6a4bb75e94e7500669a.tar.gz
qboot-fec27f4d23b7335a72c4c6a4bb75e94e7500669a.tar.bz2
pvh: use x86/HVM direct boot ABI
These changes (along with corresponding QEMU and Linux kernel changes) enable a guest to be booted using the x86/HVM direct boot ABI. QEMU parses the uncompressed kernel binary passed to it via -kernel to read the ELF Note which contains the address to be loaded. QEMU then depends on qboot to populate the start_info struct needed by the direct boot ABI and configure the guest e820 tables before jumping to the loaded kernel entry. Signed-off-by: George Kennedy <George.Kennedy@oracle.com> Signed-off-by: Liam Merwick <Liam.Merwick@oracle.com>
Diffstat (limited to 'tables.c')
-rw-r--r--tables.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tables.c b/tables.c
index 32b2406..9493691 100644
--- a/tables.c
+++ b/tables.c
@@ -2,6 +2,9 @@
#include "stdio.h"
#include "fw_cfg.h"
#include "string.h"
+#include "start_info.h"
+
+extern struct hvm_start_info start_info;
struct loader_cmd {
uint32_t cmd;
@@ -67,6 +70,13 @@ static void do_alloc(char *file, uint32_t align, uint8_t zone)
set_file_addr(id, p);
fw_cfg_read_file(id, p, n);
+
+ /* For PVH boot, save the PA where the RSDP is stored */
+ if (zone == ALLOC_FSEG) {
+ if (!memcmp(p, "RSD PTR ", 8)) {
+ start_info.rsdp_paddr = (uintptr_t)id_to_addr(id);
+ }
+ }
}
static void do_ptr(char *dest, char *src, uint32_t offset, uint8_t size)