]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: probes: move all probe code to dedicate directory
authorWang Nan <wangnan0@huawei.com>
Fri, 9 Jan 2015 02:19:49 +0000 (10:19 +0800)
committerJon Medhurst <tixy@linaro.org>
Fri, 9 Jan 2015 09:36:50 +0000 (09:36 +0000)
In discussion on LKML (https://lkml.org/lkml/2014/11/28/158), Russell
King suggests to move all probe related code to arch/arm/probes. This
patch does the work. Due to dependency on 'arch/arm/kernel/patch.h', this
patch also moves patch.h to 'arch/arm/include/asm/patch.h', and related
'#include' directives are also midified to '#include <asm/patch.h>'.

Following is an overview of this patch:

 ./arch/arm/kernel/               ./arch/arm/probes/
 |-- Makefile                     |-- Makefile
 |-- probes-arm.c          ==>    |-- decode-arm.c
 |-- probes-arm.h          ==>    |-- decode-arm.h
 |-- probes-thumb.c        ==>    |-- decode-thumb.c
 |-- probes-thumb.h        ==>    |-- decode-thumb.h
 |-- probes.c              ==>    |-- decode.c
 |-- probes.h              ==>    |-- decode.h
 |                                |-- kprobes
 |                                |   |-- Makefile
 |-- kprobes-arm.c         ==>    |   |-- actions-arm.c
 |-- kprobes-common.c      ==>    |   |-- actions-common.c
 |-- kprobes-thumb.c       ==>    |   |-- actions-thumb.c
 |-- kprobes.c             ==>    |   |-- core.c
 |-- kprobes.h             ==>    |   |-- core.h
 |-- kprobes-test-arm.c    ==>    |   |-- test-arm.c
 |-- kprobes-test.c        ==>    |   |-- test-core.c
 |-- kprobes-test.h        ==>    |   |-- test-core.h
 |-- kprobes-test-thumb.c  ==>    |   `-- test-thumb.c
 |                                `-- uprobes
 |                                    |-- Makefile
 |-- uprobes-arm.c         ==>        |-- actions-arm.c
 |-- uprobes.c             ==>        |-- core.c
 |-- uprobes.h             ==>        `-- core.h
 |
 `-- patch.h               ==>    arch/arm/include/asm/patch.h

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
27 files changed:
arch/arm/Makefile
arch/arm/include/asm/patch.h [moved from arch/arm/kernel/patch.h with 100% similarity]
arch/arm/kernel/Makefile
arch/arm/kernel/jump_label.c
arch/arm/kernel/kgdb.c
arch/arm/kernel/patch.c
arch/arm/probes/Makefile [new file with mode: 0644]
arch/arm/probes/decode-arm.c [moved from arch/arm/kernel/probes-arm.c with 99% similarity]
arch/arm/probes/decode-arm.h [moved from arch/arm/kernel/probes-arm.h with 97% similarity]
arch/arm/probes/decode-thumb.c [moved from arch/arm/kernel/probes-thumb.c with 99% similarity]
arch/arm/probes/decode-thumb.h [moved from arch/arm/kernel/probes-thumb.h with 97% similarity]
arch/arm/probes/decode.c [moved from arch/arm/kernel/probes.c with 99% similarity]
arch/arm/probes/decode.h [moved from arch/arm/kernel/probes.h with 99% similarity]
arch/arm/probes/kprobes/Makefile [new file with mode: 0644]
arch/arm/probes/kprobes/actions-arm.c [moved from arch/arm/kernel/kprobes-arm.c with 99% similarity]
arch/arm/probes/kprobes/actions-common.c [moved from arch/arm/kernel/kprobes-common.c with 98% similarity]
arch/arm/probes/kprobes/actions-thumb.c [moved from arch/arm/kernel/kprobes-thumb.c with 99% similarity]
arch/arm/probes/kprobes/core.c [moved from arch/arm/kernel/kprobes.c with 99% similarity]
arch/arm/probes/kprobes/core.h [moved from arch/arm/kernel/kprobes.h with 96% similarity]
arch/arm/probes/kprobes/test-arm.c [moved from arch/arm/kernel/kprobes-test-arm.c with 99% similarity]
arch/arm/probes/kprobes/test-core.c [moved from arch/arm/kernel/kprobes-test.c with 99% similarity]
arch/arm/probes/kprobes/test-core.h [moved from arch/arm/kernel/kprobes-test.h with 99% similarity]
arch/arm/probes/kprobes/test-thumb.c [moved from arch/arm/kernel/kprobes-test-thumb.c with 99% similarity]
arch/arm/probes/uprobes/Makefile [new file with mode: 0644]
arch/arm/probes/uprobes/actions-arm.c [moved from arch/arm/kernel/uprobes-arm.c with 98% similarity]
arch/arm/probes/uprobes/core.c [moved from arch/arm/kernel/uprobes.c with 98% similarity]
arch/arm/probes/uprobes/core.h [moved from arch/arm/kernel/uprobes.h with 100% similarity]

index c1785eec2cf772e582b48fade2b7694748d381cb..7f99cd652203ce5705b22f5f0fc24f0574a82840 100644 (file)
@@ -266,6 +266,7 @@ core-$(CONFIG_KVM_ARM_HOST)         += arch/arm/kvm/
 
 # If we have a machine-specific directory, then include it in the build.
 core-y                         += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
+core-y                         += arch/arm/probes/
 core-y                         += arch/arm/net/
 core-y                         += arch/arm/crypto/
 core-y                         += arch/arm/firmware/
index fb2b71ebe3f22a2823107d5d7317693141ba3cdc..9c51a433e0255246e2fdd2553c78ad739ca0d2de 100644 (file)
@@ -51,20 +51,8 @@ obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER)    += ftrace.o insn.o
 obj-$(CONFIG_JUMP_LABEL)       += jump_label.o insn.o patch.o
 obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
-obj-$(CONFIG_UPROBES)          += probes.o probes-arm.o uprobes.o uprobes-arm.o
-obj-$(CONFIG_KPROBES)          += probes.o kprobes.o kprobes-common.o patch.o
-ifdef CONFIG_THUMB2_KERNEL
-obj-$(CONFIG_KPROBES)          += kprobes-thumb.o probes-thumb.o
-else
-obj-$(CONFIG_KPROBES)          += kprobes-arm.o probes-arm.o
-endif
-obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
-test-kprobes-objs              := kprobes-test.o
-ifdef CONFIG_THUMB2_KERNEL
-test-kprobes-objs              += kprobes-test-thumb.o
-else
-test-kprobes-objs              += kprobes-test-arm.o
-endif
+# Main staffs in KPROBES are in arch/arm/probes/ .
+obj-$(CONFIG_KPROBES)          += patch.o
 obj-$(CONFIG_OABI_COMPAT)      += sys_oabi-compat.o
 obj-$(CONFIG_ARM_THUMBEE)      += thumbee.o
 obj-$(CONFIG_KGDB)             += kgdb.o patch.o
index afeeb9ea6f439ebeb515bdea4b3acf0962a5b687..d8da075959bf384a3a1303e0bb8ac76d562d83ae 100644 (file)
@@ -1,8 +1,8 @@
 #include <linux/kernel.h>
 #include <linux/jump_label.h>
+#include <asm/patch.h>
 
 #include "insn.h"
-#include "patch.h"
 
 #ifdef HAVE_JUMP_LABEL
 
index 07db2f8a1b4505b09eb4633488d7167bb695f669..a6ad93c9bce35ea33185bbb5abb2e61867a09173 100644 (file)
 #include <linux/kgdb.h>
 #include <linux/uaccess.h>
 
+#include <asm/patch.h>
 #include <asm/traps.h>
 
-#include "patch.h"
-
 struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] =
 {
        { "r0", 4, offsetof(struct pt_regs, ARM_r0)},
index 5038960e3c55abc1dc9744808f7c8c9d44eca290..69bda1a5707ee826ededa348a90a55c394ad8613 100644 (file)
@@ -8,8 +8,7 @@
 #include <asm/fixmap.h>
 #include <asm/smp_plat.h>
 #include <asm/opcodes.h>
-
-#include "patch.h"
+#include <asm/patch.h>
 
 struct patch {
        void *addr;
diff --git a/arch/arm/probes/Makefile b/arch/arm/probes/Makefile
new file mode 100644 (file)
index 0000000..aa1f859
--- /dev/null
@@ -0,0 +1,7 @@
+obj-$(CONFIG_UPROBES)          += decode.o decode-arm.o uprobes/
+obj-$(CONFIG_KPROBES)          += decode.o kprobes/
+ifdef CONFIG_THUMB2_KERNEL
+obj-$(CONFIG_KPROBES)          += decode-thumb.o
+else
+obj-$(CONFIG_KPROBES)          += decode-arm.o
+endif
similarity index 99%
rename from arch/arm/kernel/probes-arm.c
rename to arch/arm/probes/decode-arm.c
index 8eaef81d8344959cc143732b2d39145349e6b4a4..e39cc75952f2797ee3e604a03c84035c821887a0 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * arch/arm/kernel/probes-arm.c
+ *
+ * arch/arm/probes/decode-arm.c
  *
  * Some code moved here from arch/arm/kernel/kprobes-arm.c
  *
@@ -20,8 +21,8 @@
 #include <linux/stddef.h>
 #include <linux/ptrace.h>
 
-#include "probes.h"
-#include "probes-arm.h"
+#include "decode.h"
+#include "decode-arm.h"
 
 #define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
 
similarity index 97%
rename from arch/arm/kernel/probes-arm.h
rename to arch/arm/probes/decode-arm.h
index ace6572f6e26a22da1be811b81c2e2e480105652..9c56b40d6a5713e40725bc5fc7983a292f6f58fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/probes-arm.h
+ * arch/arm/probes/decode-arm.h
  *
  * Copyright 2013 Linaro Ltd.
  * Written by: David A. Long
@@ -15,6 +15,8 @@
 #ifndef _ARM_KERNEL_PROBES_ARM_H
 #define  _ARM_KERNEL_PROBES_ARM_H
 
+#include "decode.h"
+
 enum probes_arm_action {
        PROBES_EMULATE_NONE,
        PROBES_SIMULATE_NOP,
similarity index 99%
rename from arch/arm/kernel/probes-thumb.c
rename to arch/arm/probes/decode-thumb.c
index 4131351e812f47a876a448e7c62461c5b3b2acff..2f0453a895dc611743292084f0a46f36f106793a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/probes-thumb.c
+ * arch/arm/probes/decode-thumb.c
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
@@ -12,8 +12,8 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 
-#include "probes.h"
-#include "probes-thumb.h"
+#include "decode.h"
+#include "decode-thumb.h"
 
 
 static const union decode_item t32_table_1110_100x_x0xx[] = {
similarity index 97%
rename from arch/arm/kernel/probes-thumb.h
rename to arch/arm/probes/decode-thumb.h
index 7c6f6ebe514feea9a991d535d2cf2e7f424084c6..039013c7131d65278636671035fdd56a98de7d3d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/probes-thumb.h
+ * arch/arm/probes/decode-thumb.h
  *
  * Copyright 2013 Linaro Ltd.
  * Written by: David A. Long
@@ -15,6 +15,8 @@
 #ifndef _ARM_KERNEL_PROBES_THUMB_H
 #define  _ARM_KERNEL_PROBES_THUMB_H
 
+#include "decode.h"
+
 /*
  * True if current instruction is in an IT block.
  */
similarity index 99%
rename from arch/arm/kernel/probes.c
rename to arch/arm/probes/decode.c
index a8ab540d7e73a0b34533e8b22979fffa221501a8..3b05d574235922ae1ad18b96c59d4145453b927d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/probes.c
+ * arch/arm/probes/decode.c
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
@@ -17,7 +17,7 @@
 #include <asm/ptrace.h>
 #include <linux/bug.h>
 
-#include "probes.h"
+#include "decode.h"
 
 
 #ifndef find_str_pc_offset
similarity index 99%
rename from arch/arm/kernel/probes.h
rename to arch/arm/probes/decode.h
index dba9f2466a93fcfbe15f0bfcaefa224947b72edb..1d0b53169080326a505e035308ecb3dd51466a27 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/probes.h
+ * arch/arm/probes/decode.h
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
diff --git a/arch/arm/probes/kprobes/Makefile b/arch/arm/probes/kprobes/Makefile
new file mode 100644 (file)
index 0000000..eb38a42
--- /dev/null
@@ -0,0 +1,11 @@
+obj-$(CONFIG_KPROBES)          += core.o actions-common.o
+obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
+test-kprobes-objs              := test-core.o
+
+ifdef CONFIG_THUMB2_KERNEL
+obj-$(CONFIG_KPROBES)          += actions-thumb.o
+test-kprobes-objs              += test-thumb.o
+else
+obj-$(CONFIG_KPROBES)          += actions-arm.o
+test-kprobes-objs              += test-arm.o
+endif
similarity index 99%
rename from arch/arm/kernel/kprobes-arm.c
rename to arch/arm/probes/kprobes/actions-arm.c
index ac300c60d656982b5ae3ebf06fcbdbfc822e1017..8797879f7b3ab6b3dc1d9ba9f1182cb906907f81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/kprobes-decode.c
+ * arch/arm/probes/kprobes/actions-arm.c
  *
  * Copyright (C) 2006, 2007 Motorola Inc.
  *
@@ -62,8 +62,8 @@
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 
-#include "kprobes.h"
-#include "probes-arm.h"
+#include "../decode-arm.h"
+#include "core.h"
 
 #if  __LINUX_ARM_ARCH__ >= 6
 #define BLX(reg)       "blx    "reg"           \n\t"
similarity index 98%
rename from arch/arm/kernel/kprobes-common.c
rename to arch/arm/probes/kprobes/actions-common.c
index 0bf5d64eba1d269f1f3c36ec1184e33320da6219..bd20a71cd34a0f1f4887b72788f47fcb85f6c42e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/kprobes-common.c
+ * arch/arm/probes/kprobes/actions-common.c
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
@@ -15,7 +15,7 @@
 #include <linux/kprobes.h>
 #include <asm/opcodes.h>
 
-#include "kprobes.h"
+#include "core.h"
 
 
 static void __kprobes simulate_ldm1stm1(probes_opcode_t insn,
similarity index 99%
rename from arch/arm/kernel/kprobes-thumb.c
rename to arch/arm/probes/kprobes/actions-thumb.c
index 9495d7f3516fca54012691b642ea22380fc64ffd..6c4e60b6282618c5a185f7d197f259746867fd46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/kprobes-thumb.c
+ * arch/arm/probes/kprobes/actions-thumb.c
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
@@ -13,8 +13,8 @@
 #include <linux/ptrace.h>
 #include <linux/kprobes.h>
 
-#include "kprobes.h"
-#include "probes-thumb.h"
+#include "../decode-thumb.h"
+#include "core.h"
 
 /* These emulation encodings are functionally equivalent... */
 #define t32_emulate_rd8rn16rm0ra12_noflags \
similarity index 99%
rename from arch/arm/kernel/kprobes.c
rename to arch/arm/probes/kprobes/core.c
index 6d644202c8dcb164248f6fedb934eb5b3c0d58e4..701f49d74c35d31e5b8d6374edc24c3761c19837 100644 (file)
 #include <asm/cacheflush.h>
 #include <linux/percpu.h>
 #include <linux/bug.h>
+#include <asm/patch.h>
 
-#include "kprobes.h"
-#include "probes-arm.h"
-#include "probes-thumb.h"
-#include "patch.h"
+#include "../decode-arm.h"
+#include "../decode-thumb.h"
+#include "core.h"
 
 #define MIN_STACK_SIZE(addr)                           \
        min((unsigned long)MAX_STACK_SIZE,              \
similarity index 96%
rename from arch/arm/kernel/kprobes.h
rename to arch/arm/probes/kprobes/core.h
index 9a2712ecefc32d4fca8f389f622409a55099f056..2e1e5a3d915587fb47b4aab2908f2cb957924c41 100644 (file)
@@ -19,7 +19,8 @@
 #ifndef _ARM_KERNEL_KPROBES_H
 #define _ARM_KERNEL_KPROBES_H
 
-#include "probes.h"
+#include <asm/kprobes.h>
+#include "../decode.h"
 
 /*
  * These undefined instructions must be unique and
similarity index 99%
rename from arch/arm/kernel/kprobes-test-arm.c
rename to arch/arm/probes/kprobes/test-arm.c
index cb1424240ff65293df1eb3fb1d1244c5b7891da1..d9a1255f3043ae05b47f3e52b83707e877f1fc52 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/system_info.h>
 #include <asm/opcodes.h>
 
-#include "kprobes-test.h"
+#include "test-core.h"
 
 
 #define TEST_ISA "32"
similarity index 99%
rename from arch/arm/kernel/kprobes-test.c
rename to arch/arm/probes/kprobes/test-core.c
index b206d7790c7790af1a4c740c5d1c65c43b7f45c5..7ab633d51954abd0aeb1f2bd5b7697fb4f82bf98 100644 (file)
 #include <linux/bug.h>
 #include <asm/opcodes.h>
 
-#include "kprobes.h"
-#include "probes-arm.h"
-#include "probes-thumb.h"
-#include "kprobes-test.h"
+#include "core.h"
+#include "test-core.h"
+#include "../decode-arm.h"
+#include "../decode-thumb.h"
 
 
 #define BENCHMARKING   1
similarity index 99%
rename from arch/arm/kernel/kprobes-test.h
rename to arch/arm/probes/kprobes/test-core.h
index 4430990e90e7aaf309d67dbad363490aced5a413..9991754947bc1fd22bcbe101e0d31838d3deb0d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/kprobes-test.h
+ * arch/arm/probes/kprobes/test-core.h
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
similarity index 99%
rename from arch/arm/kernel/kprobes-test-thumb.c
rename to arch/arm/probes/kprobes/test-thumb.c
index 844dd10d85939617963d09f47237d2151db58578..6c6e9a9bb6757d6b179ae4df9a1cc6469041e58d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/kernel/kprobes-test-thumb.c
+ * arch/arm/probes/kprobes/test-thumb.c
  *
  * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
  *
@@ -12,7 +12,7 @@
 #include <linux/module.h>
 #include <asm/opcodes.h>
 
-#include "kprobes-test.h"
+#include "test-core.h"
 
 
 #define TEST_ISA "16"
diff --git a/arch/arm/probes/uprobes/Makefile b/arch/arm/probes/uprobes/Makefile
new file mode 100644 (file)
index 0000000..e1dc3d0
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_UPROBES)          += core.o actions-arm.o
similarity index 98%
rename from arch/arm/kernel/uprobes-arm.c
rename to arch/arm/probes/uprobes/actions-arm.c
index d3b655ff17da2098f7fd75ffa6ef5c8d78a9bbe5..1dd4916ba8aaa976b88554ea34b608dd2d3acc29 100644 (file)
@@ -13,9 +13,9 @@
 #include <linux/uprobes.h>
 #include <linux/module.h>
 
-#include "probes.h"
-#include "probes-arm.h"
-#include "uprobes.h"
+#include "../decode.h"
+#include "../decode-arm.h"
+#include "core.h"
 
 static int uprobes_substitute_pc(unsigned long *pinsn, u32 oregs)
 {
similarity index 98%
rename from arch/arm/kernel/uprobes.c
rename to arch/arm/probes/uprobes/core.c
index 56adf9c1fde0670d6a3826536391dcf1d2bb5646..b2954f6d3abef3697136e41b3a744f5134730a79 100644 (file)
@@ -17,9 +17,9 @@
 #include <asm/opcodes.h>
 #include <asm/traps.h>
 
-#include "probes.h"
-#include "probes-arm.h"
-#include "uprobes.h"
+#include "../decode.h"
+#include "../decode-arm.h"
+#include "core.h"
 
 #define UPROBE_TRAP_NR UINT_MAX