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
Unified · Split
| @@ -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) { |
| @@ -163,7 +163,7 @@ extra_header_fields: · 162 unmodified lines | |||
| 163 | .long 0x200 # SizeOfHeaders | 163 | .long 0x200 # SizeOfHeaders |
| 164 | .long 0 # CheckSum | 164 | .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_ATTRIBUTES | 166 | #ifdef CONFIG_EFI_DXE_MEM_ATTRIBUTES |
| 167 | .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics | 167 | .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics |
| 168 | #else | 168 | #else |
| 169 | .word 0 # DllCharacteristics | 169 | .word 0 # DllCharacteristics |
| @@ -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 a | 330 | * The macros below handle the plumbing for the argument mapping. To add a |
| 322 | * mapping for a specific EFI method, simply define a macro | 331 | * mapping for a specific EFI method, simply define a macro |
| @@ -32,8 +32,7 @@ obj-y += broadcom/ · 31 unmodified lines | |||
| 32 | obj-y += cirrus/ | 32 | obj-y += cirrus/ |
| 33 | obj-y += meson/ | 33 | obj-y += meson/ |
| 34 | obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ | 34 | obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ |
| 35 | obj-$(CONFIG_EFI) += efi/ | 35 | obj-y += efi/ |
| 36 | obj-$(CONFIG_UEFI_CPER) += efi/ | ||
| 37 | obj-y += imx/ | 36 | obj-y += imx/ |
| 38 | obj-y += psci/ | 37 | obj-y += psci/ |
| 39 | obj-y += smccc/ | 38 | obj-y += smccc/ |
| @@ -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 | ||
| 196 | config EFI_DEV_PATH_PARSER | ||
| 197 | bool | ||
| 198 | |||
| 196 | config APPLE_PROPERTIES | 199 | config APPLE_PROPERTIES |
| 197 | bool "Apple Device Properties" | 200 | bool "Apple Device Properties" |
| 198 | depends on EFI_STUB && X86 | 201 | 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 | ||
| 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 | |||
| 283 | config EFI_EARLYCON | 261 | config EFI_EARLYCON |
| 284 | def_bool y | 262 | def_bool y |
| 285 | depends on EFI && SERIAL_EARLYCON && !ARM && !IA64 | 263 | depends on SERIAL_EARLYCON && !ARM && !IA64 |
| 286 | select FONT_SUPPORT | 264 | select FONT_SUPPORT |
| 287 | select ARCH_USE_MEMREMAP_PROT | 265 | select ARCH_USE_MEMREMAP_PROT |
| 288 | 266 | ||
| 289 | config EFI_CUSTOM_SSDT_OVERLAYS | 267 | config 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 && ACPI | 269 | depends on ACPI |
| 292 | default ACPI_TABLE_UPGRADE | 270 | default ACPI_TABLE_UPGRADE |
| 293 | help | 271 | help |
| 294 | Allow loading of an ACPI SSDT overlay from an EFI variable specified | 272 | 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 | ||
| 315 | config EFI_COCO_SECRET | 293 | config EFI_COCO_SECRET |
| 316 | bool "EFI Confidential Computing Secret Area Support" | 294 | bool "EFI Confidential Computing Secret Area Support" |
| 317 | depends on EFI | ||
| 318 | help | 295 | help |
| 319 | Confidential Computing platforms (such as AMD SEV) allow the | 296 | 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 the | 304 | for usage inside the kernel. This will allow the |
| 328 | virt/coco/efi_secret module to access the secrets, which in turn | 305 | 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 | |||
| 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 | ||
| @@ -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 | } |