[PATCH 1/3] riscv: Don't use va_pa_offset on kdump

Nick Kossifidis mick at ics.forth.gr
Fri Jan 7 10:03:59 PST 2022


Hello Palmer,

Any updates on those 3 patches ?

Regards,
Nick

Στις 2021-11-26 20:04, Nick Kossifidis έγραψε:
> On kdump instead of using an intermediate step to relocate the kernel,
> that lives in a "control buffer" outside the current kernel's mapping,
> we jump to the crash kernel directly by calling 
> riscv_kexec_norelocate().
> The current implementation uses va_pa_offset while switching to 
> physical
> addressing, however since we moved the kernel outside the linear 
> mapping
> this won't work anymore since riscv_kexec_norelocate() is part of the
> kernel mapping and we should use kernel_map.va_kernel_pa_offset, and 
> also
> take XIP kernel into account.
> 
> We don't really need to use va_pa_offset on riscv_kexec_norelocate, we
> can just set STVEC to the physical address of the new kernel instead 
> and
> let the hart jump to the new kernel on the next instruction after 
> setting
> SATP to zero. This fixes kdump and is also simpler/cleaner.
> 
> I tested this on the latest qemu and HiFive Unmatched and works as
> expected.
> 
> v2: I removed the direct jump after setting satp as suggested.
> 
> Fixes: 2bfc6cd81bd1 ("riscv: Move kernel mapping outside of linear 
> mapping")
> 
> Signed-off-by: Nick Kossifidis <mick at ics.forth.gr>
> Reviewed-by: Alexandre Ghiti <alex at ghiti.fr>
> Cc: <stable at vger.kernel.org> # 5.13
> Cc: <stable at vger.kernel.org> # 5.14




More information about the linux-riscv mailing list