mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: unconditionally select ARCH_KEEP_MEMBLOCK
@ 2026-05-19 16:55 Han Gao
  2026-05-21 22:04 ` Paul Walmsley
  0 siblings, 1 reply; 4+ messages in thread
From: Han Gao @ 2026-05-19 16:55 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: linux-riscv, linux-kernel, Han Gao, Han Gao

Select ARCH_KEEP_MEMBLOCK unconditionally. kexec requires memblock
to be kept after boot to initialize the secondary kernel. Device
Tree platforms also need this for kexec support.

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c5754942cf85..e2a052257176 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -55,7 +55,7 @@ config RISCV
 	select ARCH_HAS_UBSAN
 	select ARCH_HAS_VDSO_ARCH_DATA if HAVE_GENERIC_VDSO
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
-	select ARCH_KEEP_MEMBLOCK if ACPI
+	select ARCH_KEEP_MEMBLOCK
 	select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE	if 64BIT && MMU
 	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
-- 
2.47.3


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

* Re: [PATCH] riscv: unconditionally select ARCH_KEEP_MEMBLOCK
  2026-05-19 16:55 [PATCH] riscv: unconditionally select ARCH_KEEP_MEMBLOCK Han Gao
@ 2026-05-21 22:04 ` Paul Walmsley
  2026-05-25 13:20   ` Han Gao
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Walmsley @ 2026-05-21 22:04 UTC (permalink / raw)
  To: Han Gao
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-riscv, linux-kernel, Han Gao

On Wed, 20 May 2026, Han Gao wrote:

> Select ARCH_KEEP_MEMBLOCK unconditionally. kexec requires memblock
> to be kept after boot to initialize the secondary kernel. Device
> Tree platforms also need this for kexec support.
> 
> Signed-off-by: Han Gao <gaohan@iscas.ac.cn>

Thanks for the patch.  If this patch is just about kexec, shouldn't 
ARCH_SELECTS_KEXEC just be changed to select ARCH_KEEP_MEMBLOCK?


- Paul

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

* Re: [PATCH] riscv: unconditionally select ARCH_KEEP_MEMBLOCK
  2026-05-21 22:04 ` Paul Walmsley
@ 2026-05-25 13:20   ` Han Gao
  2026-05-28  1:01     ` Paul Walmsley
  0 siblings, 1 reply; 4+ messages in thread
From: Han Gao @ 2026-05-25 13:20 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Han Gao, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, linux-riscv,
	linux-kernel, Vivian Wang

On Fri, May 22, 2026 at 6:04 AM Paul Walmsley <pjw@kernel.org> wrote:
>
> On Wed, 20 May 2026, Han Gao wrote:
>
> > Select ARCH_KEEP_MEMBLOCK unconditionally. kexec requires memblock
> > to be kept after boot to initialize the secondary kernel. Device
> > Tree platforms also need this for kexec support.
> >
> > Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
>
> Thanks for the patch.  If this patch is just about kexec, shouldn't
> ARCH_SELECTS_KEXEC just be changed to select ARCH_KEEP_MEMBLOCK?
It's currently aligned with the arm64 architecture. If so, should we
modify it accordingly?

>
>
> - Paul

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

* Re: [PATCH] riscv: unconditionally select ARCH_KEEP_MEMBLOCK
  2026-05-25 13:20   ` Han Gao
@ 2026-05-28  1:01     ` Paul Walmsley
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Walmsley @ 2026-05-28  1:01 UTC (permalink / raw)
  To: Han Gao
  Cc: Paul Walmsley, Han Gao, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, linux-riscv, linux-kernel, Vivian Wang

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

On Mon, 25 May 2026, Han Gao wrote:

> On Fri, May 22, 2026 at 6:04 AM Paul Walmsley <pjw@kernel.org> wrote:
> >
> > On Wed, 20 May 2026, Han Gao wrote:
> >
> > > Select ARCH_KEEP_MEMBLOCK unconditionally. kexec requires memblock
> > > to be kept after boot to initialize the secondary kernel. Device
> > > Tree platforms also need this for kexec support.
> > >
> > > Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
> >
> > Thanks for the patch.  If this patch is just about kexec, shouldn't
> > ARCH_SELECTS_KEXEC just be changed to select ARCH_KEEP_MEMBLOCK?
> It's currently aligned with the arm64 architecture. If so, should we
> modify it accordingly?

If the motivation for adding it this way is to match arm64, then the patch 
description would need to be updated accordingly; it doesn't say anything 
about that.  I'm not sure that's a sufficient rationale, on its own.

On the other hand, if the rationale for this change is that it fixes an 
issue when kexec is used, then I guess I don't understand why we wouldn't 
make it dependent on ARCH_SELECTS_KEXEC?  It can always be patched again 
if more use cases are discovered, right?


- Paul

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

end of thread, other threads:[~2026-05-28  1:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19 16:55 [PATCH] riscv: unconditionally select ARCH_KEEP_MEMBLOCK Han Gao
2026-05-21 22:04 ` Paul Walmsley
2026-05-25 13:20   ` Han Gao
2026-05-28  1:01     ` Paul Walmsley

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

all inboxes | Powered by JetHome®