Skip to contentSkip to conversation

riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS

PATCH In review Jisheng Zhang 2 participants 2 messages Feb 21 – Aug 21 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: bug: Make RV32 use GENERIC_BUG_RELATIVE_POINTERS

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

---
 arch/riscv/Kconfig           | 2 +-
 arch/riscv/include/asm/bug.h | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)
arch/riscv/Kconfig +1 -1
index 90c531e6abf5..d0c8ffed1992 100644
@@ -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
arch/riscv/include/asm/bug.h +0 -5
index 6f581b84d8fc..699c0cf3e4ef 100644
@@ -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)	\
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 11 lines · Jisheng Zhang

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

Thanks, queued for v7.3-rc.

- Paul