summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/ptdump.h
diff options
context:
space:
mode:
authorZong Li <zong.li@sifive.com>2020-06-03 16:03:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-03 20:09:50 -0700
commitb422d28b21773bbfc9e84dbb5579a8ce355279ca (patch)
tree1dbe652d8d959d8d53d0772f85edb772994d75c5 /arch/riscv/include/asm/ptdump.h
parent375d315cbfdb50e1eda099d4d004f7f401285111 (diff)
riscv: support DEBUG_WX
Support DEBUG_WX to check whether there are mapping with write and execute permission at the same time. [akpm@linux-foundation.org: replace macros with C] Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will@kernel.org> Link: http://lkml.kernel.org/r/282e266311bced080bc6f7c255b92f87c1eb65d6.1587455584.git.zong.li@sifive.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/riscv/include/asm/ptdump.h')
-rw-r--r--arch/riscv/include/asm/ptdump.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/ptdump.h b/arch/riscv/include/asm/ptdump.h
index e29af7191909..3c9ea6dd5af7 100644
--- a/arch/riscv/include/asm/ptdump.h
+++ b/arch/riscv/include/asm/ptdump.h
@@ -8,4 +8,15 @@
void ptdump_check_wx(void);
+#ifdef CONFIG_DEBUG_WX
+static inline void debug_checkwx(void)
+{
+ ptdump_check_wx();
+}
+#else
+static inline void debug_checkwx(void)
+{
+}
+#endif
+
#endif /* _ASM_RISCV_PTDUMP_H */