History

Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/core

More EFI updates for v5.7 - Incorporate a stable branch with the EFI pieces of Hans's work on loading device firmware from EFI boot service memory regions

Ingo Molnar committed 6 years ago

Commit 3be5f0d2 parents c98a76e f0df68d8 files · +264 −0Browse files

Showing the changes to include/linux (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/efi.h +7 −0
  2. include/linux/efi_embedded_fw.h +41 −0
include/linux/efi.h+7−0
@@ -775,6 +775,7 @@ extern int __init efi_setup_pcdp_console(char *); · 774 unmodified lines
775775 #define EFI_NX_PE_DATA 9 /* Can runtime data regions be mapped non-executable? */
776776 #define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
777777 #define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */
778+#define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */
778779
779780 #ifdef CONFIG_EFI
780781 /*
@@ -1097,6 +1098,12 @@ static inline void · 316 unmodified lines
10971098 efi_enable_reset_attack_mitigation(void) { }
10981099 #endif
10991100
1101+#ifdef CONFIG_EFI_EMBEDDED_FIRMWARE
1102+void efi_check_for_embedded_firmwares(void);
1103+#else
1104+static inline void efi_check_for_embedded_firmwares(void) { }
1105+#endif
1106+
11001107 efi_status_t efi_random_get_seed(void);
11011108
11021109 void efi_retrieve_tpm2_eventlog(void);
include/linux/efi_embedded_fw.h+41−0
@@ -0,0 +1,41 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_EFI_EMBEDDED_FW_H
3+#define _LINUX_EFI_EMBEDDED_FW_H
4+
5+#include <linux/list.h>
6+#include <linux/mod_devicetable.h>
7+
8+#define EFI_EMBEDDED_FW_PREFIX_LEN 8
9+
10+/*
11+ * This struct and efi_embedded_fw_list are private to the efi-embedded fw
12+ * implementation they are in this header for use by lib/test_firmware.c only!
13+ */
14+struct efi_embedded_fw {
15+ struct list_head list;
16+ const char *name;
17+ const u8 *data;
18+ size_t length;
19+};
20+
21+extern struct list_head efi_embedded_fw_list;
22+
23+/**
24+ * struct efi_embedded_fw_desc - This struct is used by the EFI embedded-fw
25+ * code to search for embedded firmwares.
26+ *
27+ * @name: Name to register the firmware with if found
28+ * @prefix: First 8 bytes of the firmware
29+ * @length: Length of the firmware in bytes including prefix
30+ * @sha256: SHA256 of the firmware
31+ */
32+struct efi_embedded_fw_desc {
33+ const char *name;
34+ u8 prefix[EFI_EMBEDDED_FW_PREFIX_LEN];
35+ u32 length;
36+ u8 sha256[32];
37+};
38+
39+int efi_get_embedded_fw(const char *name, const u8 **dat, size_t *sz);
40+
41+#endif