Commit 8e51c01a authored by Mingzheng Xing's avatar Mingzheng Xing Committed by Ma Wupeng
Browse files

Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"

stable inclusion
from stable-v6.6.30
commit bbc8486eb230ea29ded9982ece744a4b6640662e
bugzilla: https://gitee.com/openeuler/kernel/issues/I9MPZ8

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bbc8486eb230ea29ded9982ece744a4b6640662e

--------------------------------

This reverts commit 1d6cd214 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: default avatarMingzheng Xing <xingmingzheng@iscas.ac.cn>
Acked-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 1db49495
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -172,6 +172,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;