Update to 1.15.0

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2021-12-08 12:00:42 +01:00
parent b80f87f266
commit 36c783deac
7 changed files with 7 additions and 293 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ seabios-0.6.0.tar.gz
/seabios-1.12.1.tar.xz
/seabios-1.13.0.tar.gz
/seabios-1.14.0.tar.gz
/seabios-1.15.0.tar.gz

View File

@ -1,44 +0,0 @@
From cd088ce3bc68a6986637c0cd77b94ebff729b89b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 19 Apr 2016 11:27:50 +0200
Subject: redhat: reserve more memory on fseg
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <1461065271-22039-2-git-send-email-kraxel@redhat.com>
Patchwork-id: 70213
O-Subject: [RHEL-7.1 seabios PATCH 1/2] redhat: reserve more memory on fseg
Bugzilla: 1327060
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Marcel Apfelbaum <marcel@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
seabios 1.7.5 has about 8k free space in fseg.
configure 1.9.1 to keep the same amout space in fseg, so the amout of
disks we are able to handle stays roughly the same. ahci + scsi are
slightly below the 1.7.5 numbers but stay above the documented limits.
virtio-block numbers are higher than the 1.7.5 numbers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
(cherry picked from commit 0561b82b0470679505d62f49eec83adb01eec0ab)
---
scripts/layoutrom.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
index 6616721..71841aa 100755
--- a/scripts/layoutrom.py
+++ b/scripts/layoutrom.py
@@ -66,7 +66,7 @@ BUILD_BIOS_SIZE = 0x10000
BUILD_ROM_START = 0xc0000
BUILD_LOWRAM_END = 0xa0000
# Space to reserve in f-segment for dynamic allocations
-BUILD_MIN_BIOSTABLE = 2048
+BUILD_MIN_BIOSTABLE = 8192
# Layout the 16bit code. This ensures sections with fixed offset
# requirements are placed in the correct location. It also places the
--
1.8.3.1

View File

@ -1,80 +0,0 @@
From c021d44d0d4915a2b152d29abde5f1d4cb7b8ddd Mon Sep 17 00:00:00 2001
From: Alexander Graf <graf@amazon.com>
Date: Wed, 30 Sep 2020 23:10:53 +0200
Subject: [PATCH] nvme: Record maximum allowed request size
NVMe has a limit on how many sectors it can handle at most within a single
request. Remember that number, so that in a follow-up patch, we can verify
that we don't exceed it.
Signed-off-by: Alexander Graf <graf@amazon.com>
(cherry picked from commit b68f313c9139e480a9f5a0d1b5aa6f294b86d982)
---
src/hw/nvme-int.h | 8 +++++++-
src/hw/nvme.c | 13 +++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/hw/nvme-int.h b/src/hw/nvme-int.h
index 9f95dd8..674008a 100644
--- a/src/hw/nvme-int.h
+++ b/src/hw/nvme-int.h
@@ -117,6 +117,7 @@ struct nvme_namespace {
u32 block_size;
u32 metadata_size;
+ u32 max_req_size;
/* Page aligned buffer of size NVME_PAGE_SIZE. */
char *dma_buffer;
@@ -131,7 +132,12 @@ struct nvme_identify_ctrl {
char mn[40];
char fr[8];
- char _boring[516 - 72];
+ u8 rab;
+ u8 ieee[3];
+ u8 cmic;
+ u8 mdts;
+
+ char _boring[516 - 78];
u32 nn; /* number of namespaces */
};
diff --git a/src/hw/nvme.c b/src/hw/nvme.c
index 6a01204..5bc2586 100644
--- a/src/hw/nvme.c
+++ b/src/hw/nvme.c
@@ -238,7 +238,8 @@ nvme_admin_identify_ns(struct nvme_ctrl *ctrl, u32 ns_id)
}
static void
-nvme_probe_ns(struct nvme_ctrl *ctrl, struct nvme_namespace *ns, u32 ns_id)
+nvme_probe_ns(struct nvme_ctrl *ctrl, struct nvme_namespace *ns, u32 ns_id,
+ u8 mdts)
{
ns->ctrl = ctrl;
ns->ns_id = ns_id;
@@ -281,6 +282,14 @@ nvme_probe_ns(struct nvme_ctrl *ctrl, struct nvme_namespace *ns, u32 ns_id)
ns->drive.blksize = ns->block_size;
ns->drive.sectors = ns->lba_count;
+ if (mdts) {
+ ns->max_req_size = ((1U << mdts) * NVME_PAGE_SIZE) / ns->block_size;
+ dprintf(3, "NVME NS %u max request size: %d sectors\n",
+ ns_id, ns->max_req_size);
+ } else {
+ ns->max_req_size = -1U;
+ }
+
ns->dma_buffer = zalloc_page_aligned(&ZoneHigh, NVME_PAGE_SIZE);
char *desc = znprintf(MAXDESCSIZE, "NVMe NS %u: %llu MiB (%llu %u-byte "
@@ -567,7 +576,7 @@ nvme_controller_enable(struct nvme_ctrl *ctrl)
/* Populate namespace IDs */
int ns_idx;
for (ns_idx = 0; ns_idx < ctrl->ns_count; ns_idx++) {
- nvme_probe_ns(ctrl, &ctrl->ns[ns_idx], ns_idx + 1);
+ nvme_probe_ns(ctrl, &ctrl->ns[ns_idx], ns_idx + 1, identify->mdts);
}
dprintf(3, "NVMe initialization complete!\n");

View File

@ -1,123 +0,0 @@
From f2522cde64a70ea215826052b4cabeda84f0cace Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 26 May 2021 09:32:10 +0200
Subject: [PATCH] nvme: improve namespace allocation
Instead of allocating a big array upfront go probe the namespaces and
only allocate an nvme_namespace struct for those namespaces which are
actually active.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 9bb1203b359dff5b36e8e6d0afcfc6fc2c1f8e78)
---
src/hw/nvme-int.h | 1 -
src/hw/nvme.c | 40 ++++++++++++++++------------------------
2 files changed, 16 insertions(+), 25 deletions(-)
diff --git a/src/hw/nvme-int.h b/src/hw/nvme-int.h
index 674008a..7cade8c 100644
--- a/src/hw/nvme-int.h
+++ b/src/hw/nvme-int.h
@@ -101,7 +101,6 @@ struct nvme_ctrl {
struct nvme_cq admin_cq;
u32 ns_count;
- struct nvme_namespace *ns;
struct nvme_sq io_sq;
struct nvme_cq io_cq;
diff --git a/src/hw/nvme.c b/src/hw/nvme.c
index 5bc2586..7910b15 100644
--- a/src/hw/nvme.c
+++ b/src/hw/nvme.c
@@ -238,11 +238,9 @@ nvme_admin_identify_ns(struct nvme_ctrl *ctrl, u32 ns_id)
}
static void
-nvme_probe_ns(struct nvme_ctrl *ctrl, struct nvme_namespace *ns, u32 ns_id,
- u8 mdts)
+nvme_probe_ns(struct nvme_ctrl *ctrl, u32 ns_idx, u8 mdts)
{
- ns->ctrl = ctrl;
- ns->ns_id = ns_id;
+ u32 ns_id = ns_idx + 1;
struct nvme_identify_ns *id = nvme_admin_identify_ns(ctrl, ns_id);
if (!id) {
@@ -258,12 +256,21 @@ nvme_probe_ns(struct nvme_ctrl *ctrl, struct nvme_namespace *ns, u32 ns_id,
goto free_buffer;
}
- ns->lba_count = id->nsze;
- if (!ns->lba_count) {
+ if (!id->nsze) {
dprintf(2, "NVMe NS %u is inactive.\n", ns_id);
goto free_buffer;
}
+ struct nvme_namespace *ns = malloc_fseg(sizeof(*ns));
+ if (!ns) {
+ warn_noalloc();
+ goto free_buffer;
+ }
+ memset(ns, 0, sizeof(*ns));
+ ns->ctrl = ctrl;
+ ns->ns_id = ns_id;
+ ns->lba_count = id->nsze;
+
struct nvme_lba_format *fmt = &id->lbaf[current_lba_format];
ns->block_size = 1U << fmt->lbads;
@@ -273,10 +280,11 @@ nvme_probe_ns(struct nvme_ctrl *ctrl, struct nvme_namespace *ns, u32 ns_id,
/* If we see devices that trigger this path, we need to increase our
buffer size. */
warn_internalerror();
+ free(ns);
goto free_buffer;
}
- ns->drive.cntl_id = ns - ctrl->ns;
+ ns->drive.cntl_id = ns_idx;
ns->drive.removable = 0;
ns->drive.type = DTYPE_NVME;
ns->drive.blksize = ns->block_size;
@@ -466,13 +474,6 @@ nvme_create_io_queues(struct nvme_ctrl *ctrl)
return -1;
}
-static void
-nvme_destroy_io_queues(struct nvme_ctrl *ctrl)
-{
- nvme_destroy_sq(&ctrl->io_sq);
- nvme_destroy_cq(&ctrl->io_cq);
-}
-
/* Waits for CSTS.RDY to match rdy. Returns 0 on success. */
static int
nvme_wait_csts_rdy(struct nvme_ctrl *ctrl, unsigned rdy)
@@ -566,24 +567,15 @@ nvme_controller_enable(struct nvme_ctrl *ctrl)
goto err_destroy_admin_sq;
}
- ctrl->ns = malloc_fseg(sizeof(*ctrl->ns) * ctrl->ns_count);
- if (!ctrl->ns) {
- warn_noalloc();
- goto err_destroy_ioq;
- }
- memset(ctrl->ns, 0, sizeof(*ctrl->ns) * ctrl->ns_count);
-
/* Populate namespace IDs */
int ns_idx;
for (ns_idx = 0; ns_idx < ctrl->ns_count; ns_idx++) {
- nvme_probe_ns(ctrl, &ctrl->ns[ns_idx], ns_idx + 1, identify->mdts);
+ nvme_probe_ns(ctrl, ns_idx, identify->mdts);
}
dprintf(3, "NVMe initialization complete!\n");
return 0;
- err_destroy_ioq:
- nvme_destroy_io_queues(ctrl);
err_destroy_admin_sq:
nvme_destroy_sq(&ctrl->admin_sq);
err_destroy_admin_cq:

View File

@ -1,39 +0,0 @@
From 6eff8085980dba0938cea0193b8a0fd3c6b0c4ca Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Thu, 20 May 2021 23:18:48 +0100
Subject: [PATCH] vgasrc: ignore .node.gnu.property (binutils-2.36 support)
Modern binutils unconditionally tracks x86_64 ISA levels in intermediate
files in .note.gnu.property. Custom liker script does not handle the
section and complains about it:
ld --gc-sections -T out/vgasrc/vgalayout.lds out/vgaccode16.o \
out/vgaentry.o out/vgaversion.o -o out/vgarom.o
ld: section .note.gnu.property LMA [0000000000000000,0000000000000027] \
overlaps section .text LMA [0000000000000000,00000000000098af]
The change ignores .note* sections.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
vgasrc/vgalayout.lds.S | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/vgasrc/vgalayout.lds.S b/vgasrc/vgalayout.lds.S
index 533734d..c3e4f60 100644
--- a/vgasrc/vgalayout.lds.S
+++ b/vgasrc/vgalayout.lds.S
@@ -19,5 +19,12 @@ SECTIONS
// Discard regular data sections to force a link error if
// 16bit code attempts to access data not marked with VAR16.
- /DISCARD/ : { *(.text*) *(.rodata*) *(.data*) *(.bss*) *(COMMON) }
+ /DISCARD/ : {
+ *(.text*)
+ *(.rodata*)
+ *(.data*)
+ *(.bss*)
+ *(COMMON)
+ *(.note*)
+ }
}

View File

@ -3,8 +3,8 @@
%endif
Name: seabios
Version: 1.14.0
Release: 6%{?dist}
Version: 1.15.0
Release: 1%{?dist}
Summary: Open-source legacy BIOS implementation
License: LGPLv3
@ -13,11 +13,7 @@ URL: http://www.coreboot.org/SeaBIOS
Source0: http://code.coreboot.org/p/seabios/downloads/get/%{name}-%{version}.tar.gz
Patch0001: 0001-Workaround-for-a-win8.1-32-S4-resume-bug.patch
Patch0002: 0002-reserve-more-memory-on-fseg.patch
Patch0003: 0003-vgabios-Reorder-video-modes-to-work-around-a-Windows.patch
Patch0004: 0004-nvme-Record-maximum-allowed-request-size.patch
Patch0005: 0005-nvme-improve-namespace-allocation.patch
Patch0006: 0006-vgasrc-ignore-.node.gnu.property-binutils-2.36-suppo.patch
Source10: config.vga-cirrus
Source11: config.vga-isavga
@ -164,6 +160,9 @@ install -m 0644 binaries/vgabios*.bin $RPM_BUILD_ROOT%{_datadir}/seavgabios
%changelog
* Wed Dec 08 2021 Gerd Hoffmann <kraxel@redhat.com> - 1.15.0-1
- Update to 1.15.0
* Thu Oct 07 2021 Cole Robinson <crobinso@redhat.com> - 1.14.0-6
- Fix build with binutils 2.36

View File

@ -1 +1 @@
SHA512 (seabios-1.14.0.tar.gz) = 215c42f59425f8abd062be7b11fc0e39c977cee5001a2381551b0f851ac337d0dd53c065267e6dee0e710ffd700fa635f9007b89da8dfce0f47122c984ee8146
SHA512 (seabios-1.15.0.tar.gz) = f894025043aab7d9b0f513216f7abc99904405838632c48b2f0e9c0c09533022cfdef9216082814a941ab0d513d1b02d3b103133ab3aba0fd0f82e96138125fc