Part of the RISC-V port.
arch/riscv/kernel/kexec_image.c already loads the Image format at any 2 MB-aligned physical address (kernel VA is fixed, PA is free, kernel_map.va_pa_offset computed at runtime). machine_kexec_file.c always loads purgatory and jumps through it.
- Add
KEXEC_TYPE_MULTIKERNEL handling: place Image and instance DTB inside the grant (instance->memory_regions), never in the running kernel's memory; skip purgatory (kexec_load_purgatory(), riscv_kernel_entry symbol patching).
image->start = Image load address (_start is offset 0); image->arch.fdt_addr = instance DTB. These feed the fence.i stub.
- Never call
machine_kexec()/riscv_kexec_relocate paths; the current kernel keeps running.
- No PoC cleaning needed (harts are coherent), but execute
fence after writing the image/DTB/ctrl block so the stores are ordered before HART_START.
- Regenerate the DTB
/memory nodes on every exec, not at load (the grant can change between load and exec; see the x86 "grant shortfall" fix).
Part of the RISC-V port.
arch/riscv/kernel/kexec_image.calready loads theImageformat at any 2 MB-aligned physical address (kernel VA is fixed, PA is free,kernel_map.va_pa_offsetcomputed at runtime).machine_kexec_file.calways loads purgatory and jumps through it.KEXEC_TYPE_MULTIKERNELhandling: place Image and instance DTB inside the grant (instance->memory_regions), never in the running kernel's memory; skip purgatory (kexec_load_purgatory(),riscv_kernel_entrysymbol patching).image->start= Image load address (_startis offset 0);image->arch.fdt_addr= instance DTB. These feed thefence.istub.machine_kexec()/riscv_kexec_relocatepaths; the current kernel keeps running.fenceafter writing the image/DTB/ctrl block so the stores are ordered beforeHART_START./memorynodes on every exec, not at load (the grant can change between load and exec; see the x86 "grant shortfall" fix).