File shim-bsc1184454-allocate-mok-config-table-BS.patch of Package shim
40
1
From 33ca95024aa7e33218da5882d30b3ec690a11046 Mon Sep 17 00:00:00 2001
2
From: Gary Lin <glin@suse.com>
3
Date: Thu, 8 Apr 2021 16:23:03 +0800
4
Subject: [PATCH] mok: allocate MOK config table as BootServicesData
5
6
Linux kernel is picky when reserving the memory for x86 and it only
7
expects BootServicesData:
8
9
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/platform/efi/quirks.c?h=v5.11#n254
10
11
Otherwise, the following error would show during system boot:
12
13
Apr 07 12:31:56.743925 localhost kernel: efi: Failed to lookup EFI memory descriptor for 0x000000003dcf8000
14
15
Although BootServicesData would be reclaimed after ExitBootService(),
16
linux kernel reserves MOK config table when it detects the existence of
17
the table, so it's fine to allocate the table as BootServicesData.
18
19
Signed-off-by: Gary Lin <glin@suse.com>
20
---
21
mok.c | 2 +-
22
1 file changed, 1 insertion(+), 1 deletion(-)
23
24
diff --git a/mok.c b/mok.c
25
index 5ad9072b..fc1ee04d 100644
26
--- a/mok.c
27
+++ b/mok.c
28
29
npages = ALIGN_VALUE(config_sz, PAGE_SIZE) >> EFI_PAGE_SHIFT;
30
config_table = NULL;
31
efi_status = gBS->AllocatePages(AllocateAnyPages,
32
- EfiRuntimeServicesData,
33
+ EfiBootServicesData,
34
npages,
35
(EFI_PHYSICAL_ADDRESS *)&config_table);
36
if (EFI_ERROR(efi_status) || !config_table) {
37
--
38
2.29.2
39
40