linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] NDS32: export __trace_hardirqs_on/_offf for entry/exit
@ 2022-02-17 19:13 Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2022-02-17 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Nick Hu, Vincent Chen, Alan Kao, KC

Add exports for __trace_hardirqs_on/_off and use them in
kernel/ex-entry.S and kernel/ex-exit.S to fix build/linker errors.

nds32le-linux-ld: arch/nds32/kernel/ex-entry.o: in function `fucop_ctl_done':
(.text+0x12a): undefined reference to `__trace_hardirqs_off'
nds32le-linux-ld: arch/nds32/kernel/ex-exit.o: in function `no_work_pending':
(.text+0xea): undefined reference to `__trace_hardirqs_off'
nds32le-linux-ld: (.text+0xee): undefined reference to `__trace_hardirqs_off'
nds32le-linux-ld: (.text+0xf2): undefined reference to `__trace_hardirqs_on'
nds32le-linux-ld: (.text+0xf6): undefined reference to `__trace_hardirqs_on'

Fixes: 0cde56e0280d ("nds32: Fix a kernel panic issue because of wrong frame pointer access.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Alan Kao <alankao@andestech.com>
Cc: KC <kclin@andestech.com>
---
v2: move the functions from ftrace.c to irq.c;
    #include <asm/irqflags.h> instead of <asm/ftrace.h>;
#Cc: Greentime Hu <green.hu@gmail.com>

 arch/nds32/include/asm/irqflags.h |    3 +++
 arch/nds32/kernel/ex-entry.S      |    1 +
 arch/nds32/kernel/ex-exit.S       |    2 +-
 arch/nds32/kernel/ftrace.c        |   12 ------------
 arch/nds32/kernel/irq.c           |   14 ++++++++++++++
 5 files changed, 19 insertions(+), 13 deletions(-)

--- linux-next-20220216.orig/arch/nds32/kernel/ftrace.c
+++ linux-next-20220216/arch/nds32/kernel/ftrace.c
@@ -264,15 +264,3 @@ int ftrace_disable_ftrace_graph_caller(v
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
-
-
-#ifdef CONFIG_TRACE_IRQFLAGS
-noinline void __trace_hardirqs_off(void)
-{
-	trace_hardirqs_off();
-}
-noinline void __trace_hardirqs_on(void)
-{
-	trace_hardirqs_on();
-}
-#endif /* CONFIG_TRACE_IRQFLAGS */
--- linux-next-20220216.orig/arch/nds32/kernel/ex-entry.S
+++ linux-next-20220216/arch/nds32/kernel/ex-entry.S
@@ -8,6 +8,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/fpu.h>
+#include <asm/irqflags.h>
 
 #ifdef CONFIG_HWZOL
 	.macro push_zol
--- linux-next-20220216.orig/arch/nds32/kernel/ex-exit.S
+++ linux-next-20220216/arch/nds32/kernel/ex-exit.S
@@ -9,7 +9,7 @@
 #include <asm/thread_info.h>
 #include <asm/current.h>
 #include <asm/fpu.h>
-
+#include <asm/irqflags.h>
 
 
 #ifdef CONFIG_HWZOL
--- linux-next-20220216.orig/arch/nds32/include/asm/irqflags.h
+++ linux-next-20220216/arch/nds32/include/asm/irqflags.h
@@ -39,3 +39,6 @@ static inline int arch_irqs_disabled(voi
 {
 	return arch_irqs_disabled_flags(arch_local_save_flags());
 }
+
+void __trace_hardirqs_off(void);
+void __trace_hardirqs_on(void);
--- linux-next-20220216.orig/arch/nds32/kernel/irq.c
+++ linux-next-20220216/arch/nds32/kernel/irq.c
@@ -7,3 +7,17 @@ void __init init_IRQ(void)
 {
 	irqchip_init();
 }
+
+#ifdef CONFIG_TRACE_IRQFLAGS
+noinline void __trace_hardirqs_off(void)
+{
+	trace_hardirqs_off();
+}
+EXPORT_SYMBOL(__trace_hardirqs_off);
+
+noinline void __trace_hardirqs_on(void)
+{
+	trace_hardirqs_on();
+}
+EXPORT_SYMBOL(__trace_hardirqs_on);
+#endif /* CONFIG_TRACE_IRQFLAGS */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-17 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 19:13 [PATCH v2] NDS32: export __trace_hardirqs_on/_offf for entry/exit Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).