aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMingzheng Xing <xingmingzheng@iscas.ac.cn>2024-04-30 11:24:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-02 16:32:50 +0200
commitbbc8486eb230ea29ded9982ece744a4b6640662e (patch)
tree56fa29493c7124aae92c1c4504e04e72e1b9e98b
parentbe9857a4d280bc5d6f9fdfc134918a7f13dda9ae (diff)
Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
This reverts commit 1d6cd2146c2b58bc91266db1d5d6a5f9632e14c0 which was mistakenly added into v6.6.y and the commit corresponding to the 'Fixes:' tag is invalid. For more information, see link [1]. This will result in the loss of Crashkernel data in /proc/iomem, and kdump failed: ``` Memory for crashkernel is not reserved Please reserve memory by passing"crashkernel=Y@X" parameter to kernel Then try to loading kdump kernel ``` After revert, kdump works fine. Tested on QEMU riscv. Link: https://lore.kernel.org/linux-riscv/ZSiQRDGLZk7lpakE@MiWiFi-R3L-srv [1] Cc: Baoquan He <bhe@redhat.com> Cc: Chen Jiahao <chenjiahao16@huawei.com> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn> Acked-by: Baoquan He <bhe@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/riscv/kernel/setup.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index aac853ae4eb7..e600aab116a4 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -173,6 +173,19 @@ static void __init init_resources(void)
if (ret < 0)
goto error;
+#ifdef CONFIG_KEXEC_CORE
+ if (crashk_res.start != crashk_res.end) {
+ ret = add_resource(&iomem_resource, &crashk_res);
+ if (ret < 0)
+ goto error;
+ }
+ if (crashk_low_res.start != crashk_low_res.end) {
+ ret = add_resource(&iomem_resource, &crashk_low_res);
+ if (ret < 0)
+ goto error;
+ }
+#endif
+
#ifdef CONFIG_CRASH_DUMP
if (elfcorehdr_size > 0) {
elfcorehdr_res.start = elfcorehdr_addr;