[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 05/31] hw/i386/pc: run the multiboot loader before
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL v2 05/31] hw/i386/pc: run the multiboot loader before the PVH loader |
Date: |
Mon, 11 Mar 2019 17:55:09 +0100 |
From: Stefano Garzarella <address@hidden>
Some multiboot images could be in the ELF format. In the current
implementation QEMU fails because we try to load these images
as a PVH image.
In order to fix this issue, we should try multiboot first (we
already check the multiboot magic header before to load it).
If it is not a multiboot image, we can try the PVH loader.
Fixes: ab969087da6 ("pvh: Boot uncompressed kernel using direct boot ABI",
2019-01-15)
Reported-by: Paolo Bonzini <address@hidden>
Signed-off-by: Stefano Garzarella <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/pc.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 4212818..9c8f833 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1210,6 +1210,17 @@ static void load_linux(PCMachineState *pcms,
protocol = lduw_p(header+0x206);
} else {
/*
+ * This could be a multiboot kernel. If it is, let's stop treating it
+ * like a Linux kernel.
+ * Note: some multiboot images could be in the ELF format (the same of
+ * PVH), so we try multiboot first since we check the multiboot magic
+ * header before to load it.
+ */
+ if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename,
+ kernel_cmdline, kernel_size, header)) {
+ return;
+ }
+ /*
* Check if the file is an uncompressed kernel file (ELF) and load it,
* saving the PVH entry point used by the x86/HVM direct boot ABI.
* If load_elfboot() is successful, populate the fw_cfg info.
@@ -1262,12 +1273,6 @@ static void load_linux(PCMachineState *pcms,
return;
}
- /* This looks like a multiboot kernel. If it is, let's stop
- treating it like a Linux kernel. */
- if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename,
- kernel_cmdline, kernel_size, header)) {
- return;
- }
protocol = 0;
}
--
1.8.3.1
- [Qemu-devel] [PULL v2 00/31] Misc patches for 2019-03-09, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 01/31] memory: Do not update coalesced IO range in the case of NOP, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 03/31] riscv/Kconfig: enable PCI_DEVICES, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 02/31] vfio-pci: enable by default, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 04/31] tests: test-qgraph: fix a memory leak, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 05/31] hw/i386/pc: run the multiboot loader before the PVH loader,
Paolo Bonzini <=
- [Qemu-devel] [PULL v2 06/31] block/iscsi: Restrict Linux-specific code, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 07/31] contrib/elf2dmp: add kernel start address checking, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 08/31] configure: Enable werror for git worktrees, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 10/31] i386: extended the cpuid_level when Intel PT is enabled, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 11/31] virtio-scsi: Fix build with gcc 9, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 15/31] build: get rid of target-obj-y, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 12/31] lsi: implement basic SBCL functionality, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 09/31] target-i386: add kvm stubs to user-mode emulators, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 13/31] lsi: check if SIGP bit is already set in Wait reselect, Paolo Bonzini, 2019/03/11
- [Qemu-devel] [PULL v2 14/31] update copyright notice, Paolo Bonzini, 2019/03/11