Commit f283371e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'efi-fixes-for-v7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:
 "Mixed bag of EFI tweaks and bug fixes:

   - Add a missing symbol export spotted by Arnd's randconfig testing

   - Fix kexec from a kernel booted with 'noefi'

   - Fix memblock handling of the unaccepted memory table

   - Constify an occurrence of struct efivar_operations

   - Add Ilias as EFI reviewer"

* tag 'efi-fixes-for-v7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: Align unaccepted memory range to page boundary
  efi: Fix reservation of unaccepted memory table
  MAINTAINERS: Add a reviewer entry for EFI
  efi: stmm: Constify struct efivar_operations
  x86/kexec: Copy ACPI root pointer address from config table
  efi: export sysfb_primary_display for EDID
parents a27a5c0f 948a013a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9638,6 +9638,7 @@ F: security/integrity/evm/
EXTENSIBLE FIRMWARE INTERFACE (EFI)
M:	Ard Biesheuvel <ardb@kernel.org>
R:	Ilias Apalodimas <ilias.apalodimas@linaro.org>
L:	linux-efi@vger.kernel.org
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
+7 −0
Original line number Diff line number Diff line
@@ -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 = &params->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;

+1 −1
Original line number Diff line number Diff line
@@ -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
+4 −4
Original line number Diff line number Diff line
@@ -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,
+9 −8
Original line number Diff line number Diff line
@@ -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);
Loading