Skip to contentSkip to conversation

tile/jump_label: add jump label support for TILE-Gx

PATCH In review Zhigang Lu 1 participant 1 message Sep 30, 2015

Subsystems (2)
lore
Share & tools
lore

Zhigang Lu

author
#0 lore raw

PATCH 2/2 tile/jump_label: add jump label support for TILE-Gx

Add the arch-specific code to support jump label for TILE-Gx. This code shares NOP instruction with ftrace, so we move it to a common header file.

---
 arch/tile/Kconfig                  |  1 +
 arch/tile/include/asm/insn.h       | 59 +++++++++++++++++++++++++++++++++++
 arch/tile/include/asm/jump_label.h | 58 ++++++++++++++++++++++++++++++++++
 arch/tile/kernel/Makefile          |  1 +
 arch/tile/kernel/ftrace.c          | 11 +------
 arch/tile/kernel/jump_label.c      | 64 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 184 insertions(+), 10 deletions(-)
 create mode 100644 arch/tile/include/asm/insn.h
 create mode 100644 arch/tile/include/asm/jump_label.h
 create mode 100644 arch/tile/kernel/jump_label.c
arch/tile/Kconfig +1 -0
index 106c21b..dff39e2 100644
@@ -33,6 +33,7 @@ config TILE
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
 	select HAVE_ARCH_SECCOMP_FILTER
+	select HAVE_ARCH_JUMP_LABEL
 
 # FIXME: investigate whether we need/want these options.
 #	select HAVE_IOREMAP_PROT
arch/tile/include/asm/insn.h new file +59 -0

59 lines not on this page · raw message

arch/tile/include/asm/jump_label.h new file +58 -0

58 lines not on this page · raw message

arch/tile/kernel/Makefile +1 -0
index 21f77bf..09936d0 100644
@@ -32,5 +32,6 @@ obj-$(CONFIG_TILE_HVGLUE_TRACE)	+= hvglue_trace.o
 obj-$(CONFIG_FUNCTION_TRACER)	+= ftrace.o mcount_64.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
+obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
 
 obj-y				+= vdso/
arch/tile/kernel/ftrace.c +1 -10
index 4180ccdf..4a57208 100644
@@ -20,21 +20,12 @@
 #include <asm/cacheflush.h>
 #include <asm/ftrace.h>
 #include <asm/sections.h>
+#include <asm/insn.h>
 
 #include <arch/opcode.h>
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-static inline tilegx_bundle_bits NOP(void)
-{
-	return create_UnaryOpcodeExtension_X0(FNOP_UNARY_OPCODE_X0) |
-		create_RRROpcodeExtension_X0(UNARY_RRR_0_OPCODE_X0) |
-		create_Opcode_X0(RRR_0_OPCODE_X0) |
-		create_UnaryOpcodeExtension_X1(NOP_UNARY_OPCODE_X1) |
-		create_RRROpcodeExtension_X1(UNARY_RRR_0_OPCODE_X1) |
-		create_Opcode_X1(RRR_0_OPCODE_X1);
-}
-
 static int machine_stopped __read_mostly;
 
 int ftrace_arch_code_modify_prepare(void)
arch/tile/kernel/jump_label.c new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.1.2