Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI fixes from Ingo Molnar:
"Four fixes:
- fix a kexec crash on arm64
- fix a reboot crash on some Android platforms
- future-proof the code for upcoming ACPI 6.2 changes
- fix a build warning on x86"

* 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efibc: Replace variable set function in notifier call
x86/efi: fix a -Wtype-limits compilation warning
efi/bgrt: Drop BGRT status field reserved bits check
efi/memreserve: deal with memreserve entries in unmapped memory

+18 -13
+1 -1
arch/x86/platform/efi/quirks.c
··· 728 728 * Address range 0x0000 - 0x0fff is always mapped in the efi_pgd, so 729 729 * page faulting on these addresses isn't expected. 730 730 */ 731 - if (phys_addr >= 0x0000 && phys_addr <= 0x0fff) 731 + if (phys_addr <= 0x0fff) 732 732 return; 733 733 734 734 /*
-5
drivers/firmware/efi/efi-bgrt.c
··· 47 47 bgrt->version); 48 48 goto out; 49 49 } 50 - if (bgrt->status & 0xfe) { 51 - pr_notice("Ignoring BGRT: reserved status bits are non-zero %u\n", 52 - bgrt->status); 53 - goto out; 54 - } 55 50 if (bgrt->image_type != 0) { 56 51 pr_notice("Ignoring BGRT: invalid image type %u (expected 0)\n", 57 52 bgrt->image_type);
+10 -2
drivers/firmware/efi/efi.c
··· 1009 1009 1010 1010 /* first try to find a slot in an existing linked list entry */ 1011 1011 for (prsv = efi_memreserve_root->next; prsv; prsv = rsv->next) { 1012 - rsv = __va(prsv); 1012 + rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB); 1013 1013 index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size); 1014 1014 if (index < rsv->size) { 1015 1015 rsv->entry[index].base = addr; 1016 1016 rsv->entry[index].size = size; 1017 1017 1018 + memunmap(rsv); 1018 1019 return 0; 1019 1020 } 1021 + memunmap(rsv); 1020 1022 } 1021 1023 1022 1024 /* no slot found - allocate a new linked list entry */ ··· 1026 1024 if (!rsv) 1027 1025 return -ENOMEM; 1028 1026 1029 - rsv->size = EFI_MEMRESERVE_COUNT(PAGE_SIZE); 1027 + /* 1028 + * The memremap() call above assumes that a linux_efi_memreserve entry 1029 + * never crosses a page boundary, so let's ensure that this remains true 1030 + * even when kexec'ing a 4k pages kernel from a >4k pages kernel, by 1031 + * using SZ_4K explicitly in the size calculation below. 1032 + */ 1033 + rsv->size = EFI_MEMRESERVE_COUNT(SZ_4K); 1030 1034 atomic_set(&rsv->count, 1); 1031 1035 rsv->entry[0].base = addr; 1032 1036 rsv->entry[0].size = size;
+7 -5
drivers/firmware/efi/efibc.c
··· 43 43 efibc_str_to_str16(value, (efi_char16_t *)entry->var.Data); 44 44 memcpy(&entry->var.VendorGuid, &guid, sizeof(guid)); 45 45 46 - ret = efivar_entry_set(entry, 47 - EFI_VARIABLE_NON_VOLATILE 48 - | EFI_VARIABLE_BOOTSERVICE_ACCESS 49 - | EFI_VARIABLE_RUNTIME_ACCESS, 50 - size, entry->var.Data, NULL); 46 + ret = efivar_entry_set_safe(entry->var.VariableName, 47 + entry->var.VendorGuid, 48 + EFI_VARIABLE_NON_VOLATILE 49 + | EFI_VARIABLE_BOOTSERVICE_ACCESS 50 + | EFI_VARIABLE_RUNTIME_ACCESS, 51 + false, size, entry->var.Data); 52 + 51 53 if (ret) 52 54 pr_err("failed to set %s EFI variable: 0x%x\n", 53 55 name, ret);