Skip to content

[PATCHv3 00/28] support reserving crashkernel above 4G on arm64 kdump

Pingfan Liu requested to merge (removed):crashkernel_high into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2091852 Upstream Status: https://github.com/torvalds/linux.git Tested: on ampere-mtsnow-altra-11.khw4.lab.eng.bos.redhat.com Signed-off-by: Pingfan Liu piliu@redhat.com

v2 -> v3 backport an extra patch "arm64: kdump: Do not allocate crash low memory if not needed", which is better to have.

v1 -> v2 backport an extra patch "efi: apply memblock cap after memblock_add()", which resolves CKI failures

*** Background ***

There are following issues in arm64 kdump:

  1. We use crashkernel=X to reserve crashkernel below 4G, which will fail when there is no enough low memory.
  2. If reserving crashkernel above 4G, in this case, crash dump kernel will boot failure because there is no low memory available for allocation.

We use "crashkernel=X,high" to select a high region above DMA zone, which also tries to allocate at least 256M low memory in DMA zone automatically and "crashkernel=Y,low" can be used to allocate specified size low memory.

When reserving crashkernel in high memory, some low memory is reserved for crash dump kernel devices. So there may be two regions reserved for crash dump kernel. In order to distinct from the high region and make no effect to the use of existing kexec-tools, rename the low region as "Crash kernel (low)", and pass the low region by reusing DT property "linux,usable-memory-range". We made the low memory region as the last range of "linux,usable-memory-range" to keep compatibility with existing user-space and older kdump kernels.

*** Back ported patches ***

Originally, six patches as the upstream info 1: docs: kdump: Update the crashkernel description for arm64 of: Support more than one crash kernel regions for kexec -s of: fdt: Add memory for devices by DT property "linux,usable-memory-range" arm64: kdump: Reimplement crashkernel=X arm64: Use insert_resource() to simplify code kdump: return -ENOENT if required cmdline option does not exist

are needed to be back ported to support crashkernel=x,high on arm64.

But there are already some preparing patches in linux tree, and some dependencies. So finally, twenty-six patches are back ported. Besides the original series, the other patches can be divided into two groups.

For commit "arm64: kdump: Reimplement crashkernel=X", back porting the following patches: arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef arm64: mm: Drop 'const' from conditional arm64_dma_phys_limit definition arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones arm64: kdump: Remove custom linux,usable-memory-range handling arm64: kdump: Remove custom linux,elfcorehdr handling

For commit "of: fdt: Add memory for devices by DT property "linux,usable-memory-range", back porting the following patches: of/fdt: move elfcorehdr reservation early for crash dump kernel of/fdt: Don't worry about non-memory region overlap for no-map of: fdt: Aggregate the processing of "linux,usable-memory-range" of/fdt: Rework early_init_dt_scan_memory() to call directly of/fdt: Rework early_init_dt_scan_root() to call directly of/fdt: Rework early_init_dt_scan_chosen() to call directly of/fdt: Remove of_scan_flat_dt() usage for __fdt_scan_reserved_mem() of: fdt: Rename reserve_elfcorehdr() to fdt_reserve_elfcorehdr() of: fdt: Use IS_ENABLED(CONFIG_BLK_DEV_INITRD) instead of #ifdef of: fdt: Add generic support for handling usable memory range property of: fdt: Add generic support for handling elf core headers property of: fdt: Remove weak early_init_dt_mark_hotplug_memory_arch() of: fdt: Remove early_init_dt_reserve_memory_arch() override capability of: fdt: do not update local variable after use of: fdt: remove unnecessary codes

Edited by Pingfan Liu

Merge request reports