From 160dabd64adb5cd0db2881ebf828f520208fcf7a Mon Sep 17 00:00:00 2001 From: Jon Maloy Date: Fri, 21 Aug 2026 18:27:23 -0400 Subject: [PATCH] * Fri Aug 21 2026 Jon Maloy - 1.16.3-6 - seabios-add-romfile_loadbool.patch [RHEL-236811] - seabios-update-pci_pad_mem64-handling.patch [RHEL-236811] - Resolves: RHEL-236811 (Backport opt/org.seabios/pci64 to SeaBIOS 1.16 / el9) --- seabios-add-romfile_loadbool.patch | 72 +++++++++++++++++++++ seabios-update-pci_pad_mem64-handling.patch | 61 +++++++++++++++++ seabios.spec | 12 +++- 3 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 seabios-add-romfile_loadbool.patch create mode 100644 seabios-update-pci_pad_mem64-handling.patch diff --git a/seabios-add-romfile_loadbool.patch b/seabios-add-romfile_loadbool.patch new file mode 100644 index 0000000..944d164 --- /dev/null +++ b/seabios-add-romfile_loadbool.patch @@ -0,0 +1,72 @@ +From 6cd6830764979960144b63e7aecb0981b1445e43 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Fri, 22 Nov 2024 15:16:32 +0100 +Subject: [PATCH 1/2] add romfile_loadbool() + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 14: update pci_pad_mem64 handling +RH-Jira: RHEL-236811 +RH-Acked-by: Luigi Leonardi +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/2] af1e580e50ce2405a9fe286ee296a343e811a618 (kraxel.rh/centos-src-seabios) + +Translates strings in fw_cfg files into boolean values. + +Signed-off-by: Gerd Hoffmann +(cherry picked from commit a4fc1845b43687fe01c6f53fca9d7c1ac1b725d7) + +Resolves: RHEL-236811 +--- + src/romfile.c | 23 +++++++++++++++++++++++ + src/romfile.h | 1 + + 2 files changed, 24 insertions(+) + +diff --git a/src/romfile.c b/src/romfile.c +index b598274e..8072a915 100644 +--- a/src/romfile.c ++++ b/src/romfile.c +@@ -99,6 +99,29 @@ romfile_loadint(const char *name, u64 defval) + return val; + } + ++u32 ++romfile_loadbool(const char *name, u32 defval) ++{ ++ static const char *true_strings[] = { "1", "on", "yes" }; ++ static const char *false_strings[] = { "0", "off", "no" }; ++ char *str = romfile_loadfile(name, NULL); ++ int i; ++ ++ if (!str) ++ return defval; ++ ++ for (i = 0; i < ARRAY_SIZE(true_strings); i++) ++ if (0 == strcmp(str, true_strings[i])) ++ return 1; ++ ++ for (i = 0; i < ARRAY_SIZE(false_strings); i++) ++ if (0 == strcmp(str, false_strings[i])) ++ return 0; ++ ++ dprintf(1, "%s: unknown bool string: %s\n", __func__, str); ++ return defval; ++} ++ + struct const_romfile_s { + struct romfile_s file; + void *data; +diff --git a/src/romfile.h b/src/romfile.h +index 3e0f8200..ae2f4ac7 100644 +--- a/src/romfile.h ++++ b/src/romfile.h +@@ -15,6 +15,7 @@ struct romfile_s *romfile_findprefix(const char *prefix, struct romfile_s *prev) + struct romfile_s *romfile_find(const char *name); + void *romfile_loadfile(const char *name, int *psize); + u64 romfile_loadint(const char *name, u64 defval); ++u32 romfile_loadbool(const char *name, u32 defval); + + void const_romfile_add_int(char *name, u32 value); + +-- +2.52.0 + diff --git a/seabios-update-pci_pad_mem64-handling.patch b/seabios-update-pci_pad_mem64-handling.patch new file mode 100644 index 0000000..fe082fa --- /dev/null +++ b/seabios-update-pci_pad_mem64-handling.patch @@ -0,0 +1,61 @@ +From 85dd4b3d7b036e58a051ba78f013c7123d1ea7db Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Thu, 21 Nov 2024 16:35:41 +0100 +Subject: [PATCH 2/2] update pci_pad_mem64 handling + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 14: update pci_pad_mem64 handling +RH-Jira: RHEL-236811 +RH-Acked-by: Luigi Leonardi +RH-Acked-by: Miroslav Rezanina +RH-Commit: [2/2] 514f7215773fdd853b562eac3b8ece7f88b98e45 (kraxel.rh/centos-src-seabios) + +Add a new possible state: '-1' means 'use default'. In that case +seabios continue to use the current heuristic: In case memory +above 4G is present enable 64-bit guest friendly configuration. + +This allows forcing the one or the other behavior by setting the +pci_pad_mem64 variable beforehand (which is done by another patch). + +Signed-off-by: Gerd Hoffmann +(cherry picked from commit df9dd418b3b0e586cb208125094620fc7f90f23d) + +Resolves: RHEL-236811 +--- + src/fw/pciinit.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c +index bb44dc29..658d806d 100644 +--- a/src/fw/pciinit.c ++++ b/src/fw/pciinit.c +@@ -55,7 +55,7 @@ u64 pcimem64_end = BUILD_PCIMEM64_END; + // Resource allocation limits + static u64 pci_io_low_end = 0xa000; + static u64 pci_mem64_top = 0; +-static u32 pci_pad_mem64 = 0; ++static u32 pci_pad_mem64 = -1; + + struct pci_region_entry { + struct pci_device *dev; +@@ -1197,8 +1197,15 @@ pci_setup(void) + } + } + +- if (CPUPhysBits >= 36 && CPULongMode && RamSizeOver4G) +- pci_pad_mem64 = 1; ++ pci_pad_mem64 = romfile_loadbool("opt/org.seabios/pci64", -1); ++ ++ if (pci_pad_mem64 == -1) ++ // when not set enable in case memory over 4G is present ++ pci_pad_mem64 = RamSizeOver4G ? 1 : 0; ++ ++ if (!CPULongMode) ++ // force off for 32-bit CPUs ++ pci_pad_mem64 = 0; + + dprintf(1, "=== PCI bus & bridge init ===\n"); + if (pci_probe_host() != 0) { +-- +2.52.0 + diff --git a/seabios.spec b/seabios.spec index 411da7a..3105d0d 100644 --- a/seabios.spec +++ b/seabios.spec @@ -1,6 +1,6 @@ Name: seabios Version: 1.16.3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Open-source legacy BIOS implementation License: LGPLv3 @@ -23,6 +23,10 @@ Patch2: seabios-display-error-message-for-blocksizes-512.patch Patch3: seabios-pciinit-don-t-misalign-large-BARs.patch # For RHEL-131918 - [rhel-9] SeaBIOS date is "stuck" at 2014 even for recent releases Patch4: seabios-update-release-date.patch +# For RHEL-236811 - Backport opt/org.seabios/pci64 to SeaBIOS 1.16 / el9 +Patch5: seabios-add-romfile_loadbool.patch +# For RHEL-236811 - Backport opt/org.seabios/pci64 to SeaBIOS 1.16 / el9 +Patch6: seabios-update-pci_pad_mem64-handling.patch BuildRequires: make BuildRequires: gcc @@ -139,6 +143,12 @@ install -m 0644 binaries/vgabios*.bin $RPM_BUILD_ROOT%{_datadir}/seavgabios %{_datadir}/seavgabios/vgabios*.bin %changelog +* Fri Aug 21 2026 Jon Maloy - 1.16.3-6 +- seabios-add-romfile_loadbool.patch [RHEL-236811] +- seabios-update-pci_pad_mem64-handling.patch [RHEL-236811] +- Resolves: RHEL-236811 + (Backport opt/org.seabios/pci64 to SeaBIOS 1.16 / el9) + * Tue Dec 02 2025 Jon Maloy - 1.16.3-5 - seabios-update-release-date.patch [RHEL-131918 RHEL-131921] - seabios-turn-off-SMM-support.patch [RHEL-131918 RHEL-131921]