diff --git a/MAINTAINERS b/MAINTAINERS index b8d8a5c41597..55af015174a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9638,6 +9638,7 @@ F: security/integrity/evm/ EXTENSIBLE FIRMWARE INTERFACE (EFI) M: Ard Biesheuvel +R: Ilias Apalodimas L: linux-efi@vger.kernel.org S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index 7508d0ccc740..251edc5a040f 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -193,6 +193,13 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr, struct efi_info *current_ei = &boot_params.efi_info; struct efi_info *ei = ¶ms->efi_info; + if (!params->acpi_rsdp_addr) { + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) + params->acpi_rsdp_addr = efi.acpi20; + else if (efi.acpi != EFI_INVALID_TABLE_ADDR) + params->acpi_rsdp_addr = efi.acpi; + } + if (!efi_enabled(EFI_RUNTIME_SERVICES)) return 0; diff --git a/drivers/firmware/efi/efi-init.c b/drivers/firmware/efi/efi-init.c index 432301dce76f..5a595d026f58 100644 --- a/drivers/firmware/efi/efi-init.c +++ b/drivers/firmware/efi/efi-init.c @@ -60,7 +60,7 @@ extern __weak const efi_config_table_type_t efi_arch_tables[]; * x86 defines its own instance of sysfb_primary_display and uses * it even without EFI, everything else can get them from here. */ -#if !defined(CONFIG_X86) && (defined(CONFIG_SYSFB) || defined(CONFIG_EFI_EARLYCON)) +#if !defined(CONFIG_X86) && (defined(CONFIG_SYSFB) || defined(CONFIG_EFI_EARLYCON)) || defined(CONFIG_FIRMWARE_EDID) struct sysfb_display_info sysfb_primary_display __section(".data"); EXPORT_SYMBOL_GPL(sysfb_primary_display); #endif diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 111e87a618e5..56e9d73412fa 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -692,13 +692,13 @@ static __init int match_config_table(const efi_guid_t *guid, static __init void reserve_unaccepted(struct efi_unaccepted_memory *unaccepted) { - phys_addr_t start, size; + phys_addr_t start, end; start = PAGE_ALIGN_DOWN(efi.unaccepted); - size = PAGE_ALIGN(sizeof(*unaccepted) + unaccepted->size); + end = PAGE_ALIGN(efi.unaccepted + sizeof(*unaccepted) + unaccepted->size); - memblock_add(start, size); - memblock_reserve(start, size); + memblock_add(start, end - start); + memblock_reserve(start, end - start); } int __init efi_config_parse_tables(const efi_config_table_t *config_tables, diff --git a/drivers/firmware/efi/stmm/tee_stmm_efi.c b/drivers/firmware/efi/stmm/tee_stmm_efi.c index 7b04dd649629..3bea2ef50ef3 100644 --- a/drivers/firmware/efi/stmm/tee_stmm_efi.c +++ b/drivers/firmware/efi/stmm/tee_stmm_efi.c @@ -14,7 +14,6 @@ #include "mm_communication.h" static struct efivars tee_efivars; -static struct efivar_operations tee_efivar_ops; static size_t max_buffer_size; /* comm + var + func + data */ static size_t max_payload_size; /* func + data */ @@ -520,6 +519,15 @@ static void tee_stmm_restore_efivars_generic_ops(void) efivars_generic_ops_register(); } +static const struct efivar_operations tee_efivar_ops = { + .get_variable = tee_get_variable, + .get_next_variable = tee_get_next_variable, + .set_variable = tee_set_variable, + .set_variable_nonblocking = tee_set_variable_nonblocking, + .query_variable_store = efi_query_variable_store, + .query_variable_info = tee_query_variable_info, +}; + static int tee_stmm_efi_probe(struct tee_client_device *tee_dev) { struct device *dev = &tee_dev->dev; @@ -558,13 +566,6 @@ static int tee_stmm_efi_probe(struct tee_client_device *tee_dev) MM_VARIABLE_COMMUNICATE_SIZE + max_payload_size; - tee_efivar_ops.get_variable = tee_get_variable; - tee_efivar_ops.get_next_variable = tee_get_next_variable; - tee_efivar_ops.set_variable = tee_set_variable; - tee_efivar_ops.set_variable_nonblocking = tee_set_variable_nonblocking; - tee_efivar_ops.query_variable_store = efi_query_variable_store; - tee_efivar_ops.query_variable_info = tee_query_variable_info; - efivars_generic_ops_unregister(); pr_info("Using TEE-based EFI runtime variable services\n"); efivars_register(&tee_efivars, &tee_efivar_ops); diff --git a/drivers/firmware/efi/unaccepted_memory.c b/drivers/firmware/efi/unaccepted_memory.c index c2c067eff634..4a8ec8d6a571 100644 --- a/drivers/firmware/efi/unaccepted_memory.c +++ b/drivers/firmware/efi/unaccepted_memory.c @@ -35,14 +35,17 @@ void accept_memory(phys_addr_t start, unsigned long size) struct efi_unaccepted_memory *unaccepted; unsigned long range_start, range_end; struct accept_range range, *entry; - phys_addr_t end = start + size; unsigned long flags; + phys_addr_t end; u64 unit_size; unaccepted = efi_get_unaccepted_table(); if (!unaccepted) return; + end = PAGE_ALIGN(start + size); + start = PAGE_ALIGN_DOWN(start); + unit_size = unaccepted->unit_size; /* @@ -160,15 +163,18 @@ retry: bool range_contains_unaccepted_memory(phys_addr_t start, unsigned long size) { struct efi_unaccepted_memory *unaccepted; - phys_addr_t end = start + size; unsigned long flags; bool ret = false; + phys_addr_t end; u64 unit_size; unaccepted = efi_get_unaccepted_table(); if (!unaccepted) return false; + end = PAGE_ALIGN(start + size); + start = PAGE_ALIGN_DOWN(start); + unit_size = unaccepted->unit_size; /*