]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kdump: protect crash dump kernel memory
authorTakahiro Akashi <takahiro.akashi@linaro.org>
Mon, 3 Apr 2017 02:24:34 +0000 (11:24 +0900)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 5 Apr 2017 17:28:35 +0000 (18:28 +0100)
commit63d13bed11dfa5332ef4f8be68b2a7357808e0e6
treeb807b678cd2092db641a00296c5e740d87861dd9
parentff0fb900adad73165780bfa14e1eaee3a47da2a7
arm64: kdump: protect crash dump kernel memory

arch_kexec_protect_crashkres() and arch_kexec_unprotect_crashkres()
are meant to be called by kexec_load() in order to protect the memory
allocated for crash dump kernel once the image is loaded.

The protection is implemented by unmapping the relevant segments in crash
dump kernel memory, rather than making it read-only as other archs do,
to prevent coherency issues due to potential cache aliasing (with
mismatched attributes).

Page-level mappings are consistently used here so that we can change
the attributes of segments in page granularity as well as shrink the region
also in page granularity through /sys/kernel/kexec_crash_size, putting
the freed memory back to buddy system.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/machine_kexec.c
arch/arm64/mm/mmu.c