arm64: kexec: move relocation function setup
authorPavel Tatashin <pasha.tatashin@soleen.com>
Mon, 25 Jan 2021 19:19:14 +0000 (14:19 -0500)
committerWill Deacon <will@kernel.org>
Wed, 27 Jan 2021 15:41:12 +0000 (15:41 +0000)
commit4c3c31230c912d8f2e49c775555aadf79a43d418
tree8c2d5f344d14794a969014ed16e9e808dd5c0d92
parent7018d467ff2d6a6d3c820a7ad4e897fe2430b040
arm64: kexec: move relocation function setup

Currently, kernel relocation function is configured in machine_kexec()
at the time of kexec reboot by using control_code_page.

This operation, however, is more logical to be done during kexec_load,
and thus remove from reboot time. Move, setup of this function to
newly added machine_kexec_post_load().

Because once MMU is enabled, kexec control page will contain more than
relocation kernel, but also vector table, add pointer to the actual
function within this page arch.kern_reloc. Currently, it equals to the
beginning of page, we will add offsets later, when vector table is
added.

Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: James Morse <james.morse@arm.com>
Link: https://lore.kernel.org/r/20210125191923.1060122-10-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/kexec.h
arch/arm64/kernel/machine_kexec.c