[PATCH v4 3/3] ARM: Use generic interface to simplify crashkernel reservation

Baoquan He bhe at redhat.com
Sun Jul 21 18:38:19 PDT 2024


On 07/19/24 at 05:57pm, Jinjie Ruan wrote:
> Currently, x86, arm64, riscv and loongarch has been switched to generic
> crashkernel reservation, which is also ready for 32bit system.
> So with the help of function parse_crashkernel() and generic
> reserve_crashkernel_generic(), arm32 crashkernel reservation can also
> be simplified by steps:
> 
> 1) Add a new header file <asm/crash_reserve.h>, and define CRASH_ALIGN,
>    CRASH_ADDR_LOW_MAX, CRASH_ADDR_HIGH_MAX in it;
> 
> 2) Add arch_reserve_crashkernel() to call parse_crashkernel() and
>    reserve_crashkernel_generic();
> 
> 3) Add ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION Kconfig in
>    arch/arm/Kconfig.
> 
> The old reserve_crashkernel() can be removed.
> 
> Following test cases have been performed as expected on QEMU vexpress-a9
> (1GB system memory):
> 
> 1) crashkernel=4G,high				// invalid
> 2) crashkernel=1G,high				// invalid
> 3) crashkernel=1G,high crashkernel=0M,low	// invalid
> 4) crashkernel=256M,high			// invalid
> 5) crashkernel=256M,low				// invalid
> 6) crashkernel=256M crashkernel=256M,high	// high is ignored, ok
> 7) crashkernel=256M crashkernel=256M,low	// low is ignored, ok
> 8) crashkernel=256M,high crashkernel=256M,low	// invalid
> 9) crashkernel=256M,high crashkernel=4G,low	// invalid
> 10) crashkernel=256M				// ok
> 11) crashkernel=512M				// ok
> 12) crashkernel=256M at 0x88000000			// ok
> 13) crashkernel=256M at 0x78000000			// ok
> 14) crashkernel=512M at 0x78000000			// ok
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
> ---
> v4:
> - Remove the Tested-by as suggested.
> v3:
> - Update the commit message.
> ---
>  arch/arm/Kconfig                     |  3 ++
>  arch/arm/include/asm/crash_reserve.h | 24 +++++++++++
>  arch/arm/kernel/setup.c              | 63 ++++------------------------
>  3 files changed, 36 insertions(+), 54 deletions(-)
>  create mode 100644 arch/arm/include/asm/crash_reserve.h

LGTM,

Acked-by: Baoquan He <bhe at redhat.com>

By the way, you may need respost the parsed crashkernel value limitation
checking patch for arm32 and i386.




More information about the linux-arm-kernel mailing list