History

Merge tag 'efi-next-for-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull more EFI updates from Ard Biesheuvel: "Follow-up tweaks for EFI changes - they mostly address issues introduced this merge window, except for Heinrich's patch: - fix new DXE service invocations for mixed mode - use correct Kconfig symbol when setting PE header flag - clean up the drivers/firmware/efi Kconfig dependencies so that features that depend on CONFIG_EFI are hidden from the UI when the symbol is not enabled. Also included is a RISC-V bugfix from Heinrich to avoid read-write mappings of read-only firmware regions in the EFI page tables" * tag 'efi-next-for-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: clean up Kconfig dependencies on CONFIG_EFI efi/x86: libstub: Make DXE calls mixed mode safe efi: x86: Fix config name for setting the NX-compatibility flag in the PE header riscv: read-only pages should not be writable

Linus Torvalds committed 4 years ago

Commit 93ce7942 parents 9be4cbd 75ed63d6 files · +38 −34Browse files

Unified · Split

6 files
  1. arch/riscv/kernel/efi.c +1 −1
  2. arch/x86/boot/header.S +1 −1
  3. arch/x86/include/asm/efi.h +9 −0
  4. drivers/firmware/Makefile +1 −2
  5. drivers/firmware/efi/Kconfig +24 −28
  6. drivers/firmware/efi/libstub/x86-stub.c +2 −2
arch/riscv/kernel/efi.c+1−1
@@ -65,7 +65,7 @@ static int __init set_permissions(pte_t *ptep, unsigned long addr, void *data) · 64 unmodified lines
6565
6666 if (md->attribute & EFI_MEMORY_RO) {
6767 val = pte_val(pte) & ~_PAGE_WRITE;
68− val = pte_val(pte) | _PAGE_READ;
68+ val |= _PAGE_READ;
6969 pte = __pte(val);
7070 }
7171 if (md->attribute & EFI_MEMORY_XP) {
arch/x86/boot/header.S+1−1
@@ -163,7 +163,7 @@ extra_header_fields: · 162 unmodified lines
163163 .long 0x200 # SizeOfHeaders
164164 .long 0 # CheckSum
165165 .word IMAGE_SUBSYSTEM_EFI_APPLICATION # Subsystem (EFI application)
166−#ifdef CONFIG_DXE_MEM_ATTRIBUTES
166+#ifdef CONFIG_EFI_DXE_MEM_ATTRIBUTES
167167 .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics
168168 #else
169169 .word 0 # DllCharacteristics
arch/x86/include/asm/efi.h+9−0
@@ -270,6 +270,8 @@ static inline u32 efi64_convert_status(efi_status_t status) · 269 unmodified lines
270270 return (u32)(status | (u64)status >> 32);
271271 }
272272
273+#define __efi64_split(val) (val) & U32_MAX, (u64)(val) >> 32
274+
273275 #define __efi64_argmap_free_pages(addr, size) \
274276 ((addr), 0, (size))
275277
@@ -317,6 +319,13 @@ static inline u32 efi64_convert_status(efi_status_t status) · 41 unmodified lines
317319 #define __efi64_argmap_hash_log_extend_event(prot, fl, addr, size, ev) \
318320 ((prot), (fl), 0ULL, (u64)(addr), 0ULL, (u64)(size), 0ULL, ev)
319321
322+/* DXE services */
323+#define __efi64_argmap_get_memory_space_descriptor(phys, desc) \
324+ (__efi64_split(phys), (desc))
325+
326+#define __efi64_argmap_set_memory_space_descriptor(phys, size, flags) \
327+ (__efi64_split(phys), __efi64_split(size), __efi64_split(flags))
328+
320329 /*
321330 * The macros below handle the plumbing for the argument mapping. To add a
322331 * mapping for a specific EFI method, simply define a macro
drivers/firmware/Makefile+1−2
@@ -32,8 +32,7 @@ obj-y += broadcom/ · 31 unmodified lines
3232 obj-y += cirrus/
3333 obj-y += meson/
3434 obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
35−obj-$(CONFIG_EFI) += efi/
36−obj-$(CONFIG_UEFI_CPER) += efi/
35+obj-y += efi/
3736 obj-y += imx/
3837 obj-y += psci/
3938 obj-y += smccc/
drivers/firmware/efi/Kconfig+24−28
@@ -193,6 +193,9 @@ config EFI_TEST · 192 unmodified lines
193193 Say Y here to enable the runtime services support via /dev/efi_test.
194194 If unsure, say N.
195195
196+config EFI_DEV_PATH_PARSER
197+ bool
198+
196199 config APPLE_PROPERTIES
197200 bool "Apple Device Properties"
198201 depends on EFI_STUB && X86
@@ -255,40 +258,15 @@ config EFI_DISABLE_PCI_DMA · 56 unmodified lines
255258 options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
256259 may be used to override this option.
257260
258−endmenu
259−
260−config EFI_EMBEDDED_FIRMWARE
261− bool
262− depends on EFI
263− select CRYPTO_LIB_SHA256
264−
265−config UEFI_CPER
266− bool
267−
268−config UEFI_CPER_ARM
269− bool
270− depends on UEFI_CPER && ( ARM || ARM64 )
271− default y
272−
273−config UEFI_CPER_X86
274− bool
275− depends on UEFI_CPER && X86
276− default y
277−
278−config EFI_DEV_PATH_PARSER
279− bool
280− depends on ACPI
281− default n
282−
283261 config EFI_EARLYCON
284262 def_bool y
285− depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
263+ depends on SERIAL_EARLYCON && !ARM && !IA64
286264 select FONT_SUPPORT
287265 select ARCH_USE_MEMREMAP_PROT
288266
289267 config EFI_CUSTOM_SSDT_OVERLAYS
290268 bool "Load custom ACPI SSDT overlay from an EFI variable"
291− depends on EFI && ACPI
269+ depends on ACPI
292270 default ACPI_TABLE_UPGRADE
293271 help
294272 Allow loading of an ACPI SSDT overlay from an EFI variable specified
@@ -314,7 +292,6 @@ config EFI_DISABLE_RUNTIME · 19 unmodified lines
314292
315293 config EFI_COCO_SECRET
316294 bool "EFI Confidential Computing Secret Area Support"
317− depends on EFI
318295 help
319296 Confidential Computing platforms (such as AMD SEV) allow the
320297 Guest Owner to securely inject secrets during guest VM launch.
@@ -327,3 +304,22 @@ config EFI_COCO_SECRET · 6 unmodified lines
327304 for usage inside the kernel. This will allow the
328305 virt/coco/efi_secret module to access the secrets, which in turn
329306 allows userspace programs to access the injected secrets.
307+
308+config EFI_EMBEDDED_FIRMWARE
309+ bool
310+ select CRYPTO_LIB_SHA256
311+
312+endmenu
313+
314+config UEFI_CPER
315+ bool
316+
317+config UEFI_CPER_ARM
318+ bool
319+ depends on UEFI_CPER && ( ARM || ARM64 )
320+ default y
321+
322+config UEFI_CPER_X86
323+ bool
324+ depends on UEFI_CPER && X86
325+ default y
drivers/firmware/efi/libstub/x86-stub.c+2−2
@@ -260,10 +260,10 @@ adjust_memory_range_protection(unsigned long start, unsigned long size) · 259 unmodified lines
260260 EFI_MEMORY_WB);
261261
262262 if (status != EFI_SUCCESS) {
263− efi_warn("Unable to unprotect memory range [%08lx,%08lx]: %d\n",
263+ efi_warn("Unable to unprotect memory range [%08lx,%08lx]: %lx\n",
264264 unprotect_start,
265265 unprotect_start + unprotect_size,
266− (int)status);
266+ status);
267267 }
268268 }
269269 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t