riscv: kdump: Implement crashkernel=X,[high,low]
authorChen Jiahao <chenjiahao16@huawei.com>
Wed, 26 Jul 2023 17:49:59 +0000 (17:49 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 16 Aug 2023 14:51:48 +0000 (07:51 -0700)
commit5882e5acf18d79d586282acfd07a8c88550e2cee
tree73b1c6c4a0aaaa2f451b8cb4907df7b1d6370532
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
riscv: kdump: Implement crashkernel=X,[high,low]

On riscv, the current crash kernel allocation logic is trying to
allocate within 32bit addressible memory region by default, if
failed, try to allocate without 4G restriction.

In need of saving DMA zone memory while allocating a relatively large
crash kernel region, allocating the reserved memory top down in
high memory, without overlapping the DMA zone, is a mature solution.
Here introduce the parameter option crashkernel=X,[high,low].

One can reserve the crash kernel from high memory above DMA zone range
by explicitly passing "crashkernel=X,high"; or reserve a memory range
below 4G with "crashkernel=X,low".

Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
Acked-by: Guo Ren <guoren@kernel.org>
Acked-by: Baoquan He <bhe@redhat.com>
Link: https://lore.kernel.org/r/20230726175000.2536220-2-chenjiahao16@huawei.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/setup.c
arch/riscv/mm/init.c