This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

keystone2: is it possible to boot kernel from kexec?

Hi,

Linux kernel need to disable MMU and runs with an identity mapping (VA=PA) before to run the kernel which is loaded from kexec. However for keystone2, the ram start address is out of 32-bit physical range, so it is hard to for kernel jump to 4G+ address.

But for normal kernel boot from uboot, it can boot through the dark stage when MMU is off (used the aliasing memory within the 32-bit addressable space), then switch to high ram address. So I am curious if it is possible to use the aliasing address to run the kexec loaded kernel? Thanks!

Regards,
Guoqing

  • Hi, Guoqing,

    You are right, but we need to switch the address space for cache choherency and hence kexec will need some special handling. It is not straight forward and need some thoughts.

    Rex

  • Hi Rex,

    Do you mean need to handle the cache coherency of aliasing addr before use the aliasing in kexec? but I got the following sentence from link:
    "Be aware that Keystone2 doesn’t support cache coherency for the aliased address space."

    But for normal boot, how the kernel or uboot used the alias address? since kernel runs on the low alias address first then switch to high address, however I can't find related code for the cache coherency of the alias address. I suspected that the process is handled by the hardware automatically, which makes the alias address is only used for boot time.

    Regards,
    Guoqing

  • Hi, Guoqing,

    Our thought on kexec is for the condition of a kernel crash and to access the crash dump. In this case, it usually loads a bare set of kernel with minimal features with LPAE disabled. These are some thoughts we have till it is implemented in Q4. Is this also your use case? Do you mind sharing it?

    Rex