From 4efb8f08d98f457ca6d1f4a0eefae0d6c6a05bb2 Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Mon, 13 Jan 2025 18:22:03 -0300 Subject: [PATCH 1/2] OVMF: add `passthru.mergedFirmware` parameter This is the final firmware blob that's expected by hypervisors, like Xen. The `passthru.firmware` attribute refers to the OVMF_CODE.fd blob, which is not aligned properly and exceeds the BIOS boundaries set by Xen. See #373416 and https://www.mail-archive.com/xen-devel@lists.xen.org/msg118481.html Signed-off-by: Fernando Rodrigues --- pkgs/applications/virtualization/OVMF/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index f9ecceb226de..ff014dc0aa5a 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -253,6 +253,7 @@ edk2.mkDerivation projectDscPath (finalAttrs: { prefix = "${finalAttrs.finalPackage.fd}/FV/${fwPrefix}"; in { + mergedFirmware = "${prefix}.fd"; firmware = "${prefix}_CODE.fd"; variables = "${prefix}_VARS.fd"; variablesMs = From a35e5e53753fb6722093a7c28a253221962fd6df Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Mon, 13 Jan 2025 18:32:06 -0300 Subject: [PATCH 2/2] xen: use the merged OVMF blob Fixes #373416 Signed-off-by: Fernando Rodrigues --- pkgs/build-support/xen/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/xen/default.nix b/pkgs/build-support/xen/default.nix index ebeb8b98d4ca..f5d127c15796 100644 --- a/pkgs/build-support/xen/default.nix +++ b/pkgs/build-support/xen/default.nix @@ -171,7 +171,7 @@ stdenv.mkDerivation (finalAttrs: { "--disable-qemu-traditional" "--with-system-qemu" (if withSeaBIOS then "--with-system-seabios=${systemSeaBIOS.firmware}" else "--disable-seabios") - (if withOVMF then "--with-system-ovmf=${OVMF.firmware}" else "--disable-ovmf") + (if withOVMF then "--with-system-ovmf=${OVMF.mergedFirmware}" else "--disable-ovmf") (if withIPXE then "--with-system-ipxe=${ipxe.firmware}" else "--disable-ipxe") (enableFeature withFlask "xsmpolicy") ];