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
65 65
66 if (md->attribute & EFI_MEMORY_RO) {66 if (md->attribute & EFI_MEMORY_RO) {
67 val = pte_val(pte) & ~_PAGE_WRITE;67 val = pte_val(pte) & ~_PAGE_WRITE;
68 val = pte_val(pte) | _PAGE_READ;68 val |= _PAGE_READ;
69 pte = __pte(val);69 pte = __pte(val);
70 }70 }
71 if (md->attribute & EFI_MEMORY_XP) {71 if (md->attribute & EFI_MEMORY_XP) {
arch/x86/boot/header.S+1−1
@@ -163,7 +163,7 @@ extra_header_fields: · 162 unmodified lines
163 .long 0x200 # SizeOfHeaders163 .long 0x200 # SizeOfHeaders
164 .long 0 # CheckSum164 .long 0 # CheckSum
165 .word IMAGE_SUBSYSTEM_EFI_APPLICATION # Subsystem (EFI application)165 .word IMAGE_SUBSYSTEM_EFI_APPLICATION # Subsystem (EFI application)
166#ifdef CONFIG_DXE_MEM_ATTRIBUTES166#ifdef CONFIG_EFI_DXE_MEM_ATTRIBUTES
167 .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics167 .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics
168#else168#else
169 .word 0 # DllCharacteristics169 .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
270 return (u32)(status | (u64)status >> 32);270 return (u32)(status | (u64)status >> 32);
271}271}
272 272
273#define __efi64_split(val) (val) & U32_MAX, (u64)(val) >> 32
274
273#define __efi64_argmap_free_pages(addr, size) \275#define __efi64_argmap_free_pages(addr, size) \
274 ((addr), 0, (size))276 ((addr), 0, (size))
275 277
@@ -317,6 +319,13 @@ static inline u32 efi64_convert_status(efi_status_t status) · 41 unmodified lines
317#define __efi64_argmap_hash_log_extend_event(prot, fl, addr, size, ev) \319#define __efi64_argmap_hash_log_extend_event(prot, fl, addr, size, ev) \
318 ((prot), (fl), 0ULL, (u64)(addr), 0ULL, (u64)(size), 0ULL, ev)320 ((prot), (fl), 0ULL, (u64)(addr), 0ULL, (u64)(size), 0ULL, ev)
319 321
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
320/*329/*
321 * The macros below handle the plumbing for the argument mapping. To add a330 * The macros below handle the plumbing for the argument mapping. To add a
322 * mapping for a specific EFI method, simply define a macro331 * 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
32obj-y += cirrus/32obj-y += cirrus/
33obj-y += meson/33obj-y += meson/
34obj-$(CONFIG_GOOGLE_FIRMWARE) += google/34obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
35obj-$(CONFIG_EFI) += efi/35obj-y += efi/
36obj-$(CONFIG_UEFI_CPER) += efi/
37obj-y += imx/36obj-y += imx/
38obj-y += psci/37obj-y += psci/
39obj-y += smccc/38obj-y += smccc/
drivers/firmware/efi/Kconfig+24−28
@@ -193,6 +193,9 @@ config EFI_TEST · 192 unmodified lines
193 Say Y here to enable the runtime services support via /dev/efi_test.193 Say Y here to enable the runtime services support via /dev/efi_test.
194 If unsure, say N.194 If unsure, say N.
195 195
196config EFI_DEV_PATH_PARSER
197 bool
198
196config APPLE_PROPERTIES199config APPLE_PROPERTIES
197 bool "Apple Device Properties"200 bool "Apple Device Properties"
198 depends on EFI_STUB && X86201 depends on EFI_STUB && X86
@@ -255,40 +258,15 @@ config EFI_DISABLE_PCI_DMA · 56 unmodified lines
255 options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"258 options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
256 may be used to override this option.259 may be used to override this option.
257 260
258endmenu
259
260config EFI_EMBEDDED_FIRMWARE
261 bool
262 depends on EFI
263 select CRYPTO_LIB_SHA256
264
265config UEFI_CPER
266 bool
267
268config UEFI_CPER_ARM
269 bool
270 depends on UEFI_CPER && ( ARM || ARM64 )
271 default y
272
273config UEFI_CPER_X86
274 bool
275 depends on UEFI_CPER && X86
276 default y
277
278config EFI_DEV_PATH_PARSER
279 bool
280 depends on ACPI
281 default n
282
283config EFI_EARLYCON261config EFI_EARLYCON
284 def_bool y262 def_bool y
285 depends on EFI && SERIAL_EARLYCON && !ARM && !IA64263 depends on SERIAL_EARLYCON && !ARM && !IA64
286 select FONT_SUPPORT264 select FONT_SUPPORT
287 select ARCH_USE_MEMREMAP_PROT265 select ARCH_USE_MEMREMAP_PROT
288 266
289config EFI_CUSTOM_SSDT_OVERLAYS267config EFI_CUSTOM_SSDT_OVERLAYS
290 bool "Load custom ACPI SSDT overlay from an EFI variable"268 bool "Load custom ACPI SSDT overlay from an EFI variable"
291 depends on EFI && ACPI269 depends on ACPI
292 default ACPI_TABLE_UPGRADE270 default ACPI_TABLE_UPGRADE
293 help271 help
294 Allow loading of an ACPI SSDT overlay from an EFI variable specified272 Allow loading of an ACPI SSDT overlay from an EFI variable specified
@@ -314,7 +292,6 @@ config EFI_DISABLE_RUNTIME · 19 unmodified lines
314 292
315config EFI_COCO_SECRET293config EFI_COCO_SECRET
316 bool "EFI Confidential Computing Secret Area Support"294 bool "EFI Confidential Computing Secret Area Support"
317 depends on EFI
318 help295 help
319 Confidential Computing platforms (such as AMD SEV) allow the296 Confidential Computing platforms (such as AMD SEV) allow the
320 Guest Owner to securely inject secrets during guest VM launch.297 Guest Owner to securely inject secrets during guest VM launch.
@@ -327,3 +304,22 @@ config EFI_COCO_SECRET · 6 unmodified lines
327 for usage inside the kernel. This will allow the304 for usage inside the kernel. This will allow the
328 virt/coco/efi_secret module to access the secrets, which in turn305 virt/coco/efi_secret module to access the secrets, which in turn
329 allows userspace programs to access the injected secrets.306 allows userspace programs to access the injected secrets.
307
308config EFI_EMBEDDED_FIRMWARE
309 bool
310 select CRYPTO_LIB_SHA256
311
312endmenu
313
314config UEFI_CPER
315 bool
316
317config UEFI_CPER_ARM
318 bool
319 depends on UEFI_CPER && ( ARM || ARM64 )
320 default y
321
322config 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
260 EFI_MEMORY_WB);260 EFI_MEMORY_WB);
261 261
262 if (status != EFI_SUCCESS) {262 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",
264 unprotect_start,264 unprotect_start,
265 unprotect_start + unprotect_size,265 unprotect_start + unprotect_size,
266 (int)status);266 status);
267 }267 }
268 }268 }
269}269}

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