summaryrefslogtreecommitdiff
path: root/kernel/kexec.c
diff options
context:
space:
mode:
authorPavel Tatashin <pasha.tatashin@soleen.com>2019-12-04 18:59:15 +0300
committerWill Deacon <will@kernel.org>2020-01-08 19:32:55 +0300
commitde68e4daea9084df4c614d31e2061d5d31bf24f4 (patch)
treed703d520c70191a0069260df737fe25f56303181 /kernel/kexec.c
parentd42cc530b18db2dd9de621238d33670841aabc36 (diff)
downloadlinux-de68e4daea9084df4c614d31e2061d5d31bf24f4.tar.xz
kexec: add machine_kexec_post_load()
It is the same as machine_kexec_prepare(), but is called after segments are loaded. This way, can do processing work with already loaded relocation segments. One such example is arm64: it has to have segments loaded in order to create a page table, but it cannot do it during kexec time, because at that time allocations won't be possible anymore. Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com> Acked-by: Dave Young <dyoung@redhat.com> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r--kernel/kexec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c
index bc933c0db9bf..f977786fe498 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -159,6 +159,10 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments,
kimage_terminate(image);
+ ret = machine_kexec_post_load(image);
+ if (ret)
+ goto out;
+
/* Install the new kernel and uninstall the old */
image = xchg(dest_image, image);