public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
@ 2024-04-16  8:56 Mingzheng Xing
  2024-04-19 10:44 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 12+ messages in thread
From: Mingzheng Xing @ 2024-04-16  8:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, Mingzheng Xing

This reverts commit 1d6cd2146c2b58bc91266db1d5d6a5f9632e14c0 which has been
merged into the mainline commit 39365395046f ("riscv: kdump: use generic
interface to simplify crashkernel reservation"), but the latter's series of
patches are not included in the 6.6 branch.

This will result in the loss of Crash kernel data in /proc/iomem, and kdump
loading the kernel will also cause an error:

```
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 this patch, verify that it works properly on QEMU riscv.

Link: https://lore.kernel.org/linux-riscv/ZSiQRDGLZk7lpakE@MiWiFi-R3L-srv
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
---
 arch/riscv/kernel/setup.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index aac853ae4eb74..e600aab116a40 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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-30  3:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16  8:56 [PATCH] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V" Mingzheng Xing
2024-04-19 10:44 ` Greg Kroah-Hartman
2024-04-19 12:26   ` Mingzheng Xing
2024-04-19 13:58     ` Greg Kroah-Hartman
2024-04-19 14:55       ` Mingzheng Xing
2024-04-23 13:12         ` Greg Kroah-Hartman
2024-04-24  3:40           ` Mingzheng Xing
2024-04-29 10:52             ` Greg Kroah-Hartman
2024-04-30  0:02               ` Baoquan He
2024-04-30  3:42                 ` Mingzheng Xing
2024-04-24  1:06         ` Baoquan He
2024-04-24  5:18           ` Mingzheng Xing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox