public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] riscv: mm: stub extable related functions/macros for !MMU
@ 2023-05-09 15:26 Jisheng Zhang
  2023-06-19 22:07 ` Palmer Dabbelt
  2023-06-20  1:00 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 3+ messages in thread
From: Jisheng Zhang @ 2023-05-09 15:26 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou; +Cc: linux-riscv, linux-kernel

extable relies on the MMU to work properly, so it's useless to
include __ex_table sections and build extable related functions for
!MMU case.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---

Since v1:
 - fix a typo: s/MMU/CONFIG_MMU

 arch/riscv/include/asm/asm-extable.h | 6 ++++++
 arch/riscv/include/asm/extable.h     | 4 ++++
 arch/riscv/mm/Makefile               | 3 +--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/include/asm/asm-extable.h b/arch/riscv/include/asm/asm-extable.h
index 14be0673f5b5..00a96e7a9664 100644
--- a/arch/riscv/include/asm/asm-extable.h
+++ b/arch/riscv/include/asm/asm-extable.h
@@ -7,6 +7,8 @@
 #define EX_TYPE_BPF			2
 #define EX_TYPE_UACCESS_ERR_ZERO	3
 
+#ifdef CONFIG_MMU
+
 #ifdef __ASSEMBLY__
 
 #define __ASM_EXTABLE_RAW(insn, fixup, type, data)	\
@@ -62,4 +64,8 @@
 
 #endif /* __ASSEMBLY__ */
 
+#else /* CONFIG_MMU */
+	#define _ASM_EXTABLE_UACCESS_ERR(insn, fixup, err)
+#endif /* CONFIG_MMU */
+
 #endif /* __ASM_ASM_EXTABLE_H */
diff --git a/arch/riscv/include/asm/extable.h b/arch/riscv/include/asm/extable.h
index 512012d193dc..3eb5c1f7bf34 100644
--- a/arch/riscv/include/asm/extable.h
+++ b/arch/riscv/include/asm/extable.h
@@ -32,7 +32,11 @@ do {							\
 	(b)->data = (tmp).data;				\
 } while (0)
 
+#ifdef CONFIG_MMU
 bool fixup_exception(struct pt_regs *regs);
+#else
+static inline bool fixup_exception(struct pt_regs *regs) { return false; }
+#endif
 
 #if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
 bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs);
diff --git a/arch/riscv/mm/Makefile b/arch/riscv/mm/Makefile
index b85e9e82f082..9c454f90fd3d 100644
--- a/arch/riscv/mm/Makefile
+++ b/arch/riscv/mm/Makefile
@@ -13,8 +13,7 @@ endif
 KCOV_INSTRUMENT_init.o := n
 
 obj-y += init.o
-obj-y += extable.o
-obj-$(CONFIG_MMU) += fault.o pageattr.o
+obj-$(CONFIG_MMU) += extable.o fault.o pageattr.o
 obj-y += cacheflush.o
 obj-y += context.o
 obj-y += pgtable.o
-- 
2.40.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2] riscv: mm: stub extable related functions/macros for !MMU
  2023-05-09 15:26 [PATCH v2] riscv: mm: stub extable related functions/macros for !MMU Jisheng Zhang
@ 2023-06-19 22:07 ` Palmer Dabbelt
  2023-06-20  1:00 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 3+ messages in thread
From: Palmer Dabbelt @ 2023-06-19 22:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Jisheng Zhang
  Cc: linux-riscv, linux-kernel


On Tue, 09 May 2023 23:26:41 +0800, Jisheng Zhang wrote:
> extable relies on the MMU to work properly, so it's useless to
> include __ex_table sections and build extable related functions for
> !MMU case.
> 
> 

Applied, thanks!

[1/1] riscv: mm: stub extable related functions/macros for !MMU
      https://git.kernel.org/palmer/c/de658bcf0333

Best regards,
-- 
Palmer Dabbelt <palmer@rivosinc.com>


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2] riscv: mm: stub extable related functions/macros for !MMU
  2023-05-09 15:26 [PATCH v2] riscv: mm: stub extable related functions/macros for !MMU Jisheng Zhang
  2023-06-19 22:07 ` Palmer Dabbelt
@ 2023-06-20  1:00 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2023-06-20  1:00 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: linux-riscv, paul.walmsley, palmer, aou, linux-kernel

Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue,  9 May 2023 23:26:41 +0800 you wrote:
> extable relies on the MMU to work properly, so it's useless to
> include __ex_table sections and build extable related functions for
> !MMU case.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> 
> [...]

Here is the summary with links:
  - [v2] riscv: mm: stub extable related functions/macros for !MMU
    https://git.kernel.org/riscv/c/de658bcf0333

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2023-06-20  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09 15:26 [PATCH v2] riscv: mm: stub extable related functions/macros for !MMU Jisheng Zhang
2023-06-19 22:07 ` Palmer Dabbelt
2023-06-20  1:00 ` patchwork-bot+linux-riscv

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