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

Linus Walleij linus.walleij at linaro.org
Mon Aug 5 00:51:56 PDT 2024


On Thu, Jul 18, 2024 at 5:51 AM Jinjie Ruan <ruanjinjie at huawei.com> 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>
> Tested-by: Jinjie Ruan <ruanjinjie at huawei.com>
> ---
> v3:
> - Update the commit message.

I haven't used crash much but it looks right to my untrained eye.
Acked-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij



More information about the linux-riscv mailing list