diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2019-02-15 07:33:33 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-02-16 09:02:03 -0500 |
commit | 582a32e708823e5957fd73ccd78dc4a9e49d21ea (patch) | |
tree | 313ebeb73e03401253bc62581280cd4327f895b1 | |
parent | 8a5b403d71affa098009cc3dff1b2c45113021ad (diff) |
efi/arm: Revert "Defer persistent reservations until after paging_init()"
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@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20190215123333.21209-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/arm64/kernel/setup.c | 1 | ||||
-rw-r--r-- | drivers/firmware/efi/efi.c | 4 | ||||
-rw-r--r-- | drivers/firmware/efi/libstub/arm-stub.c | 3 | ||||
-rw-r--r-- | include/linux/efi.h | 7 |
4 files changed, 0 insertions, 15 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 4b0e1231625c..d09ec76f08cf 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -313,7 +313,6 @@ void __init setup_arch(char **cmdline_p) | |||
313 | arm64_memblock_init(); | 313 | arm64_memblock_init(); |
314 | 314 | ||
315 | paging_init(); | 315 | paging_init(); |
316 | efi_apply_persistent_mem_reservations(); | ||
317 | 316 | ||
318 | acpi_table_upgrade(); | 317 | acpi_table_upgrade(); |
319 | 318 | ||
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 4c46ff6f2242..55b77c576c42 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c | |||
@@ -592,11 +592,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, | |||
592 | 592 | ||
593 | early_memunmap(tbl, sizeof(*tbl)); | 593 | early_memunmap(tbl, sizeof(*tbl)); |
594 | } | 594 | } |
595 | return 0; | ||
596 | } | ||
597 | 595 | ||
598 | int __init efi_apply_persistent_mem_reservations(void) | ||
599 | { | ||
600 | if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) { | 596 | if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) { |
601 | unsigned long prsv = efi.mem_reserve; | 597 | unsigned long prsv = efi.mem_reserve; |
602 | 598 | ||
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index eee42d5e25ee..c037c6c5d0b7 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c | |||
@@ -75,9 +75,6 @@ void install_memreserve_table(efi_system_table_t *sys_table_arg) | |||
75 | efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID; | 75 | efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID; |
76 | efi_status_t status; | 76 | efi_status_t status; |
77 | 77 | ||
78 | if (IS_ENABLED(CONFIG_ARM)) | ||
79 | return; | ||
80 | |||
81 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv), | 78 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv), |
82 | (void **)&rsv); | 79 | (void **)&rsv); |
83 | if (status != EFI_SUCCESS) { | 80 | if (status != EFI_SUCCESS) { |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 45ff763fba76..28604a8d0aa9 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -1198,8 +1198,6 @@ static inline bool efi_enabled(int feature) | |||
1198 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); | 1198 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); |
1199 | 1199 | ||
1200 | extern bool efi_is_table_address(unsigned long phys_addr); | 1200 | extern bool efi_is_table_address(unsigned long phys_addr); |
1201 | |||
1202 | extern int efi_apply_persistent_mem_reservations(void); | ||
1203 | #else | 1201 | #else |
1204 | static inline bool efi_enabled(int feature) | 1202 | static inline bool efi_enabled(int feature) |
1205 | { | 1203 | { |
@@ -1218,11 +1216,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr) | |||
1218 | { | 1216 | { |
1219 | return false; | 1217 | return false; |
1220 | } | 1218 | } |
1221 | |||
1222 | static inline int efi_apply_persistent_mem_reservations(void) | ||
1223 | { | ||
1224 | return 0; | ||
1225 | } | ||
1226 | #endif | 1219 | #endif |
1227 | 1220 | ||
1228 | extern int efi_status_to_err(efi_status_t status); | 1221 | extern int efi_status_to_err(efi_status_t status); |