Skip to content

Commit f283371

Browse files
committed
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
2 parents a27a5c0 + 948a013 commit f283371

6 files changed

Lines changed: 30 additions & 15 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9638,6 +9638,7 @@ F: security/integrity/evm/
96389638

96399639
EXTENSIBLE FIRMWARE INTERFACE (EFI)
96409640
M: Ard Biesheuvel <ardb@kernel.org>
9641+
R: Ilias Apalodimas <ilias.apalodimas@linaro.org>
96419642
L: linux-efi@vger.kernel.org
96429643
S: Maintained
96439644
T: git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git

arch/x86/kernel/kexec-bzimage64.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
193193
struct efi_info *current_ei = &boot_params.efi_info;
194194
struct efi_info *ei = &params->efi_info;
195195

196+
if (!params->acpi_rsdp_addr) {
197+
if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
198+
params->acpi_rsdp_addr = efi.acpi20;
199+
else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
200+
params->acpi_rsdp_addr = efi.acpi;
201+
}
202+
196203
if (!efi_enabled(EFI_RUNTIME_SERVICES))
197204
return 0;
198205

drivers/firmware/efi/efi-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extern __weak const efi_config_table_type_t efi_arch_tables[];
6060
* x86 defines its own instance of sysfb_primary_display and uses
6161
* it even without EFI, everything else can get them from here.
6262
*/
63-
#if !defined(CONFIG_X86) && (defined(CONFIG_SYSFB) || defined(CONFIG_EFI_EARLYCON))
63+
#if !defined(CONFIG_X86) && (defined(CONFIG_SYSFB) || defined(CONFIG_EFI_EARLYCON)) || defined(CONFIG_FIRMWARE_EDID)
6464
struct sysfb_display_info sysfb_primary_display __section(".data");
6565
EXPORT_SYMBOL_GPL(sysfb_primary_display);
6666
#endif

drivers/firmware/efi/efi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,13 @@ static __init int match_config_table(const efi_guid_t *guid,
692692

693693
static __init void reserve_unaccepted(struct efi_unaccepted_memory *unaccepted)
694694
{
695-
phys_addr_t start, size;
695+
phys_addr_t start, end;
696696

697697
start = PAGE_ALIGN_DOWN(efi.unaccepted);
698-
size = PAGE_ALIGN(sizeof(*unaccepted) + unaccepted->size);
698+
end = PAGE_ALIGN(efi.unaccepted + sizeof(*unaccepted) + unaccepted->size);
699699

700-
memblock_add(start, size);
701-
memblock_reserve(start, size);
700+
memblock_add(start, end - start);
701+
memblock_reserve(start, end - start);
702702
}
703703

704704
int __init efi_config_parse_tables(const efi_config_table_t *config_tables,

drivers/firmware/efi/stmm/tee_stmm_efi.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "mm_communication.h"
1515

1616
static struct efivars tee_efivars;
17-
static struct efivar_operations tee_efivar_ops;
1817

1918
static size_t max_buffer_size; /* comm + var + func + data */
2019
static size_t max_payload_size; /* func + data */
@@ -520,6 +519,15 @@ static void tee_stmm_restore_efivars_generic_ops(void)
520519
efivars_generic_ops_register();
521520
}
522521

522+
static const struct efivar_operations tee_efivar_ops = {
523+
.get_variable = tee_get_variable,
524+
.get_next_variable = tee_get_next_variable,
525+
.set_variable = tee_set_variable,
526+
.set_variable_nonblocking = tee_set_variable_nonblocking,
527+
.query_variable_store = efi_query_variable_store,
528+
.query_variable_info = tee_query_variable_info,
529+
};
530+
523531
static int tee_stmm_efi_probe(struct tee_client_device *tee_dev)
524532
{
525533
struct device *dev = &tee_dev->dev;
@@ -558,13 +566,6 @@ static int tee_stmm_efi_probe(struct tee_client_device *tee_dev)
558566
MM_VARIABLE_COMMUNICATE_SIZE +
559567
max_payload_size;
560568

561-
tee_efivar_ops.get_variable = tee_get_variable;
562-
tee_efivar_ops.get_next_variable = tee_get_next_variable;
563-
tee_efivar_ops.set_variable = tee_set_variable;
564-
tee_efivar_ops.set_variable_nonblocking = tee_set_variable_nonblocking;
565-
tee_efivar_ops.query_variable_store = efi_query_variable_store;
566-
tee_efivar_ops.query_variable_info = tee_query_variable_info;
567-
568569
efivars_generic_ops_unregister();
569570
pr_info("Using TEE-based EFI runtime variable services\n");
570571
efivars_register(&tee_efivars, &tee_efivar_ops);

drivers/firmware/efi/unaccepted_memory.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ void accept_memory(phys_addr_t start, unsigned long size)
3535
struct efi_unaccepted_memory *unaccepted;
3636
unsigned long range_start, range_end;
3737
struct accept_range range, *entry;
38-
phys_addr_t end = start + size;
3938
unsigned long flags;
39+
phys_addr_t end;
4040
u64 unit_size;
4141

4242
unaccepted = efi_get_unaccepted_table();
4343
if (!unaccepted)
4444
return;
4545

46+
end = PAGE_ALIGN(start + size);
47+
start = PAGE_ALIGN_DOWN(start);
48+
4649
unit_size = unaccepted->unit_size;
4750

4851
/*
@@ -160,15 +163,18 @@ void accept_memory(phys_addr_t start, unsigned long size)
160163
bool range_contains_unaccepted_memory(phys_addr_t start, unsigned long size)
161164
{
162165
struct efi_unaccepted_memory *unaccepted;
163-
phys_addr_t end = start + size;
164166
unsigned long flags;
165167
bool ret = false;
168+
phys_addr_t end;
166169
u64 unit_size;
167170

168171
unaccepted = efi_get_unaccepted_table();
169172
if (!unaccepted)
170173
return false;
171174

175+
end = PAGE_ALIGN(start + size);
176+
start = PAGE_ALIGN_DOWN(start);
177+
172178
unit_size = unaccepted->unit_size;
173179

174180
/*

0 commit comments

Comments
 (0)