]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
x86/loader: expose unpatched kernel
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 5 Sep 2024 14:12:09 +0000 (16:12 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 16 Dec 2024 06:31:28 +0000 (07:31 +0100)
Add a new "etc/boot/kernel" fw_cfg file, containing the kernel without
the setup header patches.  Intended use is booting in UEFI with secure
boot enabled, where the setup header patching breaks secure boot
verification.

Needs OVMF changes too to be actually useful.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20240905141211.1253307-5-kraxel@redhat.com>

hw/i386/x86-common.c

index 28341b42d94975ffa42d81f6533677b9f09c88d8..1cef3045ad834f69a5049ca2ecad6be38e610317 100644 (file)
@@ -962,6 +962,9 @@ void x86_load_linux(X86MachineState *x86ms,
     sev_load_ctx.setup_data = (char *)setup;
     sev_load_ctx.setup_size = setup_size;
 
+    /* kernel without setup header patches */
+    fw_cfg_add_file(fw_cfg, "etc/boot/kernel", kernel, kernel_size);
+
     if (sev_enabled()) {
         sev_add_kernel_loader_hashes(&sev_load_ctx, &error_fatal);
     }