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 tag 'efi-urgent-2021-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI fixes from Thomas Gleixner:
"A set of EFI fixes:

- Prevent memblock and I/O reserved resources to get out of sync when
EFI memreserve is in use.

- Don't claim a non-existing table is invalid

- Don't warn when firmware memory is already reserved correctly"

* tag 'efi-urgent-2021-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
efi/mokvar: Reserve the table only if it is in boot services data
efi/libstub: Fix the efi_load_initrd function description
firmware/efi: Tell memblock about EFI iomem reservations
efi/tpm: Differentiate missing and invalid final event log table.

+23 -7
+12 -1
drivers/firmware/efi/efi.c
··· 896 896 static int efi_mem_reserve_iomem(phys_addr_t addr, u64 size) 897 897 { 898 898 struct resource *res, *parent; 899 + int ret; 899 900 900 901 res = kzalloc(sizeof(struct resource), GFP_ATOMIC); 901 902 if (!res) ··· 909 908 910 909 /* we expect a conflict with a 'System RAM' region */ 911 910 parent = request_resource_conflict(&iomem_resource, res); 912 - return parent ? request_resource(parent, res) : 0; 911 + ret = parent ? request_resource(parent, res) : 0; 912 + 913 + /* 914 + * Given that efi_mem_reserve_iomem() can be called at any 915 + * time, only call memblock_reserve() if the architecture 916 + * keeps the infrastructure around. 917 + */ 918 + if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK) && !ret) 919 + memblock_reserve(addr, size); 920 + 921 + return ret; 913 922 } 914 923 915 924 int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size)
+2 -2
drivers/firmware/efi/libstub/efi-stub-helper.c
··· 630 630 * @image: EFI loaded image protocol 631 631 * @load_addr: pointer to loaded initrd 632 632 * @load_size: size of loaded initrd 633 - * @soft_limit: preferred size of allocated memory for loading the initrd 634 - * @hard_limit: minimum size of allocated memory 633 + * @soft_limit: preferred address for loading the initrd 634 + * @hard_limit: upper limit address for loading the initrd 635 635 * 636 636 * Return: status code 637 637 */
+4 -1
drivers/firmware/efi/mokvar-table.c
··· 180 180 pr_err("EFI MOKvar config table is not valid\n"); 181 181 return; 182 182 } 183 - efi_mem_reserve(efi.mokvar_table, map_size_needed); 183 + 184 + if (md.type == EFI_BOOT_SERVICES_DATA) 185 + efi_mem_reserve(efi.mokvar_table, map_size_needed); 186 + 184 187 efi_mokvar_table_size = map_size_needed; 185 188 } 186 189
+5 -3
drivers/firmware/efi/tpm.c
··· 62 62 tbl_size = sizeof(*log_tbl) + log_tbl->size; 63 63 memblock_reserve(efi.tpm_log, tbl_size); 64 64 65 - if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR || 66 - log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { 67 - pr_warn(FW_BUG "TPM Final Events table missing or invalid\n"); 65 + if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) { 66 + pr_info("TPM Final Events table not present\n"); 67 + goto out; 68 + } else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { 69 + pr_warn(FW_BUG "TPM Final Events table invalid\n"); 68 70 goto out; 69 71 } 70 72