diff --git a/SOURCES/seabios-malloc-use-large-ZoneHigh-when-there-is-enough-memor.patch b/SOURCES/seabios-malloc-use-large-ZoneHigh-when-there-is-enough-memor.patch new file mode 100644 index 0000000..058a9ef --- /dev/null +++ b/SOURCES/seabios-malloc-use-large-ZoneHigh-when-there-is-enough-memor.patch @@ -0,0 +1,80 @@ +From c80f616bf9c35de475539b90efa80a6134377d31 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Thu, 3 Aug 2023 20:07:38 -0400 +Subject: [PATCH 2/2] malloc: use large ZoneHigh when there is enough memory + +RH-Author: Jon Maloy +RH-MergeRequest: 10: malloc: use variable for ZoneHigh size +RH-Bugzilla: 2228485 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Miroslav Rezanina +RH-Commit: [2/2] d21be18a702b8935cd912127bc148af8d92af19f (jmaloy/jmaloy-src-seabios) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2228485 +Upstream: Merged + +commit dc88f9b72df52b22c35b127b80c487e0b6fca4af +Author: Gerd Hoffmann +Date: Mon Apr 25 09:25:31 2022 +0200 + + malloc: use large ZoneHigh when there is enough memory + + In case there is enough memory installed use a large ZoneHigh. + + Signed-off-by: Gerd Hoffmann + +Signed-off-by: Jon Maloy +--- + src/config.h | 3 ++- + src/malloc.c | 14 +++++++++----- + 2 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/src/config.h b/src/config.h +index 93c8dbc2..9abe355b 100644 +--- a/src/config.h ++++ b/src/config.h +@@ -17,7 +17,8 @@ + // Maximum number of map entries in the e820 map + #define BUILD_MAX_E820 32 + // Space to reserve in high-memory for tables +-#define BUILD_MAX_HIGHTABLE (256*1024) ++#define BUILD_MIN_HIGHTABLE (256*1024) ++#define BUILD_MAX_HIGHTABLE (16*1024*1024) + // Largest supported externaly facing drive id + #define BUILD_MAX_EXTDRIVE 16 + // Number of bytes the smbios may be and still live in the f-segment +diff --git a/src/malloc.c b/src/malloc.c +index ecd8c9ac..da840980 100644 +--- a/src/malloc.c ++++ b/src/malloc.c +@@ -423,7 +423,7 @@ malloc_preinit(void) + + // Populate temp high ram + u32 highram_start = 0; +- u32 highram_size = BUILD_MAX_HIGHTABLE; ++ u32 highram_size = 0; + int i; + for (i=e820_count-1; i>=0; i--) { + struct e820entry *en = &e820_list[i]; +@@ -434,10 +434,14 @@ malloc_preinit(void) + continue; + u32 s = en->start, e = end; + if (!highram_start) { +- u32 newe = ALIGN_DOWN(e - highram_size, MALLOC_MIN_ALIGN); +- if (newe <= e && newe >= s) { +- highram_start = newe; +- e = newe; ++ u32 new_max = ALIGN_DOWN(e - BUILD_MAX_HIGHTABLE, MALLOC_MIN_ALIGN); ++ u32 new_min = ALIGN_DOWN(e - BUILD_MIN_HIGHTABLE, MALLOC_MIN_ALIGN); ++ if (new_max <= e && new_max >= s + BUILD_MAX_HIGHTABLE) { ++ highram_start = e = new_max; ++ highram_size = BUILD_MAX_HIGHTABLE; ++ } else if (new_min <= e && new_min >= s) { ++ highram_start = e = new_min; ++ highram_size = BUILD_MIN_HIGHTABLE; + } + } + alloc_add(&ZoneTmpHigh, s, e); +-- +2.37.3 + diff --git a/SOURCES/seabios-malloc-use-variable-for-ZoneHigh-size.patch b/SOURCES/seabios-malloc-use-variable-for-ZoneHigh-size.patch new file mode 100644 index 0000000..9742387 --- /dev/null +++ b/SOURCES/seabios-malloc-use-variable-for-ZoneHigh-size.patch @@ -0,0 +1,79 @@ +From dd4841701064e7649c0fe70db1d7f322a08215d2 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Thu, 3 Aug 2023 20:07:38 -0400 +Subject: [PATCH 1/2] malloc: use variable for ZoneHigh size + +RH-Author: Jon Maloy +RH-MergeRequest: 10: malloc: use variable for ZoneHigh size +RH-Bugzilla: 2228485 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/2] 7508668d9288ac3a2ed73802fc100c969c2e3784 (jmaloy/jmaloy-src-seabios) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2228485 +Upstream: Merged + +commit 3b91e8e9fe93d5ff7edf17f984c401f9e6ba55fe +Author: Gerd Hoffmann +Date: Mon Apr 25 09:20:02 2022 +0200 + + malloc: use variable for ZoneHigh size + + Use the variable highram_size instead of the BUILD_MAX_HIGHTABLE #define + for the ZoneHigh size. Initialize the new variable with the old #define, + so behavior does not change. + + This allows to easily adjust the ZoneHigh size at runtime in a followup + patch. + + Signed-off-by: Gerd Hoffmann + +Signed-off-by: Jon Maloy +--- + src/malloc.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/src/malloc.c b/src/malloc.c +index 3733855c..ecd8c9ac 100644 +--- a/src/malloc.c ++++ b/src/malloc.c +@@ -422,7 +422,8 @@ malloc_preinit(void) + e820_add(BUILD_BIOS_ADDR, BUILD_BIOS_SIZE, E820_RESERVED); + + // Populate temp high ram +- u32 highram = 0; ++ u32 highram_start = 0; ++ u32 highram_size = BUILD_MAX_HIGHTABLE; + int i; + for (i=e820_count-1; i>=0; i--) { + struct e820entry *en = &e820_list[i]; +@@ -432,10 +433,10 @@ malloc_preinit(void) + if (en->type != E820_RAM || end > 0xffffffff) + continue; + u32 s = en->start, e = end; +- if (!highram) { +- u32 newe = ALIGN_DOWN(e - BUILD_MAX_HIGHTABLE, MALLOC_MIN_ALIGN); ++ if (!highram_start) { ++ u32 newe = ALIGN_DOWN(e - highram_size, MALLOC_MIN_ALIGN); + if (newe <= e && newe >= s) { +- highram = newe; ++ highram_start = newe; + e = newe; + } + } +@@ -444,9 +445,9 @@ malloc_preinit(void) + + // Populate regions + alloc_add(&ZoneTmpLow, BUILD_STACK_ADDR, BUILD_EBDA_MINIMUM); +- if (highram) { +- alloc_add(&ZoneHigh, highram, highram + BUILD_MAX_HIGHTABLE); +- e820_add(highram, BUILD_MAX_HIGHTABLE, E820_RESERVED); ++ if (highram_start) { ++ alloc_add(&ZoneHigh, highram_start, highram_start + highram_size); ++ e820_add(highram_start, highram_size, E820_RESERVED); + } + } + +-- +2.37.3 + diff --git a/SPECS/seabios.spec b/SPECS/seabios.spec index 55594ac..f18f7a0 100644 --- a/SPECS/seabios.spec +++ b/SPECS/seabios.spec @@ -1,6 +1,6 @@ Name: seabios Version: 1.16.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Open-source legacy BIOS implementation Group: Applications/Emulators @@ -30,6 +30,10 @@ Patch6: seabios-pci-refactor-the-pci_config_-functions.patch Patch7: seabios-reset-force-standard-PCI-configuration-access.patch # For bz#2101787 - [rhel.8.7] Loading a kernel/initrd is sometimes very slow Patch8: seabios-virtio-blk-use-larger-default-request-size.patch +# For bz#2228485 - "No bootable device" with OS boot disk interface VirtIO-SCSI and with more than 9 VirtIO disks. [rhel-8.8.0.z] +Patch9: seabios-malloc-use-variable-for-ZoneHigh-size.patch +# For bz#2228485 - "No bootable device" with OS boot disk interface VirtIO-SCSI and with more than 9 VirtIO disks. [rhel-8.8.0.z] +Patch10: seabios-malloc-use-large-ZoneHigh-when-there-is-enough-memor.patch BuildRequires: python3 iasl ExclusiveArch: x86_64 %{power64} @@ -88,6 +92,8 @@ SeaVGABIOS is an open-source VGABIOS implementation. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build %ifarch x86_64 @@ -146,9 +152,15 @@ install -m 0644 binaries/vgabios*.bin $RPM_BUILD_ROOT%{_datadir}/seavgabios %changelog -* Tue Dec 12 2023 MSVSphere Packaging Team - 1.16.0-3 +* Tue Dec 12 2023 MSVSphere Packaging Team - 1.16.0-4.el8_8 - Rebuilt for MSVSphere 8.8 +* Tue Aug 08 2023 Jon Maloy - 1.16.0-4.el8_8 +- seabios-malloc-use-variable-for-ZoneHigh-size.patch [bz#2228485] +- seabios-malloc-use-large-ZoneHigh-when-there-is-enough-memor.patch [bz#2228485] +- Resolves: bz#2228485 + ("No bootable device" with OS boot disk interface VirtIO-SCSI and with more than 9 VirtIO disks. [rhel-8.8.0.z]) + * Wed Jul 27 2022 Miroslav Rezanina - 1.16.0-3 - seabios-virtio-blk-use-larger-default-request-size.patch [bz#2101787] - Resolves: bz#2101787