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

From
Russell King (Oracle) <linux@armlinux.org.uk>
Date
2024-07-29 11:15:09
Also in
linux-riscv, lkml
Reply to
Jinjie Ruan, 2024-07-22
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 <redacted>
Suggested-by: Baoquan He <redacted>
Reviewed-by: Russell King (Oracle) <redacted>

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Thread (10 messages) 10 messages, 3 authors, last reply 2024-07-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help