mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
kho: check fdt_phys in is_kho_boot()
is_kho_boot() is called early in boot before the linear memory map is
initialized, so calling phys_to_virt() via kho_get_fdt() there is
invalid.
On arm64 (and similarly in upcoming riscv64 support), this triggers
BUG_ONs in debug builds, such as:
kernel BUG at ./arch/arm64/include/asm/memory.h:377!
Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
Call trace:
is_kho_boot+0x2c/0x38 (P)
efi_init+0x94/0xf8
setup_arch+0xf0/0x240
start_kernel+0x84/0x490
__primary_switched+0x88/0x98
Use kho_in.fdt_phys in is_kho_boot() directly instead of translating it
to a virtual address.
Fixes: d6d5116391 ("kexec: introduce is_kho_boot()")
Signed-off-by: Greg Thelen <[email protected]>
Reviewed-by: Pratyush Yadav (Google) <[email protected]>
Link: https://patch.msgid.link/[email protected]
[Pasha: massaged the changelog]
Signed-off-by: Pasha Tatashin <[email protected]>
This commit is contained in:
@@ -1643,7 +1643,7 @@ EXPORT_SYMBOL_GPL(kho_restore_free);
|
||||
*/
|
||||
bool is_kho_boot(void)
|
||||
{
|
||||
return !!kho_get_fdt();
|
||||
return !!kho_in.fdt_phys;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(is_kho_boot);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user