]> 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)
commit84ff52768a5e1d3d83188de59d8a12e28dd5b1b7
treeb807b678cd2092db641a00296c5e740d87861dd9
parentf528a2e3d0bed9d8d61ff02bf7884e02a850a1e9
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