summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2021-04-14 21:42:57 +0100
committerSteve McIntyre <steve@einval.com>2021-04-14 21:46:16 +0100
commit8d2bea5ad9b6c5bcd01693cce6f464a45a8d529f (patch)
tree11cec4786b809a829953d700cfd102381a9df8c0
parentf81081d61b7a34858e967c262a12b39b81c2cd42 (diff)
downloadefi-boot-shim-8d2bea5ad9b6c5bcd01693cce6f464a45a8d529f.tar.gz
efi-boot-shim-8d2bea5ad9b6c5bcd01693cce6f464a45a8d529f.zip
allocate MOK config table as BootServicesData
Another patch from upstream, needed with newer kernels on x86
-rw-r--r--debian/changelog10
-rw-r--r--debian/patches/MOK-BootServicesData.patch34
-rw-r--r--debian/patches/series1
3 files changed, 40 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index eaa5619f..199fc432 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
shim (15.4-1) unstable; urgency=medium
- * New upstream release fixing more bugs: SBAT and arm64 support.
- * Print sha256 checksums of the EFI binaries when the build is done,
- for easier comparison between builds.
- * Override dh_auto_build setting INSTALL, cut down on build noise.
- * Add one more patch from upstream to fix i386 binary relocations
+ * New upstream release fixing more bugs: SBAT and arm64 support
+ * Print sha256 checksums of the EFI binaries when the build is done
+ * Add two patches from upstream:
+ + fix i386 binary relocations
+ + allocate MOK config table as BootServicesData
-- Steve McIntyre <93sam@debian.org> Wed, 31 Mar 2021 18:25:00 +0100
diff --git a/debian/patches/MOK-BootServicesData.patch b/debian/patches/MOK-BootServicesData.patch
new file mode 100644
index 00000000..948b89b9
--- /dev/null
+++ b/debian/patches/MOK-BootServicesData.patch
@@ -0,0 +1,34 @@
+commit 4068fd42c891ea6ebdec056f461babc6e4048844
+Author: Gary Lin <glin@suse.com>
+Date: Thu Apr 8 16:23:03 2021 +0800
+
+ mok: allocate MOK config table as BootServicesData
+
+ Linux kernel is picky when reserving the memory for x86 and it only
+ expects BootServicesData:
+
+ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/platform/efi/quirks.c?h=v5.11#n254
+
+ Otherwise, the following error would show during system boot:
+
+ Apr 07 12:31:56.743925 localhost kernel: efi: Failed to lookup EFI memory descriptor for 0x000000003dcf8000
+
+ Although BootServicesData would be reclaimed after ExitBootService(),
+ linux kernel reserves MOK config table when it detects the existence of
+ the table, so it's fine to allocate the table as BootServicesData.
+
+ Signed-off-by: Gary Lin <glin@suse.com>
+
+diff --git a/mok.c b/mok.c
+index 9e37d6ab..9b8fc2bc 100644
+--- a/mok.c
++++ b/mok.c
+@@ -999,7 +999,7 @@ EFI_STATUS import_mok_state(EFI_HANDLE image_handle)
+ npages = ALIGN_VALUE(config_sz, PAGE_SIZE) >> EFI_PAGE_SHIFT;
+ config_table = NULL;
+ efi_status = gBS->AllocatePages(AllocateAnyPages,
+- EfiRuntimeServicesData,
++ EfiBootServicesData,
+ npages,
+ (EFI_PHYSICAL_ADDRESS *)&config_table);
+ if (EFI_ERROR(efi_status) || !config_table) {
diff --git a/debian/patches/series b/debian/patches/series
index 1787a583..6e64743f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
fix-broken-ia32-reloc.patch
+MOK-BootServicesData.patch