Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
BACKPORT: efi/arm: Revert "Defer persistent reservations until after …
Browse files Browse the repository at this point in the history
…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.

Kernel panic is happened with CentOS 8.0 on the eMAG2 emulator.
The original patchset was pushed to fix the crash on arm64
system with many CPUs. It was already in CentOS 8.0
(https://patchwork.kernel.org/cover/10670151/).
However there's issue with 1 of the patches, and the maintainer
reverted from kernel v5.2.
The patch is required to fix the kernel panic for CentOS 8.0
on the eMAG2 emulator:
[    0.000000] Call trace:
[    0.000000]  efi_apply_persistent_mem_reservations+0xa0/0xc0
[    0.000000]  setup_arch+0x1bc/0x55c
[    0.000000]  start_kernel+0x78/0x4d8
[    0.000000] Code: 8b35d260 6b15003f 110006b5 54fffcad (f9400c01)
[    0.000000] random: get_random_bytes called from print_oops_end_marker+0x30/0x60 with crng_init=0
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Fatal exception

This patch is backported from:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.2&id=582a32e708823e5957fd73ccd78dc4a9e49d21ea

Signed-off-by: Ard Biesheuvel <[email protected]>
Acked-by: Will Deacon <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Khuong Dinh <[email protected]>
  • Loading branch information
Ard Biesheuvel authored and tphan-ampere committed Apr 21, 2020
1 parent 9db4e45 commit 5db43ff
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion arch/arm64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ void __init setup_arch(char **cmdline_p)
arm64_memblock_init();

paging_init();
efi_apply_persistent_mem_reservations();

acpi_table_upgrade();

Expand Down
4 changes: 0 additions & 4 deletions drivers/firmware/efi/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,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;

Expand Down
3 changes: 0 additions & 3 deletions drivers/firmware/efi/libstub/arm-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 0 additions & 6 deletions include/linux/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,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)
{
Expand All @@ -1221,10 +1219,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr)
return false;
}

static inline int efi_apply_persistent_mem_reservations(void)
{
return 0;
}
static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
#endif

Expand Down

0 comments on commit 5db43ff

Please sign in to comment.