mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS
@ 2026-02-21  2:42 Jisheng Zhang
  2026-08-21  2:28 ` Paul Walmsley
  0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2026-02-21  2:42 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: linux-riscv, linux-kernel

x86 did this in commit b0a848f4a47a ("x86/bugs: Make i386 use
GENERIC_BUG_RELATIVE_POINTERS")

powerpc did this in commit 1baa1f70ef77 ("powerpc: Allow relative
pointers in bug table entries")

Similar as x86 and powerpc does, make RV32 use
GENERIC_BUG_RELATIVE_POINTERS for "there is only one code path." and
"less #ifdef is more better".

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/Kconfig           | 2 +-
 arch/riscv/include/asm/bug.h | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 90c531e6abf5..d0c8ffed1992 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -324,7 +324,7 @@ config STACKTRACE_SUPPORT
 config GENERIC_BUG
 	def_bool y
 	depends on BUG
-	select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
+	select GENERIC_BUG_RELATIVE_POINTERS
 
 config GENERIC_BUG_RELATIVE_POINTERS
 	bool
diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
index 6f581b84d8fc..699c0cf3e4ef 100644
--- a/arch/riscv/include/asm/bug.h
+++ b/arch/riscv/include/asm/bug.h
@@ -29,13 +29,8 @@
 
 typedef u32 bug_insn_t;
 
-#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
 #define __BUG_ENTRY_ADDR	RISCV_INT " 1b - ."
 #define __BUG_ENTRY_FILE(file)	RISCV_INT " " file " - ."
-#else
-#define __BUG_ENTRY_ADDR	RISCV_PTR " 1b"
-#define __BUG_ENTRY_FILE(file)	RISCV_PTR " " file
-#endif
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 #define __BUG_ENTRY(file, line, flags)	\
-- 
2.51.0


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

* Re: [PATCH] riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS
  2026-02-21  2:42 [PATCH] riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS Jisheng Zhang
@ 2026-08-21  2:28 ` Paul Walmsley
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Walmsley @ 2026-08-21  2:28 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-riscv, linux-kernel

On Sat, 21 Feb 2026, Jisheng Zhang wrote:

> x86 did this in commit b0a848f4a47a ("x86/bugs: Make i386 use
> GENERIC_BUG_RELATIVE_POINTERS")
> 
> powerpc did this in commit 1baa1f70ef77 ("powerpc: Allow relative
> pointers in bug table entries")
> 
> Similar as x86 and powerpc does, make RV32 use
> GENERIC_BUG_RELATIVE_POINTERS for "there is only one code path." and
> "less #ifdef is more better".
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

Thanks, queued for v7.3-rc.


- Paul

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

end of thread, other threads:[~2026-08-21  2:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-21  2:42 [PATCH] riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS Jisheng Zhang
2026-08-21  2:28 ` 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®