[PATCH 3/3] arm64: kdump: add support access protection for crashkernel region

2023-07-21 Thread thunder . leizhen
From: Zhen Lei 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. This is basically revert commit 0d124e96051b ("arm64: kdump : take off the protection

[PATCH 0/3] arm64: kdump: Restore the write protection for the crashkernel memory region

2023-07-21 Thread thunder . leizhen
From: Zhen Lei Unlike in the past, the low memory allocation direction of the crashkernel is changed from top-down to bottom-up. As long as the DMA zone has sufficient continuous free memory, the allocated crashkernel low memory must meet the requirements. The allocation direction of crashkernel

[PATCH 2/3] arm64: kdump: use page-level mapping for crashkernel region

2023-07-21 Thread thunder . leizhen
From: Zhen Lei Use page-level mappings for crashkernel region so that we can use set_memory_valid() to do access protection for it. Signed-off-by: Zhen Lei --- arch/arm64/mm/mmu.c | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu

[PATCH 1/3] arm64: kdump: Allocate crash low memory in the bottom-up direction

2023-07-21 Thread thunder . leizhen
From: Zhen Lei arm64_memblock_init() reserve_crashkernel() (1) paging_init() map_mem() (2) unflatten_device_tree or parse ACPI (3) bootmem_init() zone_sizes_init() Update arm64_dma_phys_limit (