[PATCH 4/4][SRU Cosmic] efi/arm: Revert "Defer persistent reservations until after paging_init()"
dann frazier
dann.frazier at canonical.com
Wed Feb 20 09:32:36 UTC 2019
From: Ard Biesheuvel <ard.biesheuvel at linaro.org>
BugLink: https://bugs.launchpad.net/bugs/1816425
This reverts commit eff896288872d687d9662000ec9ae11b6d61766f, which
deferred the processing of persistent memory reservations to a point
where the memory may have already been allocated and overwritten,
defeating the purpose.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
Acked-by: Will Deacon <will.deacon at arm.com>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier at arm.com>
Cc: Mike Rapoport <rppt at linux.ibm.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Thomas Gleixner <tglx at linutronix.de>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-efi at vger.kernel.org
Link: http://lkml.kernel.org/r/20190215123333.21209-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo at kernel.org>
(backported from commit 582a32e708823e5957fd73ccd78dc4a9e49d21ea)
[dannf: Minor offset adjustments in efi.h]
Signed-off-by: dann frazier <dann.frazier at canonical.com>
---
arch/arm64/kernel/setup.c | 1 -
drivers/firmware/efi/efi.c | 4 ----
drivers/firmware/efi/libstub/arm-stub.c | 3 ---
include/linux/efi.h | 7 -------
4 files changed, 15 deletions(-)
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index ca32a884bc7d4..952c2b1268822 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -327,7 +327,6 @@ void __init setup_arch(char **cmdline_p)
arm64_memblock_init();
paging_init();
- efi_apply_persistent_mem_reservations();
acpi_table_upgrade();
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 4ee1e5c13029e..989e8a208dfb6 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -584,11 +584,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz,
early_memunmap(tbl, sizeof(*tbl));
}
- return 0;
-}
-int __init efi_apply_persistent_mem_reservations(void)
-{
if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) {
unsigned long prsv = efi.mem_reserve;
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c
index e30c26f572c25..60f202e57a607 100644
--- a/drivers/firmware/efi/libstub/arm-stub.c
+++ b/drivers/firmware/efi/libstub/arm-stub.c
@@ -100,9 +100,6 @@ void install_memreserve_table(efi_system_table_t *sys_table_arg)
efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;
efi_status_t status;
- if (IS_ENABLED(CONFIG_ARM))
- return;
-
status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv),
(void **)&rsv);
if (status != EFI_SUCCESS) {
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 2290aa9380c56..ae2a65ea6017f 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1204,8 +1204,6 @@ extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
extern bool efi_is_table_address(unsigned long phys_addr);
extern void __init efi_set_secure_boot(enum efi_secureboot_mode mode);
-
-extern int efi_apply_persistent_mem_reservations(void);
#else
static inline bool efi_enabled(int feature)
{
@@ -1225,11 +1223,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr)
return false;
}
static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
-
-static inline int efi_apply_persistent_mem_reservations(void)
-{
- return 0;
-}
#endif
extern int efi_status_to_err(efi_status_t status);
--
2.20.1
More information about the kernel-team
mailing list