Re: [PATCH v4 2/3] ARM: Fix crash memory reserve exceed system memory bug

From: Russell King (Oracle)
Date: Mon Jul 29 2024 - 07:15:15 EST


On Mon, Jul 22, 2024 at 11:57:00AM +0800, Jinjie Ruan wrote:
> Similar with x86_32, on Qemu vexpress-a9 with 1GB memory, the crash kernel
> "crashkernel=4G" is ok as below:
> Reserving 4096MB of memory at 2432MB for crashkernel (System RAM: 1024MB)
>
> The cause is that the crash_size is parsed and printed with "unsigned long
> long" data type which is 8 bytes but allocated used with "phys_addr_t"
> which is 4 bytes in memblock_phys_alloc_range().
>
> Fix it by checking if the crash_size is greater than system RAM size and
> warn out as parse_crashkernel_mem() do it if so as Baoquan suggested.
>
> After this patch, it fails and there is no above confusing reserve
> success info.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> Suggested-by: Baoquan He <bhe@xxxxxxxxxx>

Reviewed-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>

Thanks!

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!