• Takahiro Akashi's avatar
    arm64: kdump: protect crash dump kernel memory · 98d2e153
    Takahiro Akashi authored
    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: default avatarAKASHI Takahiro <takahiro.akashi@linaro.org>
    Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    98d2e153
mmu.c 23.3 KB