Skip to content
Commit 545d650c authored by James Morse's avatar James Morse
Browse files

arm64: kexec: Re-clean kexec images to PoC on resume from hibernate



Currently the kdump image is cleaned to the PoC by crash_post_resume()'s
arch_kexec_protect_crashkres() call to unmap the kdeump kernel. Since
arch_kexec_flush_page() was added, the maintenance when unmapping is
only necessary when resuming from hibernate, so can be moved to
crash_post_resume().

Once kexec uses the crash kernel region, it also needs re-cleaning to
the PoC as the relocation code won't touch these segments. Add a call
to kexec_segment_flush() for the kexec image, even if its not stored
in place.

machine_kexec()'s call to kexec_segment_flush() can be removed. This
check was left due to an abundance of caution - it tests for a regular
kexec image stored in-place with no relocations. This can't happen by
accident as any call to kimage_add_page() will add an entry, meaning
kimage_terminate() won't modify the head page, even if src==dst.

A subsequent patch to add this in-palce behaviour for regular kexec
uses the crash kernel helpers to load segments in that region, these
call arch_kexec_flush_page() to perform the maintenance, meaning it
isn't necessary at kexec time.

Signed-off-by: James Morse's avatarJames Morse <james.morse@arm.com>
parent dd2df39f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment