• Russell King's avatar
    ARM: kexec: fix failure to boot crash kernel · 0d70262a
    Russell King authored
    When kexec was converted to DTB, the dtb address was passed between
    machine_kexec_prepare() and machine_kexec() using a static variable.
    This is bad news if you load a crash kernel followed by a normal
    kernel or vice versa - the last loaded kernel overwrites the dtb
    address.
    
    This can result in kexec failures, as (eg) we try to boot the crash
    kernel with the last loaded dtb.  For example, with:
    
    the crash kernel fails to find the dtb.
    
    Avoid this by defining a kimage architecture structure, and store
    the address to be passed in r2 there, which will either be the ATAGs
    or the dtb blob.
    
    Fixes: 4cabd1d9 ("ARM: 7539/1: kexec: scan for dtb magic in segments")
    Fixes: 42d720d1 ("ARM: kexec: Make .text R/W in machine_kexec")
    Reported-by: default avatarKeerthy <j-keerthy@ti.com>
    Tested-by: default avatarKeerthy <j-keerthy@ti.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    0d70262a
machine_kexec.c 4.78 KB