Files
Greg Thelen 58c5852ca9 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]>
2026-11-08 11:20:19 -05:00
..