diff --git a/.gitignore b/.gitignore index 62ab0f3..c827fae 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/seabios-1.16.1.tar.gz +SOURCES/seabios-1.16.3.tar.gz diff --git a/.seabios.metadata b/.seabios.metadata index 5b15aa7..8393e09 100644 --- a/.seabios.metadata +++ b/.seabios.metadata @@ -1 +1 @@ -867440b1737356f636da206229d347e98a3dc3c2 SOURCES/seabios-1.16.1.tar.gz +391d3e99a670bff295c4b4e8ccc02c87ce908018 SOURCES/seabios-1.16.3.tar.gz diff --git a/SOURCES/config.vga-qxl b/SOURCES/config.vga-qxl deleted file mode 100644 index d393f0c..0000000 --- a/SOURCES/config.vga-qxl +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_BUILD_VGABIOS=y -CONFIG_VGA_BOCHS=y -CONFIG_VGA_PCI=y -CONFIG_OVERRIDE_PCI_ID=y -CONFIG_VGA_VID=0x1b36 -CONFIG_VGA_DID=0x0100 diff --git a/SOURCES/seabios-add-hwerr_printf-function-for-threads.patch b/SOURCES/seabios-add-hwerr_printf-function-for-threads.patch new file mode 100644 index 0000000..1064a94 --- /dev/null +++ b/SOURCES/seabios-add-hwerr_printf-function-for-threads.patch @@ -0,0 +1,87 @@ +From cc55079665ad515d663da022317e649679a7621f Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 3 May 2023 10:31:23 +0200 +Subject: [PATCH 1/2] add hwerr_printf function for threads + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 6: log error message to screen when booting with (unsupported) 4k sectors +RH-Jira: RHEL-7110 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/2] 37f3d1b45b289e4efb18817c265be2bff2606ebb (kraxel.rh/centos-src-seabios) + +Printing to the screen from threads doesn't work, because that involves +a switch to real mode for using int10h services. + +Add a string buffer and hwerr_printf() helper functions to store error +messages. Print the buffer later, after device initialization, from main +thread in case it is not empty. + +Signed-off-by: Gerd Hoffmann +--- + src/output.c | 17 +++++++++++++++++ + src/output.h | 5 +++++ + src/post.c | 4 ++++ + 3 files changed, 26 insertions(+) + +diff --git a/src/output.c b/src/output.c +index 0184444c..8c9d6b8f 100644 +--- a/src/output.c ++++ b/src/output.c +@@ -419,6 +419,23 @@ snprintf(char *str, size_t size, const char *fmt, ...) + return end - str; + } + ++char hwerror_str[512]; ++struct snprintfinfo hwerror_info = { ++ .info = { putc_str }, ++ .str = hwerror_str, ++ .end = hwerror_str + sizeof(hwerror_str) - 1, ++}; ++ ++void ++hwerr_printf(const char *fmt, ...) ++{ ++ ASSERT32FLAT(); ++ va_list args; ++ va_start(args, fmt); ++ bvprintf(&hwerror_info.info, fmt, args); ++ va_end(args); ++} ++ + // Build a formatted string - malloc'ing the memory. + char * + znprintf(size_t size, const char *fmt, ...) +diff --git a/src/output.h b/src/output.h +index 14288cf5..4548d2d4 100644 +--- a/src/output.h ++++ b/src/output.h +@@ -16,6 +16,11 @@ char * znprintf(size_t size, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); + void __dprintf(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); ++ ++extern char hwerror_str[512]; ++void hwerr_printf(const char *fmt, ...) ++ __attribute__ ((format (printf, 1, 2))); ++ + struct bregs; + void __debug_enter(struct bregs *regs, const char *fname); + void __debug_isr(const char *fname); +diff --git a/src/post.c b/src/post.c +index f93106a1..3e85da43 100644 +--- a/src/post.c ++++ b/src/post.c +@@ -216,6 +216,10 @@ maininit(void) + device_hardware_setup(); + wait_threads(); + } ++ if (hwerror_str[0]) ++ printf("\n" ++ "hardware setup errors:\n" ++ "%s", hwerror_str); + + // Run option roms + optionrom_setup(); +-- +2.39.3 + diff --git a/SOURCES/seabios-display-error-message-for-blocksizes-512.patch b/SOURCES/seabios-display-error-message-for-blocksizes-512.patch new file mode 100644 index 0000000..f298c33 --- /dev/null +++ b/SOURCES/seabios-display-error-message-for-blocksizes-512.patch @@ -0,0 +1,52 @@ +From 93138b258a2c77ec1df8768bac0853595cc869ca Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 3 May 2023 10:36:32 +0200 +Subject: [PATCH 2/2] display error message for blocksizes != 512 + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 6: log error message to screen when booting with (unsupported) 4k sectors +RH-Jira: RHEL-7110 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [2/2] f4cdc59a968ed2cb795d0b7c357522423a16f4a2 (kraxel.rh/centos-src-seabios) + +This actually happens in case users try to use 4k sectors with seabios. +Printing the error to the screen instead of only the debug log helps +users to figure why their guest doesn't boot. + +Signed-off-by: Gerd Hoffmann +--- + src/hw/blockcmd.c | 2 +- + src/hw/virtio-blk.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c +index 6b6fea97..ff88680b 100644 +--- a/src/hw/blockcmd.c ++++ b/src/hw/blockcmd.c +@@ -336,7 +336,7 @@ scsi_drive_setup(struct drive_s *drive, const char *s, int prio) + // 64-bit LBA anyway. + drive->blksize = be32_to_cpu(capdata.blksize); + if (drive->blksize != DISK_SECTOR_SIZE) { +- dprintf(1, "%s: unsupported block size %d\n", s, drive->blksize); ++ hwerr_printf("%s: unsupported block size %d\n", s, drive->blksize); + return -1; + } + drive->sectors = (u64)be32_to_cpu(capdata.sectors) + 1; +diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c +index 137a2c3c..1d6f7d4b 100644 +--- a/src/hw/virtio-blk.c ++++ b/src/hw/virtio-blk.c +@@ -193,8 +193,8 @@ init_virtio_blk(void *data) + vdrive->drive.blksize = DISK_SECTOR_SIZE; + } + if (vdrive->drive.blksize != DISK_SECTOR_SIZE) { +- dprintf(1, "virtio-blk %pP block size %d is unsupported\n", +- pci, vdrive->drive.blksize); ++ hwerr_printf("virtio-blk %pP block size %d is unsupported\n", ++ pci, vdrive->drive.blksize); + goto fail; + } + dprintf(3, "virtio-blk %pP blksize=%d sectors=%u size_max=%u " +-- +2.39.3 + diff --git a/SOURCES/seabios-pciinit-don-t-misalign-large-BARs.patch b/SOURCES/seabios-pciinit-don-t-misalign-large-BARs.patch new file mode 100644 index 0000000..b53d0fc --- /dev/null +++ b/SOURCES/seabios-pciinit-don-t-misalign-large-BARs.patch @@ -0,0 +1,59 @@ +From 638fdc27d742ea45fc51a9b17fc4799c4edb6b17 Mon Sep 17 00:00:00 2001 +From: Daniil Tatianin +Date: Thu, 11 Apr 2024 22:51:35 +0300 +Subject: [PATCH] pciinit: don't misalign large BARs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 13: pciinit: don't misalign large BARs +RH-Jira: RHEL-68955 +RH-Acked-by: Luigi Leonardi +RH-Acked-by: Oliver Steffen +RH-Commit: [1/1] 5761e0038bc6e301a59e99af1ada3304623c031b + +Previously we would unconditionally lower the alignment for large BARs +in case their alignment was greater than "pci_mem64_top >> 11", this +would make it impossible to use these devices by the kernel: + [ 13.821108] pci 0000:9c:00.0: can't claim BAR 1 [mem 0x66000000000-0x67fffffffff 64bit pref]: no compatible bridge window + [ 13.823492] pci 0000:9d:00.0: can't claim BAR 1 [mem 0x64000000000-0x65fffffffff 64bit pref]: no compatible bridge window + [ 13.824218] pci 0000:9e:00.0: can't claim BAR 1 [mem 0x62000000000-0x63fffffffff 64bit pref]: no compatible bridge window + [ 13.828322] pci 0000:8a:00.0: can't claim BAR 1 [mem 0x6e000000000-0x6ffffffffff 64bit pref]: no compatible bridge window + [ 13.830691] pci 0000:8b:00.0: can't claim BAR 1 [mem 0x6c000000000-0x6dfffffffff 64bit pref]: no compatible bridge window + [ 13.832218] pci 0000:8c:00.0: can't claim BAR 1 [mem 0x6a000000000-0x6bfffffffff 64bit pref]: no compatible bridge window + +Fix it by only overwriting the alignment in case it's actually greater +than the desired by the BAR window. + +Fixes: 96a8d130a8c ("be less conservative with the 64bit pci io window") +Signed-off-by: Daniil Tatianin +Reviewed-by: Gerd Hoffmann +Reviewed-by: Philippe Mathieu-Daudé +(cherry picked from commit e5f2e4c69643bc3cd385306a9e5d29e11578148c) +Resolves: RHEL-68955 +--- + src/fw/pciinit.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c +index 6b13cd5b..bb44dc29 100644 +--- a/src/fw/pciinit.c ++++ b/src/fw/pciinit.c +@@ -970,9 +970,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) + int resource_optional = 0; + if (hotplug_support == HOTPLUG_PCIE) + resource_optional = pcie_cap && (type == PCI_REGION_TYPE_IO); ++ ++ u64 top_align = pci_mem64_top >> 11; + if (hotplug_support && pci_pad_mem64 && is64 +- && (type == PCI_REGION_TYPE_PREFMEM)) +- align = pci_mem64_top >> 11; ++ && (type == PCI_REGION_TYPE_PREFMEM) && (top_align > align)) ++ align = top_align; + if (align > sum && hotplug_support && !resource_optional) + sum = align; /* reserve min size for hot-plug */ + if (size > sum) { +-- +2.39.3 + diff --git a/SPECS/seabios.spec b/SPECS/seabios.spec index 882c638..e757ed7 100644 --- a/SPECS/seabios.spec +++ b/SPECS/seabios.spec @@ -1,21 +1,26 @@ Name: seabios -Version: 1.16.1 -Release: 1%{?dist} +Version: 1.16.3 +Release: 2%{?dist}.1 Summary: Open-source legacy BIOS implementation License: LGPLv3 URL: https://www.coreboot.org/SeaBIOS -Source0: https://code.coreboot.org/p/seabios/downloads/get/seabios-1.16.1.tar.gz +Source0: https://code.coreboot.org/p/seabios/downloads/get/seabios-1.16.3.tar.gz Source10: config.vga-cirrus -Source12: config.vga-qxl Source13: config.vga-stdvga Source18: config.seabios-256k Source19: config.vga-virtio Source20: config.vga-ramfb Source21: config.vga-bochs-display +# For RHEL-7110 - [seabios] Can't boot from a disk with 4K sector size +Patch1: seabios-add-hwerr_printf-function-for-threads.patch +# For RHEL-7110 - [seabios] Can't boot from a disk with 4K sector size +Patch2: seabios-display-error-message-for-blocksizes-512.patch +# For RHEL-68955 - amdgpu failed to initialize when multiple AMD MI210 GPUs assigned and firmware is seabios [rhel-9.5.z] +Patch3: seabios-pciinit-don-t-misalign-large-BARs.patch BuildRequires: make BuildRequires: gcc @@ -105,7 +110,7 @@ build_bios %{_sourcedir}/config.seabios-256k bios.bin bios-256k.bin # seavgabios -%global vgaconfigs cirrus qxl stdvga virtio ramfb bochs-display +%global vgaconfigs cirrus stdvga virtio ramfb bochs-display for config in %{vgaconfigs}; do build_bios %{_sourcedir}/config.vga-${config} \ vgabios.bin vgabios-${config}.bin out/vgabios.bin @@ -132,7 +137,26 @@ install -m 0644 binaries/vgabios*.bin $RPM_BUILD_ROOT%{_datadir}/seavgabios %{_datadir}/seavgabios/vgabios*.bin %changelog -* Wed Mar 15 2023 MSVSphere Packaging Team - 1.16.0-4 +* Thu Nov 28 2024 Miroslav Rezanina - 1.16.3-2.el9_5.1 +- seabios-pciinit-don-t-misalign-large-BARs.patch [RHEL-68955] +- Resolves: RHEL-68955 + (amdgpu failed to initialize when multiple AMD MI210 GPUs assigned and firmware is seabios [rhel-9.5.z]) + +* Wed Jan 10 2024 Miroslav Rezanina - 1.16.3-2 +- seabios-add-hwerr_printf-function-for-threads.patch [RHEL-7110] +- seabios-display-error-message-for-blocksizes-512.patch [RHEL-7110] +- Resolves: RHEL-7110 + ([seabios] Can't boot from a disk with 4K sector size) + +* Wed Dec 13 2023 Miroslav Rezanina - 1.16.3-1 +- Rebase to 1.16.3 [RHEL-19239] +- Removed vgabios-qxl.bin [RHEL-383] +- Resolves: RHEL-19239 + (Rebase seabios to 1.16.3) +- Resolves: RHEL-383 + (remove vgabios-qxl.bin from seavgabios in rhel9) + +* Wed Mar 15 2023 MSVSphere Packaging Team - 1.16.1-1 - Rebuilt for MSVSphere 9.1. * Wed Dec 07 2022 Miroslav Rezanina - 1.16.1-1