arm64: hibernate: preserve kdump image around hibernation
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Mon, 3 Apr 2017 02:24:35 +0000 (11:24 +0900)
committerAKASHI Takahiro <takahiro.akashi@linaro.org>
Mon, 19 Jun 2017 06:09:04 +0000 (15:09 +0900)
commit76d3453b6bd9c1b09deb1cfb4611781356fe050c
treea603756fc183e26f9fa18c9186bbe96ab7490d62
parent32dcc8e7a247830df1e1a795cdf4b857fa712c4c
arm64: hibernate: preserve kdump image around hibernation

Since arch_kexec_protect_crashkres() removes a mapping for crash dump
kernel image, the loaded data won't be preserved around hibernation.

In this patch, helper functions, crash_prepare_suspend()/
crash_post_resume(), are additionally called before/after hibernation so
that the relevant memory segments will be mapped again and preserved just
as the others are.

In addition, to minimize the size of hibernation image, crash_is_nosave()
is added to pfn_is_nosave() in order to recognize only the pages that hold
loaded crash dump kernel image as saveable. Hibernation excludes any pages
that are marked as Reserved and yet "nosave."

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Conflicts:
arch/arm64/kernel/hibernate.c
due to missing commit 8ec058fd2710 ("arm64: hibernate: Resume when
hibernate image created on non-boot CPU")
arch/arm64/include/asm/kexec.h
arch/arm64/kernel/hibernate.c
arch/arm64/kernel/machine_kexec.c
arch/arm64/mm/init.c