stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
@ 2024-04-30  3:24 Mingzheng Xing
  2024-04-30  3:39 ` Baoquan He
  0 siblings, 1 reply; 4+ messages in thread
From: Mingzheng Xing @ 2024-04-30  3:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, stable; +Cc: Baoquan He, Mingzheng Xing, Chen Jiahao

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>
---

v1 -> v2:

- Changed the commit message
- Added Cc:

v1:
https://lore.kernel.org/stable/20240416085647.14376-1-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] 4+ messages in thread

* Re: [PATCH v2] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
  2024-04-30  3:24 [PATCH v2] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V" Mingzheng Xing
@ 2024-04-30  3:39 ` Baoquan He
  2024-04-30  3:51   ` Mingzheng Xing
  0 siblings, 1 reply; 4+ messages in thread
From: Baoquan He @ 2024-04-30  3:39 UTC (permalink / raw)
  To: Mingzheng Xing; +Cc: Greg Kroah-Hartman, stable, Chen Jiahao

On 04/30/24 at 11:24am, Mingzheng Xing wrote:
> 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>

Ack. This is necessary for v6.6.y stable branch.

Acked-by: Baoquan He <bhe@redhat.com>

> ---
> 
> v1 -> v2:
> 
> - Changed the commit message
> - Added Cc:
> 
> v1:
> https://lore.kernel.org/stable/20240416085647.14376-1-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	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
  2024-04-30  3:39 ` Baoquan He
@ 2024-04-30  3:51   ` Mingzheng Xing
  2024-04-30  7:54     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Mingzheng Xing @ 2024-04-30  3:51 UTC (permalink / raw)
  To: Baoquan He; +Cc: Greg Kroah-Hartman, stable, Chen Jiahao

On 4/30/24 11:39, Baoquan He wrote:
> On 04/30/24 at 11:24am, Mingzheng Xing wrote:
>> 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>
> 
> Ack. This is necessary for v6.6.y stable branch.
> 
> Acked-by: Baoquan He <bhe@redhat.com>
> 

Thanks,

Hi, Greg. This is for the 6.6.y branch only.

>> ---
>>
>> v1 -> v2:
>>
>> - Changed the commit message
>> - Added Cc:
>>
>> v1:
>> https://lore.kernel.org/stable/20240416085647.14376-1-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	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V"
  2024-04-30  3:51   ` Mingzheng Xing
@ 2024-04-30  7:54     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-04-30  7:54 UTC (permalink / raw)
  To: Mingzheng Xing; +Cc: Baoquan He, stable, Chen Jiahao

On Tue, Apr 30, 2024 at 11:51:53AM +0800, Mingzheng Xing wrote:
> On 4/30/24 11:39, Baoquan He wrote:
> > On 04/30/24 at 11:24am, Mingzheng Xing wrote:
> >> 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>
> > 
> > Ack. This is necessary for v6.6.y stable branch.
> > 
> > Acked-by: Baoquan He <bhe@redhat.com>
> > 
> 
> Thanks,
> 
> Hi, Greg. This is for the 6.6.y branch only.

Thanks, now queued up.

greg k-h

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30  3:24 [PATCH v2] Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V" Mingzheng Xing
2024-04-30  3:39 ` Baoquan He
2024-04-30  3:51   ` Mingzheng Xing
2024-04-30  7:54     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).