All of lore.kernel.org
 help / color / mirror / Atom feed
* fyi - kprobes testing patches
@ 2013-07-25 21:08 Ben Dooks
  2013-07-25 21:08 ` [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h> Ben Dooks
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Ben Dooks @ 2013-07-25 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

I've been working on kprobes and the kprobes-test driver. It seems
there are more issues with the kprobes-test that need looking in to
so I am putting this series out to see if anyone has any comments

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

* [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h>
  2013-07-25 21:08 fyi - kprobes testing patches Ben Dooks
@ 2013-07-25 21:08 ` Ben Dooks
  2013-07-29  8:01   ` Jon Medhurst (Tixy)
  2013-07-25 21:08 ` [PATCH 2/4] ARM: kprobes, change arm test to .instr Ben Dooks
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Ben Dooks @ 2013-07-25 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

If we are running BE8, the data and instruction endian-ness do not
match, so use <asm/opcodes.h> to correctly translate memory accesses
into ARM instructions.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>y
---
 arch/arm/kernel/kprobes-common.c |   14 ++++++++------
 arch/arm/kernel/kprobes.c        |    9 +++++----
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
index 18a7628..c0b202e 100644
--- a/arch/arm/kernel/kprobes-common.c
+++ b/arch/arm/kernel/kprobes-common.c
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/kprobes.h>
 #include <asm/system_info.h>
+#include <asm/opcodes.h>
 
 #include "kprobes.h"
 
@@ -305,7 +306,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
 
 	if (handler) {
 		/* We can emulate the instruction in (possibly) modified form */
-		asi->insn[0] = (insn & 0xfff00000) | (rn << 16) | reglist;
+		asi->insn[0] = __opcode_to_mem_arm((insn & 0xfff00000) |
+						   (rn << 16) | reglist);
 		asi->insn_handler = handler;
 		return INSN_GOOD;
 	}
@@ -338,9 +340,9 @@ prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
 		thumb_insn[2] = 0x4770; /* Thumb bx lr */
 		return insn;
 	}
-	asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
+	asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
 #else
-	asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
+	asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
 #endif
 	/* Make an ARM instruction unconditional */
 	if (insn < 0xe0000000)
@@ -360,12 +362,12 @@ set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
 	if (thumb) {
 		u16 *ip = (u16 *)asi->insn;
 		if (is_wide_instruction(insn))
-			*ip++ = insn >> 16;
-		*ip++ = insn;
+			*ip++ = ___asm_opcode_to_mem_thumb16(insn >> 16);
+		*ip++ = ___asm_opcode_to_mem_thumb16(insn);
 		return;
 	}
 #endif
-	asi->insn[0] = insn;
+	asi->insn[0] = __opcode_to_mem_arm(insn);
 }
 
 /*
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index 170e9f3..3775af1 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -26,6 +26,7 @@
 #include <linux/stop_machine.h>
 #include <linux/stringify.h>
 #include <asm/traps.h>
+#include <asm/opcodes.h>
 #include <asm/cacheflush.h>
 
 #include "kprobes.h"
@@ -62,10 +63,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
 #ifdef CONFIG_THUMB2_KERNEL
 	thumb = true;
 	addr &= ~1; /* Bit 0 would normally be set to indicate Thumb code */
-	insn = ((u16 *)addr)[0];
+	insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
 	if (is_wide_instruction(insn)) {
-		insn <<= 16;
-		insn |= ((u16 *)addr)[1];
+		u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
+		insn = ___asm_opcode_thumb32_compose(insn, inst2);
 		decode_insn = thumb32_kprobe_decode_insn;
 	} else
 		decode_insn = thumb16_kprobe_decode_insn;
@@ -73,7 +74,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
 	thumb = false;
 	if (addr & 0x3)
 		return -EINVAL;
-	insn = *p->addr;
+	insn = __mem_to_opcode_arm(*p->addr);
 	decode_insn = arm_kprobe_decode_insn;
 #endif
 
-- 
1.7.10.4

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

* [PATCH 2/4] ARM: kprobes, change arm test to .instr
  2013-07-25 21:08 fyi - kprobes testing patches Ben Dooks
  2013-07-25 21:08 ` [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h> Ben Dooks
@ 2013-07-25 21:08 ` Ben Dooks
  2013-07-25 21:08 ` [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h> Ben Dooks
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Ben Dooks @ 2013-07-25 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

use .instr for the moment, will need changing at a later date.
---
 arch/arm/kernel/kprobes-test-arm.c |  595 ++++++++++++++++++------------------
 1 file changed, 297 insertions(+), 298 deletions(-)

diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
index 8393129..52b0e2d 100644
--- a/arch/arm/kernel/kprobes-test-arm.c
+++ b/arch/arm/kernel/kprobes-test-arm.c
@@ -13,7 +13,6 @@
 
 #include "kprobes-test.h"
 
-
 #define TEST_ISA "32"
 
 #define TEST_ARM_TO_THUMB_INTERWORK_R(code1, reg, val, code2)	\
@@ -158,9 +157,9 @@ void kprobe_arm_test_cases(void)
 	TEST_SUPPORTED("cmp	sp, #0x1000");
 
 	/* Data-processing with PC as shift*/
-	TEST_UNSUPPORTED(".word 0xe15c0f1e	@ cmp	r12, r14, asl pc")
-	TEST_UNSUPPORTED(".word 0xe1a0cf1e	@ mov	r12, r14, asl pc")
-	TEST_UNSUPPORTED(".word 0xe08caf1e	@ add	r10, r12, r14, asl pc")
+	TEST_UNSUPPORTED(".inst 0xe15c0f1e	@ cmp	r12, r14, asl pc")
+	TEST_UNSUPPORTED(".inst 0xe1a0cf1e	@ mov	r12, r14, asl pc")
+	TEST_UNSUPPORTED(".inst 0xe08caf1e	@ add	r10, r12, r14, asl pc")
 
 	/* Data-processing with PC as shift*/
 	TEST_UNSUPPORTED("movs	pc, r1")
@@ -202,7 +201,7 @@ void kprobe_arm_test_cases(void)
 	TEST("mrs	r0, cpsr")
 	TEST("mrspl	r7, cpsr")
 	TEST("mrs	r14, cpsr")
-	TEST_UNSUPPORTED(".word 0xe10ff000	@ mrs r15, cpsr")
+	TEST_UNSUPPORTED(".inst 0xe10ff000	@ mrs r15, cpsr")
 	TEST_UNSUPPORTED("mrs	r0, spsr")
 	TEST_UNSUPPORTED("mrs	lr, spsr")
 
@@ -218,8 +217,8 @@ void kprobe_arm_test_cases(void)
 	TEST_R("clzeq	r7, r",14,0x1,"")
 	TEST_R("clz	lr, r",7, 0xffffffff,"")
 	TEST(  "clz	r4, sp")
-	TEST_UNSUPPORTED(".word 0x016fff10	@ clz pc, r0")
-	TEST_UNSUPPORTED(".word 0x016f0f1f	@ clz r0, pc")
+	TEST_UNSUPPORTED(".inst 0x016fff10	@ clz pc, r0")
+	TEST_UNSUPPORTED(".inst 0x016f0f1f	@ clz r0, pc")
 
 #if __LINUX_ARM_ARCH__ >= 6
 	TEST_UNSUPPORTED("bxj	r0")
@@ -228,7 +227,7 @@ void kprobe_arm_test_cases(void)
 	TEST_BF_R("blx	r",0,2f,"")
 	TEST_BB_R("blx	r",7,2f,"")
 	TEST_BF_R("blxeq	r",14,2f,"")
-	TEST_UNSUPPORTED(".word 0x0120003f	@ blx pc")
+	TEST_UNSUPPORTED(".inst 0x0120003f	@ blx pc")
 
 	TEST_RR(   "qadd	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(   "qaddvs	lr, r",9, VAL2,", r",8, VAL1,"")
@@ -242,190 +241,190 @@ void kprobe_arm_test_cases(void)
 	TEST_RR(   "qdsub	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(   "qdsubvs	lr, r",9, VAL2,", r",8, VAL1,"")
 	TEST_R(    "qdsub	lr, r",9, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe101f050	@ qadd pc, r0, r1")
-	TEST_UNSUPPORTED(".word 0xe121f050	@ qsub pc, r0, r1")
-	TEST_UNSUPPORTED(".word 0xe141f050	@ qdadd pc, r0, r1")
-	TEST_UNSUPPORTED(".word 0xe161f050	@ qdsub pc, r0, r1")
-	TEST_UNSUPPORTED(".word 0xe16f2050	@ qdsub r2, r0, pc")
-	TEST_UNSUPPORTED(".word 0xe161205f	@ qdsub r2, pc, r1")
+	TEST_UNSUPPORTED(".inst 0xe101f050	@ qadd pc, r0, r1")
+	TEST_UNSUPPORTED(".inst 0xe121f050	@ qsub pc, r0, r1")
+	TEST_UNSUPPORTED(".inst 0xe141f050	@ qdadd pc, r0, r1")
+	TEST_UNSUPPORTED(".inst 0xe161f050	@ qdsub pc, r0, r1")
+	TEST_UNSUPPORTED(".inst 0xe16f2050	@ qdsub r2, r0, pc")
+	TEST_UNSUPPORTED(".inst 0xe161205f	@ qdsub r2, pc, r1")
 
 	TEST_UNSUPPORTED("bkpt	0xffff")
 	TEST_UNSUPPORTED("bkpt	0x0000")
 
-	TEST_UNSUPPORTED(".word 0xe1600070 @ smc #0")
+	TEST_UNSUPPORTED(".inst 0xe1600070 @ smc #0")
 
 	TEST_GROUP("Halfword multiply and multiply-accumulate")
 
 	TEST_RRR(    "smlabb	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "smlabbge	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "smlabb	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe10f3281 @ smlabb pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe10f3281 @ smlabb pc, r1, r2, r3")
 	TEST_RRR(    "smlatb	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "smlatbge	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "smlatb	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe10f32a1 @ smlatb pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe10f32a1 @ smlatb pc, r1, r2, r3")
 	TEST_RRR(    "smlabt	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "smlabtge	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "smlabt	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe10f32c1 @ smlabt pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe10f32c1 @ smlabt pc, r1, r2, r3")
 	TEST_RRR(    "smlatt	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "smlattge	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "smlatt	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe10f32e1 @ smlatt pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe10f32e1 @ smlatt pc, r1, r2, r3")
 
 	TEST_RRR(    "smlawb	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "smlawbge	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "smlawb	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe12f3281 @ smlawb pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe12f3281 @ smlawb pc, r1, r2, r3")
 	TEST_RRR(    "smlawt	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "smlawtge	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "smlawt	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe12f32c1 @ smlawt pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe12032cf @ smlawt r0, pc, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe1203fc1 @ smlawt r0, r1, pc, r3")
-	TEST_UNSUPPORTED(".word 0xe120f2c1 @ smlawt r0, r1, r2, pc")
+	TEST_UNSUPPORTED(".inst 0xe12f32c1 @ smlawt pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe12032cf @ smlawt r0, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe1203fc1 @ smlawt r0, r1, pc, r3")
+	TEST_UNSUPPORTED(".inst 0xe120f2c1 @ smlawt r0, r1, r2, pc")
 
 	TEST_RR(    "smulwb	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "smulwbge	r7, r",8, VAL3,", r",9, VAL1,"")
 	TEST_R(     "smulwb	lr, r",1, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe12f02a1 @ smulwb pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe12f02a1 @ smulwb pc, r1, r2")
 	TEST_RR(    "smulwt	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "smulwtge	r7, r",8, VAL3,", r",9, VAL1,"")
 	TEST_R(     "smulwt	lr, r",1, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe12f02e1 @ smulwt pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe12f02e1 @ smulwt pc, r1, r2")
 
 	TEST_RRRR(  "smlalbb	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "smlalbble	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "smlalbb	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe14f1382 @ smlalbb pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe141f382 @ smlalbb r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe14f1382 @ smlalbb pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe141f382 @ smlalbb r1, pc, r2, r3")
 	TEST_RRRR(  "smlaltb	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "smlaltble	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "smlaltb	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe14f13a2 @ smlaltb pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe141f3a2 @ smlaltb r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe14f13a2 @ smlaltb pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe141f3a2 @ smlaltb r1, pc, r2, r3")
 	TEST_RRRR(  "smlalbt	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "smlalbtle	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "smlalbt	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe14f13c2 @ smlalbt pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe141f3c2 @ smlalbt r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe14f13c2 @ smlalbt pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe141f3c2 @ smlalbt r1, pc, r2, r3")
 	TEST_RRRR(  "smlaltt	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "smlalttle	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "smlaltt	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe14f13e2 @ smlalbb pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe140f3e2 @ smlalbb r0, pc, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe14013ef @ smlalbb r0, r1, pc, r3")
-	TEST_UNSUPPORTED(".word 0xe1401fe2 @ smlalbb r0, r1, r2, pc")
+	TEST_UNSUPPORTED(".inst 0xe14f13e2 @ smlalbb pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe140f3e2 @ smlalbb r0, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe14013ef @ smlalbb r0, r1, pc, r3")
+	TEST_UNSUPPORTED(".inst 0xe1401fe2 @ smlalbb r0, r1, r2, pc")
 
 	TEST_RR(    "smulbb	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "smulbbge	r7, r",8, VAL3,", r",9, VAL1,"")
 	TEST_R(     "smulbb	lr, r",1, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe16f0281 @ smulbb pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe16f0281 @ smulbb pc, r1, r2")
 	TEST_RR(    "smultb	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "smultbge	r7, r",8, VAL3,", r",9, VAL1,"")
 	TEST_R(     "smultb	lr, r",1, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe16f02a1 @ smultb pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe16f02a1 @ smultb pc, r1, r2")
 	TEST_RR(    "smulbt	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "smulbtge	r7, r",8, VAL3,", r",9, VAL1,"")
 	TEST_R(     "smulbt	lr, r",1, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe16f02c1 @ smultb pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe16f02c1 @ smultb pc, r1, r2")
 	TEST_RR(    "smultt	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "smulttge	r7, r",8, VAL3,", r",9, VAL1,"")
 	TEST_R(     "smultt	lr, r",1, VAL2,", r13")
-	TEST_UNSUPPORTED(".word 0xe16f02e1 @ smultt pc, r1, r2")
-	TEST_UNSUPPORTED(".word 0xe16002ef @ smultt r0, pc, r2")
-	TEST_UNSUPPORTED(".word 0xe1600fe1 @ smultt r0, r1, pc")
+	TEST_UNSUPPORTED(".inst 0xe16f02e1 @ smultt pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe16002ef @ smultt r0, pc, r2")
+	TEST_UNSUPPORTED(".inst 0xe1600fe1 @ smultt r0, r1, pc")
 
 	TEST_GROUP("Multiply and multiply-accumulate")
 
 	TEST_RR(    "mul	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "mulls	r7, r",8, VAL2,", r",9, VAL2,"")
 	TEST_R(     "mul	lr, r",4, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe00f0291 @ mul pc, r1, r2")
-	TEST_UNSUPPORTED(".word 0xe000029f @ mul r0, pc, r2")
-	TEST_UNSUPPORTED(".word 0xe0000f91 @ mul r0, r1, pc")
+	TEST_UNSUPPORTED(".inst 0xe00f0291 @ mul pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe000029f @ mul r0, pc, r2")
+	TEST_UNSUPPORTED(".inst 0xe0000f91 @ mul r0, r1, pc")
 	TEST_RR(    "muls	r0, r",1, VAL1,", r",2, VAL2,"")
 	TEST_RR(    "mullss	r7, r",8, VAL2,", r",9, VAL2,"")
 	TEST_R(     "muls	lr, r",4, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe01f0291 @ muls pc, r1, r2")
+	TEST_UNSUPPORTED(".inst 0xe01f0291 @ muls pc, r1, r2")
 
 	TEST_RRR(    "mla	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "mlahi	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "mla	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe02f3291 @ mla pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe02f3291 @ mla pc, r1, r2, r3")
 	TEST_RRR(    "mlas	r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(    "mlahis	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(     "mlas	lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe03f3291 @ mlas pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe03f3291 @ mlas pc, r1, r2, r3")
 
 #if __LINUX_ARM_ARCH__ >= 6
 	TEST_RR(  "umaal	r0, r1, r",2, VAL1,", r",3, VAL2,"")
 	TEST_RR(  "umaalls	r7, r8, r",9, VAL2,", r",10, VAL1,"")
 	TEST_R(   "umaal	lr, r12, r",11,VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe041f392 @ umaal pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0500090 @ undef")
-	TEST_UNSUPPORTED(".word 0xe05fff9f @ undef")
+	TEST_UNSUPPORTED(".inst 0xe041f392 @ umaal pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe04f0392 @ umaal r0, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0500090 @ undef")
+	TEST_UNSUPPORTED(".inst 0xe05fff9f @ undef")
 #endif
 
 #if __LINUX_ARM_ARCH__ >= 7
 	TEST_RRR(  "mls		r0, r",1, VAL1,", r",2, VAL2,", r",3,  VAL3,"")
 	TEST_RRR(  "mlshi	r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
 	TEST_RR(   "mls		lr, r",1, VAL2,", r",2, VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe06f3291 @ mls pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe060329f @ mls r0, pc, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0603f91 @ mls r0, r1, pc, r3")
-	TEST_UNSUPPORTED(".word 0xe060f291 @ mls r0, r1, r2, pc")
+	TEST_UNSUPPORTED(".inst 0xe06f3291 @ mls pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe060329f @ mls r0, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0603f91 @ mls r0, r1, pc, r3")
+	TEST_UNSUPPORTED(".inst 0xe060f291 @ mls r0, r1, r2, pc")
 #endif
 
-	TEST_UNSUPPORTED(".word 0xe0700090 @ undef")
-	TEST_UNSUPPORTED(".word 0xe07fff9f @ undef")
+	TEST_UNSUPPORTED(".inst 0xe0700090 @ undef")
+	TEST_UNSUPPORTED(".inst 0xe07fff9f @ undef")
 
 	TEST_RR(  "umull	r0, r1, r",2, VAL1,", r",3, VAL2,"")
 	TEST_RR(  "umullls	r7, r8, r",9, VAL2,", r",10, VAL1,"")
 	TEST_R(   "umull	lr, r12, r",11,VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe081f392 @ umull pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe08f1392 @ umull r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe081f392 @ umull pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe08f1392 @ umull r1, pc, r2, r3")
 	TEST_RR(  "umulls	r0, r1, r",2, VAL1,", r",3, VAL2,"")
 	TEST_RR(  "umulllss	r7, r8, r",9, VAL2,", r",10, VAL1,"")
 	TEST_R(   "umulls	lr, r12, r",11,VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe091f392 @ umulls pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe09f1392 @ umulls r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe091f392 @ umulls pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe09f1392 @ umulls r1, pc, r2, r3")
 
 	TEST_RRRR(  "umlal	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "umlalle	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "umlal	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe0af1392 @ umlal pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0a1f392 @ umlal r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0af1392 @ umlal pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0a1f392 @ umlal r1, pc, r2, r3")
 	TEST_RRRR(  "umlals	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "umlalles	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "umlals	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe0bf1392 @ umlals pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0b1f392 @ umlals r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0bf1392 @ umlals pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0b1f392 @ umlals r1, pc, r2, r3")
 
 	TEST_RR(  "smull	r0, r1, r",2, VAL1,", r",3, VAL2,"")
 	TEST_RR(  "smullls	r7, r8, r",9, VAL2,", r",10, VAL1,"")
 	TEST_R(   "smull	lr, r12, r",11,VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe0c1f392 @ smull pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0cf1392 @ smull r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0c1f392 @ smull pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0cf1392 @ smull r1, pc, r2, r3")
 	TEST_RR(  "smulls	r0, r1, r",2, VAL1,", r",3, VAL2,"")
 	TEST_RR(  "smulllss	r7, r8, r",9, VAL2,", r",10, VAL1,"")
 	TEST_R(   "smulls	lr, r12, r",11,VAL3,", r13")
-	TEST_UNSUPPORTED(".word 0xe0d1f392 @ smulls pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0df1392 @ smulls r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0d1f392 @ smulls pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0df1392 @ smulls r1, pc, r2, r3")
 
 	TEST_RRRR(  "smlal	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "smlalle	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "smlal	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe0ef1392 @ smlal pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0e1f392 @ smlal r1, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0ef1392 @ smlal pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0e1f392 @ smlal r1, pc, r2, r3")
 	TEST_RRRR(  "smlals	r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
 	TEST_RRRR(  "smlalles	r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
 	TEST_RRR(   "smlals	r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
-	TEST_UNSUPPORTED(".word 0xe0ff1392 @ smlals pc, r1, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0f0f392 @ smlals r0, pc, r2, r3")
-	TEST_UNSUPPORTED(".word 0xe0f0139f @ smlals r0, r1, pc, r3")
-	TEST_UNSUPPORTED(".word 0xe0f01f92 @ smlals r0, r1, r2, pc")
+	TEST_UNSUPPORTED(".inst 0xe0ff1392 @ smlals pc, r1, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0f0f392 @ smlals r0, pc, r2, r3")
+	TEST_UNSUPPORTED(".inst 0xe0f0139f @ smlals r0, r1, pc, r3")
+	TEST_UNSUPPORTED(".inst 0xe0f01f92 @ smlals r0, r1, r2, pc")
 
 	TEST_GROUP("Synchronization primitives")
 
@@ -434,28 +433,28 @@ void kprobe_arm_test_cases(void)
 	TEST_R( "swpvs	r0, r",1,VAL1,", [sp]")
 	TEST_RP("swp	sp, r",14,VAL2,", [r",12,13*4,"]")
 #else
-	TEST_UNSUPPORTED(".word 0xe108e097 @ swp	lr, r7, [r8]")
-	TEST_UNSUPPORTED(".word 0x610d0091 @ swpvs	r0, r1, [sp]")
-	TEST_UNSUPPORTED(".word 0xe10cd09e @ swp	sp, r14 [r12]")
+	TEST_UNSUPPORTED(".inst 0xe108e097 @ swp	lr, r7, [r8]")
+	TEST_UNSUPPORTED(".inst 0x610d0091 @ swpvs	r0, r1, [sp]")
+	TEST_UNSUPPORTED(".inst 0xe10cd09e @ swp	sp, r14 [r12]")
 #endif
-	TEST_UNSUPPORTED(".word 0xe102f091 @ swp pc, r1, [r2]")
-	TEST_UNSUPPORTED(".word 0xe102009f @ swp r0, pc, [r2]")
-	TEST_UNSUPPORTED(".word 0xe10f0091 @ swp r0, r1, [pc]")
+	TEST_UNSUPPORTED(".inst 0xe102f091 @ swp pc, r1, [r2]")
+	TEST_UNSUPPORTED(".inst 0xe102009f @ swp r0, pc, [r2]")
+	TEST_UNSUPPORTED(".inst 0xe10f0091 @ swp r0, r1, [pc]")
 #if __LINUX_ARM_ARCH__ < 6
 	TEST_RP("swpb	lr, r",7,VAL2,", [r",8,0,"]")
 	TEST_R( "swpvsb	r0, r",1,VAL1,", [sp]")
 #else
-	TEST_UNSUPPORTED(".word 0xe148e097 @ swpb	lr, r7, [r8]")
-	TEST_UNSUPPORTED(".word 0x614d0091 @ swpvsb	r0, r1, [sp]")
+	TEST_UNSUPPORTED(".inst 0xe148e097 @ swpb	lr, r7, [r8]")
+	TEST_UNSUPPORTED(".inst 0x614d0091 @ swpvsb	r0, r1, [sp]")
 #endif
-	TEST_UNSUPPORTED(".word 0xe142f091 @ swpb pc, r1, [r2]")
-
-	TEST_UNSUPPORTED(".word	0xe1100090") /* Unallocated space */
-	TEST_UNSUPPORTED(".word	0xe1200090") /* Unallocated space */
-	TEST_UNSUPPORTED(".word	0xe1300090") /* Unallocated space */
-	TEST_UNSUPPORTED(".word	0xe1500090") /* Unallocated space */
-	TEST_UNSUPPORTED(".word	0xe1600090") /* Unallocated space */
-	TEST_UNSUPPORTED(".word	0xe1700090") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe142f091 @ swpb pc, r1, [r2]")
+
+	TEST_UNSUPPORTED(".inst	0xe1100090") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst	0xe1200090") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst	0xe1300090") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst	0xe1500090") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst	0xe1600090") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst	0xe1700090") /* Unallocated space */
 #if __LINUX_ARM_ARCH__ >= 6
 	TEST_UNSUPPORTED("ldrex	r2, [sp]")
 #endif
@@ -475,9 +474,9 @@ void kprobe_arm_test_cases(void)
 	TEST_RPR(  "strneh	r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
 	TEST_RPR(  "strh	r",2, VAL1,", [r",3, 24,"], r",4, 48,"")
 	TEST_RPR(  "strh	r",10,VAL2,", [r",9, 48,"], -r",11,24,"")
-	TEST_UNSUPPORTED(".word 0xe1afc0ba	@ strh r12, [pc, r10]!")
-	TEST_UNSUPPORTED(".word 0xe089f0bb	@ strh pc, [r9], r11")
-	TEST_UNSUPPORTED(".word 0xe089a0bf	@ strh r10, [r9], pc")
+	TEST_UNSUPPORTED(".inst 0xe1afc0ba	@ strh r12, [pc, r10]!")
+	TEST_UNSUPPORTED(".inst 0xe089f0bb	@ strh pc, [r9], r11")
+	TEST_UNSUPPORTED(".inst 0xe089a0bf	@ strh r10, [r9], pc")
 
 	TEST_PR(   "ldrh	r0, [r",0,  48,", -r",2, 24,"]")
 	TEST_PR(   "ldrcsh	r14, [r",13,0, ", r",12, 48,"]")
@@ -485,9 +484,9 @@ void kprobe_arm_test_cases(void)
 	TEST_PR(   "ldrcch	r12, [r",11,48,", -r",10,24,"]!")
 	TEST_PR(   "ldrh	r2, [r",3,  24,"], r",4, 48,"")
 	TEST_PR(   "ldrh	r10, [r",9, 48,"], -r",11,24,"")
-	TEST_UNSUPPORTED(".word 0xe1bfc0ba	@ ldrh r12, [pc, r10]!")
-	TEST_UNSUPPORTED(".word 0xe099f0bb	@ ldrh pc, [r9], r11")
-	TEST_UNSUPPORTED(".word 0xe099a0bf	@ ldrh r10, [r9], pc")
+	TEST_UNSUPPORTED(".inst 0xe1bfc0ba	@ ldrh r12, [pc, r10]!")
+	TEST_UNSUPPORTED(".inst 0xe099f0bb	@ ldrh pc, [r9], r11")
+	TEST_UNSUPPORTED(".inst 0xe099a0bf	@ ldrh r10, [r9], pc")
 
 	TEST_RP(   "strh	r",0, VAL1,", [r",1, 24,", #-2]")
 	TEST_RP(   "strmih	r",14,VAL2,", [r",13,0, ", #2]")
@@ -495,8 +494,8 @@ void kprobe_arm_test_cases(void)
 	TEST_RP(   "strplh	r",12,VAL2,", [r",11,24,", #-4]!")
 	TEST_RP(   "strh	r",2, VAL1,", [r",3, 24,"], #48")
 	TEST_RP(   "strh	r",10,VAL2,", [r",9, 64,"], #-48")
-	TEST_UNSUPPORTED(".word 0xe1efc3b0	@ strh r12, [pc, #48]!")
-	TEST_UNSUPPORTED(".word 0xe0c9f3b0	@ strh pc, [r9], #48")
+	TEST_UNSUPPORTED(".inst 0xe1efc3b0	@ strh r12, [pc, #48]!")
+	TEST_UNSUPPORTED(".inst 0xe0c9f3b0	@ strh pc, [r9], #48")
 
 	TEST_P(	   "ldrh	r0, [r",0,  24,", #-2]")
 	TEST_P(	   "ldrvsh	r14, [r",13,0, ", #2]")
@@ -505,8 +504,8 @@ void kprobe_arm_test_cases(void)
 	TEST_P(	   "ldrh	r2, [r",3,  24,"], #48")
 	TEST_P(	   "ldrh	r10, [r",9, 64,"], #-48")
 	TEST(      "ldrh	r0, [pc, #0]")
-	TEST_UNSUPPORTED(".word 0xe1ffc3b0	@ ldrh r12, [pc, #48]!")
-	TEST_UNSUPPORTED(".word 0xe0d9f3b0	@ ldrh pc, [r9], #48")
+	TEST_UNSUPPORTED(".inst 0xe1ffc3b0	@ ldrh r12, [pc, #48]!")
+	TEST_UNSUPPORTED(".inst 0xe0d9f3b0	@ ldrh pc, [r9], #48")
 
 	TEST_PR(   "ldrsb	r0, [r",0,  48,", -r",2, 24,"]")
 	TEST_PR(   "ldrhisb	r14, [r",13,0,", r",12,  48,"]")
@@ -514,8 +513,8 @@ void kprobe_arm_test_cases(void)
 	TEST_PR(   "ldrlssb	r12, [r",11,48,", -r",10,24,"]!")
 	TEST_PR(   "ldrsb	r2, [r",3,  24,"], r",4, 48,"")
 	TEST_PR(   "ldrsb	r10, [r",9, 48,"], -r",11,24,"")
-	TEST_UNSUPPORTED(".word 0xe1bfc0da	@ ldrsb r12, [pc, r10]!")
-	TEST_UNSUPPORTED(".word 0xe099f0db	@ ldrsb pc, [r9], r11")
+	TEST_UNSUPPORTED(".inst 0xe1bfc0da	@ ldrsb r12, [pc, r10]!")
+	TEST_UNSUPPORTED(".inst 0xe099f0db	@ ldrsb pc, [r9], r11")
 
 	TEST_P(	   "ldrsb	r0, [r",0,  24,", #-1]")
 	TEST_P(	   "ldrgesb	r14, [r",13,0, ", #1]")
@@ -524,8 +523,8 @@ void kprobe_arm_test_cases(void)
 	TEST_P(	   "ldrsb	r2, [r",3,  24,"], #48")
 	TEST_P(	   "ldrsb	r10, [r",9, 64,"], #-48")
 	TEST(      "ldrsb	r0, [pc, #0]")
-	TEST_UNSUPPORTED(".word 0xe1ffc3d0	@ ldrsb r12, [pc, #48]!")
-	TEST_UNSUPPORTED(".word 0xe0d9f3d0	@ ldrsb pc, [r9], #48")
+	TEST_UNSUPPORTED(".inst 0xe1ffc3d0	@ ldrsb r12, [pc, #48]!")
+	TEST_UNSUPPORTED(".inst 0xe0d9f3d0	@ ldrsb pc, [r9], #48")
 
 	TEST_PR(   "ldrsh	r0, [r",0,  48,", -r",2, 24,"]")
 	TEST_PR(   "ldrgtsh	r14, [r",13,0, ", r",12, 48,"]")
@@ -533,8 +532,8 @@ void kprobe_arm_test_cases(void)
 	TEST_PR(   "ldrlesh	r12, [r",11,48,", -r",10,24,"]!")
 	TEST_PR(   "ldrsh	r2, [r",3,  24,"], r",4, 48,"")
 	TEST_PR(   "ldrsh	r10, [r",9, 48,"], -r",11,24,"")
-	TEST_UNSUPPORTED(".word 0xe1bfc0fa	@ ldrsh r12, [pc, r10]!")
-	TEST_UNSUPPORTED(".word 0xe099f0fb	@ ldrsh pc, [r9], r11")
+	TEST_UNSUPPORTED(".inst 0xe1bfc0fa	@ ldrsh r12, [pc, r10]!")
+	TEST_UNSUPPORTED(".inst 0xe099f0fb	@ ldrsh pc, [r9], r11")
 
 	TEST_P(	   "ldrsh	r0, [r",0,  24,", #-1]")
 	TEST_P(	   "ldreqsh	r14, [r",13,0 ,", #1]")
@@ -543,8 +542,8 @@ void kprobe_arm_test_cases(void)
 	TEST_P(	   "ldrsh	r2, [r",3,  24,"], #48")
 	TEST_P(	   "ldrsh	r10, [r",9, 64,"], #-48")
 	TEST(      "ldrsh	r0, [pc, #0]")
-	TEST_UNSUPPORTED(".word 0xe1ffc3f0	@ ldrsh r12, [pc, #48]!")
-	TEST_UNSUPPORTED(".word 0xe0d9f3f0	@ ldrsh pc, [r9], #48")
+	TEST_UNSUPPORTED(".inst 0xe1ffc3f0	@ ldrsh r12, [pc, #48]!")
+	TEST_UNSUPPORTED(".inst 0xe0d9f3f0	@ ldrsh pc, [r9], #48")
 
 #if __LINUX_ARM_ARCH__ >= 7
 	TEST_UNSUPPORTED("strht	r1, [r2], r3")
@@ -563,7 +562,7 @@ void kprobe_arm_test_cases(void)
 	TEST_RPR(  "strcsd	r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
 	TEST_RPR(  "strd	r",2, VAL1,", [r",5, 24,"], r",4,48,"")
 	TEST_RPR(  "strd	r",10,VAL2,", [r",9, 48,"], -r",7,24,"")
-	TEST_UNSUPPORTED(".word 0xe1afc0fa	@ strd r12, [pc, r10]!")
+	TEST_UNSUPPORTED(".inst 0xe1afc0fa	@ strd r12, [pc, r10]!")
 
 	TEST_PR(   "ldrd	r0, [r",0, 48,", -r",2,24,"]")
 	TEST_PR(   "ldrmid	r8, [r",13,0, ", r",12,48,"]")
@@ -571,10 +570,10 @@ void kprobe_arm_test_cases(void)
 	TEST_PR(   "ldrpld	r6, [r",11,48,", -r",10,24,"]!")
 	TEST_PR(   "ldrd	r2, [r",5, 24,"], r",4,48,"")
 	TEST_PR(   "ldrd	r10, [r",9,48,"], -r",7,24,"")
-	TEST_UNSUPPORTED(".word 0xe1afc0da	@ ldrd r12, [pc, r10]!")
-	TEST_UNSUPPORTED(".word 0xe089f0db	@ ldrd pc, [r9], r11")
-	TEST_UNSUPPORTED(".word 0xe089e0db	@ ldrd lr, [r9], r11")
-	TEST_UNSUPPORTED(".word 0xe089c0df	@ ldrd r12, [r9], pc")
+	TEST_UNSUPPORTED(".inst 0xe1afc0da	@ ldrd r12, [pc, r10]!")
+	TEST_UNSUPPORTED(".inst 0xe089f0db	@ ldrd pc, [r9], r11")
+	TEST_UNSUPPORTED(".inst 0xe089e0db	@ ldrd lr, [r9], r11")
+	TEST_UNSUPPORTED(".inst 0xe089c0df	@ ldrd r12, [r9], pc")
 
 	TEST_RP(   "strd	r",0, VAL1,", [r",1, 24,", #-8]")
 	TEST_RP(   "strvsd	r",8, VAL2,", [r",13,0, ", #8]")
@@ -582,7 +581,7 @@ void kprobe_arm_test_cases(void)
 	TEST_RP(   "strvcd	r",12,VAL2,", [r",11,24,", #-16]!")
 	TEST_RP(   "strd	r",2, VAL1,", [r",4, 24,"], #48")
 	TEST_RP(   "strd	r",10,VAL2,", [r",9, 64,"], #-48")
-	TEST_UNSUPPORTED(".word 0xe1efc3f0	@ strd r12, [pc, #48]!")
+	TEST_UNSUPPORTED(".inst 0xe1efc3f0	@ strd r12, [pc, #48]!")
 
 	TEST_P(	   "ldrd	r0, [r",0, 24,", #-8]")
 	TEST_P(	   "ldrhid	r8, [r",13,0, ", #8]")
@@ -590,9 +589,9 @@ void kprobe_arm_test_cases(void)
 	TEST_P(	   "ldrlsd	r6, [r",11,24,", #-16]!")
 	TEST_P(	   "ldrd	r2, [r",5, 24,"], #48")
 	TEST_P(	   "ldrd	r10, [r",9,6,"], #-48")
-	TEST_UNSUPPORTED(".word 0xe1efc3d0	@ ldrd r12, [pc, #48]!")
-	TEST_UNSUPPORTED(".word 0xe0c9f3d0	@ ldrd pc, [r9], #48")
-	TEST_UNSUPPORTED(".word 0xe0c9e3d0	@ ldrd lr, [r9], #48")
+	TEST_UNSUPPORTED(".inst 0xe1efc3d0	@ ldrd r12, [pc, #48]!")
+	TEST_UNSUPPORTED(".inst 0xe0c9f3d0	@ ldrd pc, [r9], #48")
+	TEST_UNSUPPORTED(".inst 0xe0c9e3d0	@ ldrd lr, [r9], #48")
 
 	TEST_GROUP("Miscellaneous")
 
@@ -600,11 +599,11 @@ void kprobe_arm_test_cases(void)
 	TEST("movw	r0, #0")
 	TEST("movw	r0, #0xffff")
 	TEST("movw	lr, #0xffff")
-	TEST_UNSUPPORTED(".word 0xe300f000	@ movw pc, #0")
+	TEST_UNSUPPORTED(".inst 0xe300f000	@ movw pc, #0")
 	TEST_R("movt	r",0, VAL1,", #0")
 	TEST_R("movt	r",0, VAL2,", #0xffff")
 	TEST_R("movt	r",14,VAL1,", #0xffff")
-	TEST_UNSUPPORTED(".word 0xe340f000	@ movt pc, #0")
+	TEST_UNSUPPORTED(".inst 0xe340f000	@ movt pc, #0")
 #endif
 
 	TEST_UNSUPPORTED("msr	cpsr, 0x13")
@@ -672,20 +671,20 @@ void kprobe_arm_test_cases(void)
 #ifdef CONFIG_THUMB2_KERNEL
 	TEST_ARM_TO_THUMB_INTERWORK_P("ldr	pc, [r",0,0,", #15*4]")
 #endif
-	TEST_UNSUPPORTED(".word 0xe5af6008	@ str r6, [pc, #8]!")
-	TEST_UNSUPPORTED(".word 0xe7af6008	@ str r6, [pc, r8]!")
-	TEST_UNSUPPORTED(".word 0xe5bf6008	@ ldr r6, [pc, #8]!")
-	TEST_UNSUPPORTED(".word 0xe7bf6008	@ ldr r6, [pc, r8]!")
-	TEST_UNSUPPORTED(".word 0xe788600f	@ str r6, [r8, pc]")
-	TEST_UNSUPPORTED(".word 0xe798600f	@ ldr r6, [r8, pc]")
+	TEST_UNSUPPORTED(".inst 0xe5af6008	@ str r6, [pc, #8]!")
+	TEST_UNSUPPORTED(".inst 0xe7af6008	@ str r6, [pc, r8]!")
+	TEST_UNSUPPORTED(".inst 0xe5bf6008	@ ldr r6, [pc, #8]!")
+	TEST_UNSUPPORTED(".inst 0xe7bf6008	@ ldr r6, [pc, r8]!")
+	TEST_UNSUPPORTED(".inst 0xe788600f	@ str r6, [r8, pc]")
+	TEST_UNSUPPORTED(".inst 0xe798600f	@ ldr r6, [r8, pc]")
 
 	LOAD_STORE("b")
-	TEST_UNSUPPORTED(".word 0xe5f7f008	@ ldrb pc, [r7, #8]!")
-	TEST_UNSUPPORTED(".word 0xe7f7f008	@ ldrb pc, [r7, r8]!")
-	TEST_UNSUPPORTED(".word 0xe5ef6008	@ strb r6, [pc, #8]!")
-	TEST_UNSUPPORTED(".word 0xe7ef6008	@ strb r6, [pc, r3]!")
-	TEST_UNSUPPORTED(".word 0xe5ff6008	@ ldrb r6, [pc, #8]!")
-	TEST_UNSUPPORTED(".word 0xe7ff6008	@ ldrb r6, [pc, r3]!")
+	TEST_UNSUPPORTED(".inst 0xe5f7f008	@ ldrb pc, [r7, #8]!")
+	TEST_UNSUPPORTED(".inst 0xe7f7f008	@ ldrb pc, [r7, r8]!")
+	TEST_UNSUPPORTED(".inst 0xe5ef6008	@ strb r6, [pc, #8]!")
+	TEST_UNSUPPORTED(".inst 0xe7ef6008	@ strb r6, [pc, r3]!")
+	TEST_UNSUPPORTED(".inst 0xe5ff6008	@ ldrb r6, [pc, #8]!")
+	TEST_UNSUPPORTED(".inst 0xe7ff6008	@ ldrb r6, [pc, r3]!")
 
 	TEST_UNSUPPORTED("ldrt	r0, [r1], #4")
 	TEST_UNSUPPORTED("ldrt	r1, [r2], r3")
@@ -699,153 +698,153 @@ void kprobe_arm_test_cases(void)
 #if __LINUX_ARM_ARCH__ >= 7
 	TEST_GROUP("Parallel addition and subtraction, signed")
 
-	TEST_UNSUPPORTED(".word 0xe6000010") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe60fffff") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe6000010") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe60fffff") /* Unallocated space */
 
 	TEST_RR(    "sadd16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "sadd16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe61cff1a	@ sadd16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe61cff1a	@ sadd16	pc, r12, r10")
 	TEST_RR(    "sasx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "sasx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe61cff3a	@ sasx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe61cff3a	@ sasx	pc, r12, r10")
 	TEST_RR(    "ssax	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "ssax	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe61cff5a	@ ssax	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe61cff5a	@ ssax	pc, r12, r10")
 	TEST_RR(    "ssub16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "ssub16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe61cff7a	@ ssub16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe61cff7a	@ ssub16	pc, r12, r10")
 	TEST_RR(    "sadd8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "sadd8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe61cff9a	@ sadd8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe61000b0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe61fffbf") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe61000d0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe61fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe61cff9a	@ sadd8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe61000b0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe61fffbf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe61000d0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe61fffdf") /* Unallocated space */
 	TEST_RR(    "ssub8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "ssub8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe61cfffa	@ ssub8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe61cfffa	@ ssub8	pc, r12, r10")
 
 	TEST_RR(    "qadd16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "qadd16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe62cff1a	@ qadd16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe62cff1a	@ qadd16	pc, r12, r10")
 	TEST_RR(    "qasx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "qasx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe62cff3a	@ qasx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe62cff3a	@ qasx	pc, r12, r10")
 	TEST_RR(    "qsax	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "qsax	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe62cff5a	@ qsax	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe62cff5a	@ qsax	pc, r12, r10")
 	TEST_RR(    "qsub16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "qsub16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe62cff7a	@ qsub16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe62cff7a	@ qsub16	pc, r12, r10")
 	TEST_RR(    "qadd8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "qadd8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe62cff9a	@ qadd8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe62000b0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe62fffbf") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe62000d0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe62fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe62cff9a	@ qadd8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe62000b0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe62fffbf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe62000d0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe62fffdf") /* Unallocated space */
 	TEST_RR(    "qsub8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "qsub8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe62cfffa	@ qsub8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe62cfffa	@ qsub8	pc, r12, r10")
 
 	TEST_RR(    "shadd16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "shadd16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe63cff1a	@ shadd16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe63cff1a	@ shadd16	pc, r12, r10")
 	TEST_RR(    "shasx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "shasx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe63cff3a	@ shasx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe63cff3a	@ shasx	pc, r12, r10")
 	TEST_RR(    "shsax	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "shsax	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe63cff5a	@ shsax	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe63cff5a	@ shsax	pc, r12, r10")
 	TEST_RR(    "shsub16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "shsub16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe63cff7a	@ shsub16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe63cff7a	@ shsub16	pc, r12, r10")
 	TEST_RR(    "shadd8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "shadd8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe63cff9a	@ shadd8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe63000b0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe63fffbf") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe63000d0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe63fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe63cff9a	@ shadd8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe63000b0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe63fffbf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe63000d0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe63fffdf") /* Unallocated space */
 	TEST_RR(    "shsub8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "shsub8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe63cfffa	@ shsub8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe63cfffa	@ shsub8	pc, r12, r10")
 
 	TEST_GROUP("Parallel addition and subtraction, unsigned")
 
-	TEST_UNSUPPORTED(".word 0xe6400010") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe64fffff") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe6400010") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe64fffff") /* Unallocated space */
 
 	TEST_RR(    "uadd16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uadd16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe65cff1a	@ uadd16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe65cff1a	@ uadd16	pc, r12, r10")
 	TEST_RR(    "uasx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uasx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe65cff3a	@ uasx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe65cff3a	@ uasx	pc, r12, r10")
 	TEST_RR(    "usax	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "usax	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe65cff5a	@ usax	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe65cff5a	@ usax	pc, r12, r10")
 	TEST_RR(    "usub16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "usub16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe65cff7a	@ usub16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe65cff7a	@ usub16	pc, r12, r10")
 	TEST_RR(    "uadd8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uadd8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe65cff9a	@ uadd8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe65000b0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe65fffbf") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe65000d0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe65fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe65cff9a	@ uadd8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe65000b0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe65fffbf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe65000d0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe65fffdf") /* Unallocated space */
 	TEST_RR(    "usub8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "usub8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe65cfffa	@ usub8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe65cfffa	@ usub8	pc, r12, r10")
 
 	TEST_RR(    "uqadd16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uqadd16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe66cff1a	@ uqadd16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe66cff1a	@ uqadd16	pc, r12, r10")
 	TEST_RR(    "uqasx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uqasx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe66cff3a	@ uqasx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe66cff3a	@ uqasx	pc, r12, r10")
 	TEST_RR(    "uqsax	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uqsax	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe66cff5a	@ uqsax	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe66cff5a	@ uqsax	pc, r12, r10")
 	TEST_RR(    "uqsub16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uqsub16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe66cff7a	@ uqsub16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe66cff7a	@ uqsub16	pc, r12, r10")
 	TEST_RR(    "uqadd8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uqadd8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe66cff9a	@ uqadd8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe66000b0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe66fffbf") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe66000d0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe66fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe66cff9a	@ uqadd8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe66000b0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe66fffbf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe66000d0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe66fffdf") /* Unallocated space */
 	TEST_RR(    "uqsub8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uqsub8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe66cfffa	@ uqsub8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe66cfffa	@ uqsub8	pc, r12, r10")
 
 	TEST_RR(    "uhadd16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uhadd16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe67cff1a	@ uhadd16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe67cff1a	@ uhadd16	pc, r12, r10")
 	TEST_RR(    "uhasx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uhasx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe67cff3a	@ uhasx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe67cff3a	@ uhasx	pc, r12, r10")
 	TEST_RR(    "uhsax	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uhsax	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe67cff5a	@ uhsax	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe67cff5a	@ uhsax	pc, r12, r10")
 	TEST_RR(    "uhsub16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uhsub16	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe67cff7a	@ uhsub16	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe67cff7a	@ uhsub16	pc, r12, r10")
 	TEST_RR(    "uhadd8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uhadd8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe67cff9a	@ uhadd8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe67000b0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe67fffbf") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe67000d0") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe67fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe67cff9a	@ uhadd8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe67000b0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe67fffbf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe67000d0") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe67fffdf") /* Unallocated space */
 	TEST_RR(    "uhsub8	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uhsub8	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe67cfffa	@ uhsub8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe67feffa	@ uhsub8	r14, pc, r10")
-	TEST_UNSUPPORTED(".word 0xe67cefff	@ uhsub8	r14, r12, pc")
+	TEST_UNSUPPORTED(".inst 0xe67cfffa	@ uhsub8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe67feffa	@ uhsub8	r14, pc, r10")
+	TEST_UNSUPPORTED(".inst 0xe67cefff	@ uhsub8	r14, r12, pc")
 #endif /* __LINUX_ARM_ARCH__ >= 7 */
 
 #if __LINUX_ARM_ARCH__ >= 6
@@ -853,99 +852,99 @@ void kprobe_arm_test_cases(void)
 
 	TEST_RR(    "pkhbt	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "pkhbt	r14,r",12, HH1,", r",10,HH2,", lsl #2")
-	TEST_UNSUPPORTED(".word 0xe68cf11a	@ pkhbt	pc, r12, r10, lsl #2")
+	TEST_UNSUPPORTED(".inst 0xe68cf11a	@ pkhbt	pc, r12, r10, lsl #2")
 	TEST_RR(    "pkhtb	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "pkhtb	r14,r",12, HH1,", r",10,HH2,", asr #2")
-	TEST_UNSUPPORTED(".word 0xe68cf15a	@ pkhtb	pc, r12, r10, asr #2")
-	TEST_UNSUPPORTED(".word 0xe68fe15a	@ pkhtb	r14, pc, r10, asr #2")
-	TEST_UNSUPPORTED(".word 0xe68ce15f	@ pkhtb	r14, r12, pc, asr #2")
-	TEST_UNSUPPORTED(".word 0xe6900010") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe69fffdf") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe68cf15a	@ pkhtb	pc, r12, r10, asr #2")
+	TEST_UNSUPPORTED(".inst 0xe68fe15a	@ pkhtb	r14, pc, r10, asr #2")
+	TEST_UNSUPPORTED(".inst 0xe68ce15f	@ pkhtb	r14, r12, pc, asr #2")
+	TEST_UNSUPPORTED(".inst 0xe6900010") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe69fffdf") /* Unallocated space */
 
 	TEST_R(     "ssat	r0, #24, r",0,   VAL1,"")
 	TEST_R(     "ssat	r14, #24, r",12, VAL2,"")
 	TEST_R(     "ssat	r0, #24, r",0,   VAL1,", lsl #8")
 	TEST_R(     "ssat	r14, #24, r",12, VAL2,", asr #8")
-	TEST_UNSUPPORTED(".word 0xe6b7f01c	@ ssat	pc, #24, r12")
+	TEST_UNSUPPORTED(".inst 0xe6b7f01c	@ ssat	pc, #24, r12")
 
 	TEST_R(     "usat	r0, #24, r",0,   VAL1,"")
 	TEST_R(     "usat	r14, #24, r",12, VAL2,"")
 	TEST_R(     "usat	r0, #24, r",0,   VAL1,", lsl #8")
 	TEST_R(     "usat	r14, #24, r",12, VAL2,", asr #8")
-	TEST_UNSUPPORTED(".word 0xe6f7f01c	@ usat	pc, #24, r12")
+	TEST_UNSUPPORTED(".inst 0xe6f7f01c	@ usat	pc, #24, r12")
 
 	TEST_RR(    "sxtab16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "sxtab16	r14,r",12, HH2,", r",10,HH1,", ror #8")
 	TEST_R(     "sxtb16	r8, r",7,  HH1,"")
-	TEST_UNSUPPORTED(".word 0xe68cf47a	@ sxtab16	pc,r12, r10, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe68cf47a	@ sxtab16	pc,r12, r10, ror #8")
 
 	TEST_RR(    "sel	r0, r",0,  VAL1,", r",1, VAL2,"")
 	TEST_RR(    "sel	r14, r",12,VAL1,", r",10, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe68cffba	@ sel	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe68fefba	@ sel	r14, pc, r10")
-	TEST_UNSUPPORTED(".word 0xe68cefbf	@ sel	r14, r12, pc")
+	TEST_UNSUPPORTED(".inst 0xe68cffba	@ sel	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe68fefba	@ sel	r14, pc, r10")
+	TEST_UNSUPPORTED(".inst 0xe68cefbf	@ sel	r14, r12, pc")
 
 	TEST_R(     "ssat16	r0, #12, r",0,   HH1,"")
 	TEST_R(     "ssat16	r14, #12, r",12, HH2,"")
-	TEST_UNSUPPORTED(".word 0xe6abff3c	@ ssat16	pc, #12, r12")
+	TEST_UNSUPPORTED(".inst 0xe6abff3c	@ ssat16	pc, #12, r12")
 
 	TEST_RR(    "sxtab	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "sxtab	r14,r",12, HH2,", r",10,HH1,", ror #8")
 	TEST_R(     "sxtb	r8, r",7,  HH1,"")
-	TEST_UNSUPPORTED(".word 0xe6acf47a	@ sxtab	pc,r12, r10, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe6acf47a	@ sxtab	pc,r12, r10, ror #8")
 
 	TEST_R(     "rev	r0, r",0,   VAL1,"")
 	TEST_R(     "rev	r14, r",12, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe6bfff3c	@ rev	pc, r12")
+	TEST_UNSUPPORTED(".inst 0xe6bfff3c	@ rev	pc, r12")
 
 	TEST_RR(    "sxtah	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "sxtah	r14,r",12, HH2,", r",10,HH1,", ror #8")
 	TEST_R(     "sxth	r8, r",7,  HH1,"")
-	TEST_UNSUPPORTED(".word 0xe6bcf47a	@ sxtah	pc,r12, r10, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe6bcf47a	@ sxtah	pc,r12, r10, ror #8")
 
 	TEST_R(     "rev16	r0, r",0,   VAL1,"")
 	TEST_R(     "rev16	r14, r",12, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe6bfffbc	@ rev16	pc, r12")
+	TEST_UNSUPPORTED(".inst 0xe6bfffbc	@ rev16	pc, r12")
 
 	TEST_RR(    "uxtab16	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uxtab16	r14,r",12, HH2,", r",10,HH1,", ror #8")
 	TEST_R(     "uxtb16	r8, r",7,  HH1,"")
-	TEST_UNSUPPORTED(".word 0xe6ccf47a	@ uxtab16	pc,r12, r10, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe6ccf47a	@ uxtab16	pc,r12, r10, ror #8")
 
 	TEST_R(     "usat16	r0, #12, r",0,   HH1,"")
 	TEST_R(     "usat16	r14, #12, r",12, HH2,"")
-	TEST_UNSUPPORTED(".word 0xe6ecff3c	@ usat16	pc, #12, r12")
-	TEST_UNSUPPORTED(".word 0xe6ecef3f	@ usat16	r14, #12, pc")
+	TEST_UNSUPPORTED(".inst 0xe6ecff3c	@ usat16	pc, #12, r12")
+	TEST_UNSUPPORTED(".inst 0xe6ecef3f	@ usat16	r14, #12, pc")
 
 	TEST_RR(    "uxtab	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uxtab	r14,r",12, HH2,", r",10,HH1,", ror #8")
 	TEST_R(     "uxtb	r8, r",7,  HH1,"")
-	TEST_UNSUPPORTED(".word 0xe6ecf47a	@ uxtab	pc,r12, r10, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe6ecf47a	@ uxtab	pc,r12, r10, ror #8")
 
 #if __LINUX_ARM_ARCH__ >= 7
 	TEST_R(     "rbit	r0, r",0,   VAL1,"")
 	TEST_R(     "rbit	r14, r",12, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe6ffff3c	@ rbit	pc, r12")
+	TEST_UNSUPPORTED(".inst 0xe6ffff3c	@ rbit	pc, r12")
 #endif
 
 	TEST_RR(    "uxtah	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(    "uxtah	r14,r",12, HH2,", r",10,HH1,", ror #8")
 	TEST_R(     "uxth	r8, r",7,  HH1,"")
-	TEST_UNSUPPORTED(".word 0xe6fff077	@ uxth	pc, r7")
-	TEST_UNSUPPORTED(".word 0xe6ff807f	@ uxth	r8, pc")
-	TEST_UNSUPPORTED(".word 0xe6fcf47a	@ uxtah	pc, r12, r10, ror #8")
-	TEST_UNSUPPORTED(".word 0xe6fce47f	@ uxtah	r14, r12, pc, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe6fff077	@ uxth	pc, r7")
+	TEST_UNSUPPORTED(".inst 0xe6ff807f	@ uxth	r8, pc")
+	TEST_UNSUPPORTED(".inst 0xe6fcf47a	@ uxtah	pc, r12, r10, ror #8")
+	TEST_UNSUPPORTED(".inst 0xe6fce47f	@ uxtah	r14, r12, pc, ror #8")
 
 	TEST_R(     "revsh	r0, r",0,   VAL1,"")
 	TEST_R(     "revsh	r14, r",12, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe6ffff3c	@ revsh	pc, r12")
-	TEST_UNSUPPORTED(".word 0xe6ffef3f	@ revsh	r14, pc")
+	TEST_UNSUPPORTED(".inst 0xe6ffff3c	@ revsh	pc, r12")
+	TEST_UNSUPPORTED(".inst 0xe6ffef3f	@ revsh	r14, pc")
 
-	TEST_UNSUPPORTED(".word 0xe6900070") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe69fff7f") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe6900070") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe69fff7f") /* Unallocated space */
 
-	TEST_UNSUPPORTED(".word 0xe6d00070") /* Unallocated space */
-	TEST_UNSUPPORTED(".word 0xe6dfff7f") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe6d00070") /* Unallocated space */
+	TEST_UNSUPPORTED(".inst 0xe6dfff7f") /* Unallocated space */
 #endif /* __LINUX_ARM_ARCH__ >= 6 */
 
 #if __LINUX_ARM_ARCH__ >= 6
@@ -953,79 +952,79 @@ void kprobe_arm_test_cases(void)
 
 	TEST_RRR(   "smlad	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
 	TEST_RRR(   "smlad	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe70f8a1c	@ smlad	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe70f8a1c	@ smlad	pc, r12, r10, r8")
 	TEST_RRR(   "smladx	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
 	TEST_RRR(   "smladx	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe70f8a3c	@ smladx	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe70f8a3c	@ smladx	pc, r12, r10, r8")
 
 	TEST_RR(   "smuad	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(   "smuad	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe70ffa1c	@ smuad	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe70ffa1c	@ smuad	pc, r12, r10")
 	TEST_RR(   "smuadx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(   "smuadx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe70ffa3c	@ smuadx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe70ffa3c	@ smuadx	pc, r12, r10")
 
 	TEST_RRR(   "smlsd	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
 	TEST_RRR(   "smlsd	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe70f8a5c	@ smlsd	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe70f8a5c	@ smlsd	pc, r12, r10, r8")
 	TEST_RRR(   "smlsdx	r0, r",0,  HH1,", r",1, HH2,", r",2, VAL1,"")
 	TEST_RRR(   "smlsdx	r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe70f8a7c	@ smlsdx	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe70f8a7c	@ smlsdx	pc, r12, r10, r8")
 
 	TEST_RR(   "smusd	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(   "smusd	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe70ffa5c	@ smusd	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe70ffa5c	@ smusd	pc, r12, r10")
 	TEST_RR(   "smusdx	r0, r",0,  HH1,", r",1, HH2,"")
 	TEST_RR(   "smusdx	r14, r",12,HH2,", r",10,HH1,"")
-	TEST_UNSUPPORTED(".word 0xe70ffa7c	@ smusdx	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe70ffa7c	@ smusdx	pc, r12, r10")
 
 	TEST_RRRR( "smlald	r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
 	TEST_RRRR( "smlald	r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
-	TEST_UNSUPPORTED(".word 0xe74af819	@ smlald	pc, r10, r9, r8")
-	TEST_UNSUPPORTED(".word 0xe74fb819	@ smlald	r11, pc, r9, r8")
-	TEST_UNSUPPORTED(".word 0xe74ab81f	@ smlald	r11, r10, pc, r8")
-	TEST_UNSUPPORTED(".word 0xe74abf19	@ smlald	r11, r10, r9, pc")
+	TEST_UNSUPPORTED(".inst 0xe74af819	@ smlald	pc, r10, r9, r8")
+	TEST_UNSUPPORTED(".inst 0xe74fb819	@ smlald	r11, pc, r9, r8")
+	TEST_UNSUPPORTED(".inst 0xe74ab81f	@ smlald	r11, r10, pc, r8")
+	TEST_UNSUPPORTED(".inst 0xe74abf19	@ smlald	r11, r10, r9, pc")
 
 	TEST_RRRR( "smlaldx	r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
 	TEST_RRRR( "smlaldx	r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
-	TEST_UNSUPPORTED(".word 0xe74af839	@ smlaldx	pc, r10, r9, r8")
-	TEST_UNSUPPORTED(".word 0xe74fb839	@ smlaldx	r11, pc, r9, r8")
+	TEST_UNSUPPORTED(".inst 0xe74af839	@ smlaldx	pc, r10, r9, r8")
+	TEST_UNSUPPORTED(".inst 0xe74fb839	@ smlaldx	r11, pc, r9, r8")
 
 	TEST_RRR(  "smmla	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
 	TEST_RRR(  "smmla	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe75f8a1c	@ smmla	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe75f8a1c	@ smmla	pc, r12, r10, r8")
 	TEST_RRR(  "smmlar	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
 	TEST_RRR(  "smmlar	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe75f8a3c	@ smmlar	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe75f8a3c	@ smmlar	pc, r12, r10, r8")
 
 	TEST_RR(   "smmul	r0, r",0,  VAL1,", r",1, VAL2,"")
 	TEST_RR(   "smmul	r14, r",12,VAL2,", r",10,VAL1,"")
-	TEST_UNSUPPORTED(".word 0xe75ffa1c	@ smmul	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe75ffa1c	@ smmul	pc, r12, r10")
 	TEST_RR(   "smmulr	r0, r",0,  VAL1,", r",1, VAL2,"")
 	TEST_RR(   "smmulr	r14, r",12,VAL2,", r",10,VAL1,"")
-	TEST_UNSUPPORTED(".word 0xe75ffa3c	@ smmulr	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe75ffa3c	@ smmulr	pc, r12, r10")
 
 	TEST_RRR(  "smmls	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
 	TEST_RRR(  "smmls	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe75f8adc	@ smmls	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe75f8adc	@ smmls	pc, r12, r10, r8")
 	TEST_RRR(  "smmlsr	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL1,"")
 	TEST_RRR(  "smmlsr	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
-	TEST_UNSUPPORTED(".word 0xe75f8afc	@ smmlsr	pc, r12, r10, r8")
-	TEST_UNSUPPORTED(".word 0xe75e8aff	@ smmlsr	r14, pc, r10, r8")
-	TEST_UNSUPPORTED(".word 0xe75e8ffc	@ smmlsr	r14, r12, pc, r8")
-	TEST_UNSUPPORTED(".word 0xe75efafc	@ smmlsr	r14, r12, r10, pc")
+	TEST_UNSUPPORTED(".inst 0xe75f8afc	@ smmlsr	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe75e8aff	@ smmlsr	r14, pc, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe75e8ffc	@ smmlsr	r14, r12, pc, r8")
+	TEST_UNSUPPORTED(".inst 0xe75efafc	@ smmlsr	r14, r12, r10, pc")
 
 	TEST_RR(   "usad8	r0, r",0,  VAL1,", r",1, VAL2,"")
 	TEST_RR(   "usad8	r14, r",12,VAL2,", r",10,VAL1,"")
-	TEST_UNSUPPORTED(".word 0xe75ffa1c	@ usad8	pc, r12, r10")
-	TEST_UNSUPPORTED(".word 0xe75efa1f	@ usad8	r14, pc, r10")
-	TEST_UNSUPPORTED(".word 0xe75eff1c	@ usad8	r14, r12, pc")
+	TEST_UNSUPPORTED(".inst 0xe75ffa1c	@ usad8	pc, r12, r10")
+	TEST_UNSUPPORTED(".inst 0xe75efa1f	@ usad8	r14, pc, r10")
+	TEST_UNSUPPORTED(".inst 0xe75eff1c	@ usad8	r14, r12, pc")
 
 	TEST_RRR(  "usada8	r0, r",0,  VAL1,", r",1, VAL2,", r",2, VAL3,"")
 	TEST_RRR(  "usada8	r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL3,"")
-	TEST_UNSUPPORTED(".word 0xe78f8a1c	@ usada8	pc, r12, r10, r8")
-	TEST_UNSUPPORTED(".word 0xe78e8a1f	@ usada8	r14, pc, r10, r8")
-	TEST_UNSUPPORTED(".word 0xe78e8f1c	@ usada8	r14, r12, pc, r8")
+	TEST_UNSUPPORTED(".inst 0xe78f8a1c	@ usada8	pc, r12, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe78e8a1f	@ usada8	r14, pc, r10, r8")
+	TEST_UNSUPPORTED(".inst 0xe78e8f1c	@ usada8	r14, r12, pc, r8")
 #endif /* __LINUX_ARM_ARCH__ >= 6 */
 
 #if __LINUX_ARM_ARCH__ >= 7
@@ -1034,26 +1033,26 @@ void kprobe_arm_test_cases(void)
 	TEST_R(     "sbfx	r0, r",0  , VAL1,", #0, #31")
 	TEST_R(     "sbfxeq	r14, r",12, VAL2,", #8, #16")
 	TEST_R(     "sbfx	r4, r",10,  VAL1,", #16, #15")
-	TEST_UNSUPPORTED(".word 0xe7aff45c	@ sbfx	pc, r12, #8, #16")
+	TEST_UNSUPPORTED(".inst 0xe7aff45c	@ sbfx	pc, r12, #8, #16")
 
 	TEST_R(     "ubfx	r0, r",0  , VAL1,", #0, #31")
 	TEST_R(     "ubfxcs	r14, r",12, VAL2,", #8, #16")
 	TEST_R(     "ubfx	r4, r",10,  VAL1,", #16, #15")
-	TEST_UNSUPPORTED(".word 0xe7eff45c	@ ubfx	pc, r12, #8, #16")
-	TEST_UNSUPPORTED(".word 0xe7efc45f	@ ubfx	r12, pc, #8, #16")
+	TEST_UNSUPPORTED(".inst 0xe7eff45c	@ ubfx	pc, r12, #8, #16")
+	TEST_UNSUPPORTED(".inst 0xe7efc45f	@ ubfx	r12, pc, #8, #16")
 
 	TEST_R(     "bfc	r",0, VAL1,", #4, #20")
 	TEST_R(     "bfcvs	r",14,VAL2,", #4, #20")
 	TEST_R(     "bfc	r",7, VAL1,", #0, #31")
 	TEST_R(     "bfc	r",8, VAL2,", #0, #31")
-	TEST_UNSUPPORTED(".word 0xe7def01f	@ bfc	pc, #0, #31");
+	TEST_UNSUPPORTED(".inst 0xe7def01f	@ bfc	pc, #0, #31");
 
 	TEST_RR(    "bfi	r",0, VAL1,", r",0  , VAL2,", #0, #31")
 	TEST_RR(    "bfipl	r",12,VAL1,", r",14 , VAL2,", #4, #20")
-	TEST_UNSUPPORTED(".word 0xe7d7f21e	@ bfi	pc, r14, #4, #20")
+	TEST_UNSUPPORTED(".inst 0xe7d7f21e	@ bfi	pc, r14, #4, #20")
 
-	TEST_UNSUPPORTED(".word 0x07f000f0")  /* Permanently UNDEFINED */
-	TEST_UNSUPPORTED(".word 0x07ffffff")  /* Permanently UNDEFINED */
+	TEST_UNSUPPORTED(".inst 0x07f000f0")  /* Permanently UNDEFINED */
+	TEST_UNSUPPORTED(".inst 0x07ffffff")  /* Permanently UNDEFINED */
 #endif /* __LINUX_ARM_ARCH__ >= 6 */
 
 	TEST_GROUP("Branch, branch with link, and block data transfer")
@@ -1180,43 +1179,43 @@ void kprobe_arm_test_cases(void)
 										\
 	TEST_COPROCESSOR( "stc"two"	0, cr0, [r15, #4]")			\
 	TEST_COPROCESSOR( "stc"two"	0, cr0, [r15, #-4]")			\
-	TEST_UNSUPPORTED(".word 0x"cc"daf0001	@ stc"two"	0, cr0, [r15, #4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"d2f0001	@ stc"two"	0, cr0, [r15, #-4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"caf0001	@ stc"two"	0, cr0, [r15], #4")	\
-	TEST_UNSUPPORTED(".word 0x"cc"c2f0001	@ stc"two"	0, cr0, [r15], #-4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"daf0001	@ stc"two"	0, cr0, [r15, #4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"d2f0001	@ stc"two"	0, cr0, [r15, #-4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"caf0001	@ stc"two"	0, cr0, [r15], #4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c2f0001	@ stc"two"	0, cr0, [r15], #-4")	\
 	TEST_COPROCESSOR( "stc"two"	0, cr0, [r15], {1}")			\
 	TEST_COPROCESSOR( "stc"two"l	0, cr0, [r15, #4]")			\
 	TEST_COPROCESSOR( "stc"two"l	0, cr0, [r15, #-4]")			\
-	TEST_UNSUPPORTED(".word 0x"cc"def0001	@ stc"two"l	0, cr0, [r15, #4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"d6f0001	@ stc"two"l	0, cr0, [r15, #-4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"cef0001	@ stc"two"l	0, cr0, [r15], #4")	\
-	TEST_UNSUPPORTED(".word 0x"cc"c6f0001	@ stc"two"l	0, cr0, [r15], #-4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"def0001	@ stc"two"l	0, cr0, [r15, #4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"d6f0001	@ stc"two"l	0, cr0, [r15, #-4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"cef0001	@ stc"two"l	0, cr0, [r15], #4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c6f0001	@ stc"two"l	0, cr0, [r15], #-4")	\
 	TEST_COPROCESSOR( "stc"two"l	0, cr0, [r15], {1}")			\
 	TEST_COPROCESSOR( "ldc"two"	0, cr0, [r15, #4]")			\
 	TEST_COPROCESSOR( "ldc"two"	0, cr0, [r15, #-4]")			\
-	TEST_UNSUPPORTED(".word 0x"cc"dbf0001	@ ldc"two"	0, cr0, [r15, #4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"d3f0001	@ ldc"two"	0, cr0, [r15, #-4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"cbf0001	@ ldc"two"	0, cr0, [r15], #4")	\
-	TEST_UNSUPPORTED(".word 0x"cc"c3f0001	@ ldc"two"	0, cr0, [r15], #-4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"dbf0001	@ ldc"two"	0, cr0, [r15, #4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"d3f0001	@ ldc"two"	0, cr0, [r15, #-4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"cbf0001	@ ldc"two"	0, cr0, [r15], #4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c3f0001	@ ldc"two"	0, cr0, [r15], #-4")	\
 	TEST_COPROCESSOR( "ldc"two"	0, cr0, [r15], {1}")			\
 	TEST_COPROCESSOR( "ldc"two"l	0, cr0, [r15, #4]")			\
 	TEST_COPROCESSOR( "ldc"two"l	0, cr0, [r15, #-4]")			\
-	TEST_UNSUPPORTED(".word 0x"cc"dff0001	@ ldc"two"l	0, cr0, [r15, #4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"d7f0001	@ ldc"two"l	0, cr0, [r15, #-4]!")	\
-	TEST_UNSUPPORTED(".word 0x"cc"cff0001	@ ldc"two"l	0, cr0, [r15], #4")	\
-	TEST_UNSUPPORTED(".word 0x"cc"c7f0001	@ ldc"two"l	0, cr0, [r15], #-4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"dff0001	@ ldc"two"l	0, cr0, [r15, #4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"d7f0001	@ ldc"two"l	0, cr0, [r15, #-4]!")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"cff0001	@ ldc"two"l	0, cr0, [r15], #4")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c7f0001	@ ldc"two"l	0, cr0, [r15], #-4")	\
 	TEST_COPROCESSOR( "ldc"two"l	0, cr0, [r15], {1}")
 
 #define COPROCESSOR_INSTRUCTIONS_MC_MR(two,cc)					\
 										\
 	TEST_COPROCESSOR( "mcrr"two"	0, 15, r0, r14, cr0")			\
 	TEST_COPROCESSOR( "mcrr"two"	15, 0, r14, r0, cr15")			\
-	TEST_UNSUPPORTED(".word 0x"cc"c4f00f0	@ mcrr"two"	0, 15, r0, r15, cr0")	\
-	TEST_UNSUPPORTED(".word 0x"cc"c40ff0f	@ mcrr"two"	15, 0, r15, r0, cr15")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c4f00f0	@ mcrr"two"	0, 15, r0, r15, cr0")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c40ff0f	@ mcrr"two"	15, 0, r15, r0, cr15")	\
 	TEST_COPROCESSOR( "mrrc"two"	0, 15, r0, r14, cr0")			\
 	TEST_COPROCESSOR( "mrrc"two"	15, 0, r14, r0, cr15")			\
-	TEST_UNSUPPORTED(".word 0x"cc"c5f00f0	@ mrrc"two"	0, 15, r0, r15, cr0")	\
-	TEST_UNSUPPORTED(".word 0x"cc"c50ff0f	@ mrrc"two"	15, 0, r15, r0, cr15")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c5f00f0	@ mrrc"two"	0, 15, r0, r15, cr0")	\
+	TEST_UNSUPPORTED(".inst 0x"cc"c50ff0f	@ mrrc"two"	15, 0, r15, r0, cr15")	\
 	TEST_COPROCESSOR( "cdp"two"	15, 15, cr15, cr15, cr15, 7")		\
 	TEST_COPROCESSOR( "cdp"two"	0, 0, cr0, cr0, cr0, 0")		\
 	TEST_COPROCESSOR( "mcr"two"	15, 7, r15, cr15, cr15, 7")		\
@@ -1251,14 +1250,14 @@ void kprobe_arm_test_cases(void)
 	TEST_UNSUPPORTED("rfedb	sp!")
 	TEST_UNSUPPORTED("rfeia	sp!")
 	TEST_UNSUPPORTED("rfeib	sp!")
-	TEST_UNSUPPORTED(".word 0xf81d0a00	@ rfeda	pc")
-	TEST_UNSUPPORTED(".word 0xf91d0a00	@ rfedb	pc")
-	TEST_UNSUPPORTED(".word 0xf89d0a00	@ rfeia	pc")
-	TEST_UNSUPPORTED(".word 0xf99d0a00	@ rfeib	pc")
-	TEST_UNSUPPORTED(".word 0xf83d0a00	@ rfeda	pc!")
-	TEST_UNSUPPORTED(".word 0xf93d0a00	@ rfedb	pc!")
-	TEST_UNSUPPORTED(".word 0xf8bd0a00	@ rfeia	pc!")
-	TEST_UNSUPPORTED(".word 0xf9bd0a00	@ rfeib	pc!")
+	TEST_UNSUPPORTED(".inst 0xf81d0a00	@ rfeda	pc")
+	TEST_UNSUPPORTED(".inst 0xf91d0a00	@ rfedb	pc")
+	TEST_UNSUPPORTED(".inst 0xf89d0a00	@ rfeia	pc")
+	TEST_UNSUPPORTED(".inst 0xf99d0a00	@ rfeib	pc")
+	TEST_UNSUPPORTED(".inst 0xf83d0a00	@ rfeda	pc!")
+	TEST_UNSUPPORTED(".inst 0xf93d0a00	@ rfedb	pc!")
+	TEST_UNSUPPORTED(".inst 0xf8bd0a00	@ rfeia	pc!")
+	TEST_UNSUPPORTED(".inst 0xf9bd0a00	@ rfeib	pc!")
 #endif /* __LINUX_ARM_ARCH__ >= 6 */
 
 #if __LINUX_ARM_ARCH__ >= 6
@@ -1317,9 +1316,9 @@ void kprobe_arm_test_cases(void)
 #endif
 
 #if __LINUX_ARM_ARCH__ >= 7
-	TEST_SUPPORTED(  ".word 0xf590f000	@ pldw [r0, #0]")
-	TEST_SUPPORTED(  ".word 0xf797f000	@ pldw	[r7, r0]")
-	TEST_SUPPORTED(  ".word 0xf798f18c	@ pldw	[r8, r12, lsl #3]");
+	TEST_SUPPORTED(  ".inst 0xf590f000	@ pldw [r0, #0]")
+	TEST_SUPPORTED(  ".inst 0xf797f000	@ pldw	[r7, r0]")
+	TEST_SUPPORTED(  ".inst 0xf798f18c	@ pldw	[r8, r12, lsl #3]");
 #endif
 
 #if __LINUX_ARM_ARCH__ >= 7
-- 
1.7.10.4

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

* [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h>
  2013-07-25 21:08 fyi - kprobes testing patches Ben Dooks
  2013-07-25 21:08 ` [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h> Ben Dooks
  2013-07-25 21:08 ` [PATCH 2/4] ARM: kprobes, change arm test to .instr Ben Dooks
@ 2013-07-25 21:08 ` Ben Dooks
  2013-07-29  8:07   ` Jon Medhurst (Tixy)
  2013-07-25 21:08 ` [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text Ben Dooks
  2013-07-26 10:52 ` fyi - kprobes testing patches Ben Dooks
  4 siblings, 1 reply; 15+ messages in thread
From: Ben Dooks @ 2013-07-25 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

Ensure we read instructions in the correct endian-ness by using
the <asm/opcodes.h> helper to transform them as necessary.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/kernel/kprobes-test.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
index 0cd63d0..6cfa04d 100644
--- a/arch/arm/kernel/kprobes-test.c
+++ b/arch/arm/kernel/kprobes-test.c
@@ -1374,13 +1374,13 @@ static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
 
 	if (test_case_is_thumb) {
 		u16 *p = (u16 *)(test_code & ~1);
-		current_instruction = p[0];
+		current_instruction = __mem_to_opcode_thumb16(p[0]);
 		if (is_wide_instruction(current_instruction)) {
-			current_instruction <<= 16;
-			current_instruction |= p[1];
+			u16 instr2 = __mem_to_opcode_thumb16(p[1]);
+			current_instruction = ___asm_opcode_thumb32_compose(current_instruction, instr2);
 		}
 	} else {
-		current_instruction = *(u32 *)test_code;
+		current_instruction = __mem_to_opcode_arm(*(u32 *)test_code);
 	}
 
 	if (current_title[0] == '.')
@@ -1593,7 +1593,6 @@ static int run_test_cases(void (*tests)(void), const union decode_item *table)
 	return 0;
 }
 
-
 static int __init run_all_tests(void)
 {
 	int ret = 0;
-- 
1.7.10.4

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

* [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text
  2013-07-25 21:08 fyi - kprobes testing patches Ben Dooks
                   ` (2 preceding siblings ...)
  2013-07-25 21:08 ` [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h> Ben Dooks
@ 2013-07-25 21:08 ` Ben Dooks
  2013-07-26 14:02   ` Dave Martin
  2013-07-26 10:52 ` fyi - kprobes testing patches Ben Dooks
  4 siblings, 1 reply; 15+ messages in thread
From: Ben Dooks @ 2013-07-25 21:08 UTC (permalink / raw)
  To: linux-arm-kernel

When testing the kprobes test code with BE8, there is either an
issue with the linker or how the code is being built. The issue
is with embedding the title text as the first part of the test.

Change to placing a pointer to .rodata with the text title in it
for the test which seems to stop the issue of the alignment of
the data following it being changed arbitrarily by the linker.

The proper thing to do here is to fix the linker, however this
patch also makes the output much easier to read as there are no
variable length data items here any more.

CC: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/kernel/kprobes-test.c |   12 +++++-------
 arch/arm/kernel/kprobes-test.h |    6 ++++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
index 6cfa04d..a915ac3 100644
--- a/arch/arm/kernel/kprobes-test.c
+++ b/arch/arm/kernel/kprobes-test.c
@@ -111,9 +111,7 @@
  *	@ TESTCASE_START
  *	bl	__kprobes_test_case_start
  *	@ start of inline data...
- *	.ascii "mov r0, r7"	@ text title for test case
- *	.byte	0
- *	.align	2
+ *	.word	title_addr	 @ text title for test case
  *
  *	@ TEST_ARG_REG
  *	.byte	ARG_TYPE_REG
@@ -959,7 +957,7 @@ void __naked __kprobes_test_case_start(void)
 	__asm__ __volatile__ (
 		"stmdb	sp!, {r4-r11}				\n\t"
 		"sub	sp, sp, #"__stringify(TEST_MEMORY_SIZE)"\n\t"
-		"bic	r0, lr, #1  @ r0 = inline title string	\n\t"
+		"bic	r0, lr, #3  @ r0 = inline title block	\n\t"
 		"mov	r1, sp					\n\t"
 		"bl	kprobes_test_case_start			\n\t"
 		"bx	r0					\n\t"
@@ -1336,15 +1334,15 @@ static unsigned long next_instruction(unsigned long pc)
 	return pc + 4;
 }
 
-static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
+static uintptr_t __used kprobes_test_case_start(const char **title, void *stack)
 {
 	struct test_arg *args;
 	struct test_arg_end *end_arg;
 	unsigned long test_code;
 
-	args = (struct test_arg *)PTR_ALIGN(title + strlen(title) + 1, 4);
+	args = (struct test_arg *)(title + 1);
 
-	current_title = title;
+	current_title = *title;
 	current_args = args;
 	current_stack = stack;
 
diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h
index e28a869..a71db09 100644
--- a/arch/arm/kernel/kprobes-test.h
+++ b/arch/arm/kernel/kprobes-test.h
@@ -113,9 +113,11 @@ struct test_arg_end {
 	"bl	__kprobes_test_case_start		\n\t"	\
 	/* don't use .asciz here as 'title' may be */		\
 	/* multiple strings to be concatenated.  */		\
-	".ascii "#title"				\n\t"	\
+	".pushsection .rodata				\n\t"	\
+	"9999: .ascii "#title"				\n\t"	\
 	".byte	0					\n\t"	\
-	".align	2					\n\t"
+	".popsection					\n\t"	\
+	".word	9999b					\n\t"
 
 #define	TEST_ARG_REG(reg, val)					\
 	".byte	"__stringify(ARG_TYPE_REG)"		\n\t"	\
-- 
1.7.10.4

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

* fyi - kprobes testing patches
  2013-07-25 21:08 fyi - kprobes testing patches Ben Dooks
                   ` (3 preceding siblings ...)
  2013-07-25 21:08 ` [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text Ben Dooks
@ 2013-07-26 10:52 ` Ben Dooks
  4 siblings, 0 replies; 15+ messages in thread
From: Ben Dooks @ 2013-07-26 10:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 25/07/13 22:08, Ben Dooks wrote:
> I've been working on kprobes and the kprobes-test driver. It seems
> there are more issues with the kprobes-test that need looking in to
> so I am putting this series out to see if anyone has any comments

the testing logs show a few failures with BE8 mode, however with the
patch series applied the kernel no longer oopses during testing.
                 > FAIL: registers differ 

> FAIL: Test mov  pc, r0, asl r1
> FAIL: Scenario 0
> initial_regs:
> r0  8001b37c | r1  00000000 | r2  21522352 | r3  21522252
> r4  21522552 | r5  21522452 | r6  21522752 | r7  21522652
> r8  21522952 | r9  21522852 | r10 21522b52 | r11 21522a52
> r12 21522d52 | sp  9f847dd4 | lr  21522f52 | pc  8001b370
> cpsr 00000213
> expected_regs:
> expected_regs:
> r0  8001b37c | r1  00000000 | r2  21522352 | r3  21522252
> r4  21522552 | r5  21522452 | r6  21522752 | r7  21522652
> r8  21522952 | r9  21522852 | r10 21522b52 | r11 21522a52
> r12 21522d52 | sp  9f847dd4 | lr  21522f52 | pc  8001b374
> cpsr 00000213
> result_regs:
> r0  8001b37c | r1  00000000 | r2  21522352 | r3  21522252
> r4  21522552 | r5  21522452 | r6  21522752 | r7  21522652
> r8  21522952 | r9  21522852 | r10 21522b52 | r11 21522a52
> r12 21522d52 | sp  9f847dd4 | lr  21522f52 | pc  8001b37c
> cpsr 00000213




-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text
  2013-07-25 21:08 ` [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text Ben Dooks
@ 2013-07-26 14:02   ` Dave Martin
  2013-07-26 14:08     ` Ben Dooks
  0 siblings, 1 reply; 15+ messages in thread
From: Dave Martin @ 2013-07-26 14:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 25, 2013 at 10:08:57PM +0100, Ben Dooks wrote:
> When testing the kprobes test code with BE8, there is either an
> issue with the linker or how the code is being built. The issue
> is with embedding the title text as the first part of the test.
> 
> Change to placing a pointer to .rodata with the text title in it
> for the test which seems to stop the issue of the alignment of
> the data following it being changed arbitrarily by the linker.
> 
> The proper thing to do here is to fix the linker, however this
> patch also makes the output much easier to read as there are no
> variable length data items here any more.

Can you elaborate?  I don't understand from this what problem you are
trying to solve.  Can you give a more concrete example?

It should be impossible for the linker to change the alignment of
anything _within_ an input section (bugs notwithstanding).

The assembler might be doing something unexpected, particularly
for Thumb kernels, but I don't know of any bug relating to this.

Cheers
---Dave

> 
> CC: Jon Medhurst <tixy@yxit.co.uk>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  arch/arm/kernel/kprobes-test.c |   12 +++++-------
>  arch/arm/kernel/kprobes-test.h |    6 ++++--
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
> index 6cfa04d..a915ac3 100644
> --- a/arch/arm/kernel/kprobes-test.c
> +++ b/arch/arm/kernel/kprobes-test.c
> @@ -111,9 +111,7 @@
>   *	@ TESTCASE_START
>   *	bl	__kprobes_test_case_start
>   *	@ start of inline data...
> - *	.ascii "mov r0, r7"	@ text title for test case
> - *	.byte	0
> - *	.align	2
> + *	.word	title_addr	 @ text title for test case
>   *
>   *	@ TEST_ARG_REG
>   *	.byte	ARG_TYPE_REG
> @@ -959,7 +957,7 @@ void __naked __kprobes_test_case_start(void)
>  	__asm__ __volatile__ (
>  		"stmdb	sp!, {r4-r11}				\n\t"
>  		"sub	sp, sp, #"__stringify(TEST_MEMORY_SIZE)"\n\t"
> -		"bic	r0, lr, #1  @ r0 = inline title string	\n\t"
> +		"bic	r0, lr, #3  @ r0 = inline title block	\n\t"
>  		"mov	r1, sp					\n\t"
>  		"bl	kprobes_test_case_start			\n\t"
>  		"bx	r0					\n\t"
> @@ -1336,15 +1334,15 @@ static unsigned long next_instruction(unsigned long pc)
>  	return pc + 4;
>  }
>  
> -static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
> +static uintptr_t __used kprobes_test_case_start(const char **title, void *stack)
>  {
>  	struct test_arg *args;
>  	struct test_arg_end *end_arg;
>  	unsigned long test_code;
>  
> -	args = (struct test_arg *)PTR_ALIGN(title + strlen(title) + 1, 4);
> +	args = (struct test_arg *)(title + 1);
>  
> -	current_title = title;
> +	current_title = *title;
>  	current_args = args;
>  	current_stack = stack;
>  
> diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h
> index e28a869..a71db09 100644
> --- a/arch/arm/kernel/kprobes-test.h
> +++ b/arch/arm/kernel/kprobes-test.h
> @@ -113,9 +113,11 @@ struct test_arg_end {
>  	"bl	__kprobes_test_case_start		\n\t"	\
>  	/* don't use .asciz here as 'title' may be */		\
>  	/* multiple strings to be concatenated.  */		\
> -	".ascii "#title"				\n\t"	\
> +	".pushsection .rodata				\n\t"	\
> +	"9999: .ascii "#title"				\n\t"	\
>  	".byte	0					\n\t"	\
> -	".align	2					\n\t"
> +	".popsection					\n\t"	\
> +	".word	9999b					\n\t"
>  
>  #define	TEST_ARG_REG(reg, val)					\
>  	".byte	"__stringify(ARG_TYPE_REG)"		\n\t"	\
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text
  2013-07-26 14:02   ` Dave Martin
@ 2013-07-26 14:08     ` Ben Dooks
  0 siblings, 0 replies; 15+ messages in thread
From: Ben Dooks @ 2013-07-26 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 26/07/13 15:02, Dave Martin wrote:
> On Thu, Jul 25, 2013 at 10:08:57PM +0100, Ben Dooks wrote:
>> When testing the kprobes test code with BE8, there is either an
>> issue with the linker or how the code is being built. The issue
>> is with embedding the title text as the first part of the test.
>>
>> Change to placing a pointer to .rodata with the text title in it
>> for the test which seems to stop the issue of the alignment of
>> the data following it being changed arbitrarily by the linker.
>>
>> The proper thing to do here is to fix the linker, however this
>> patch also makes the output much easier to read as there are no
>> variable length data items here any more.
>
> Can you elaborate?  I don't understand from this what problem you are
> trying to solve.  Can you give a more concrete example?
>
> It should be impossible for the linker to change the alignment of
> anything _within_ an input section (bugs notwithstanding).
>
> The assembler might be doing something unexpected, particularly
> for Thumb kernels, but I don't know of any bug relating to this.

The output in vmlinux looked ok, but there was some weird problems
with some of the structures ending up un-swapped and some swapped.

I do not have a concrete example of this as I didn't have time to
work out exactly what was happening to the binary when it was being
produced.

Placing the strings in the .rodata section seemed to fix the whole
issue which allowed me to turn the kprobes test on without them
blowing up due to mis-reading their list of actions.

> Cheers
> ---Dave
>
>>
>> CC: Jon Medhurst<tixy@yxit.co.uk>
>> Signed-off-by: Ben Dooks<ben.dooks@codethink.co.uk>
>> ---
>>   arch/arm/kernel/kprobes-test.c |   12 +++++-------
>>   arch/arm/kernel/kprobes-test.h |    6 ++++--
>>   2 files changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
>> index 6cfa04d..a915ac3 100644
>> --- a/arch/arm/kernel/kprobes-test.c
>> +++ b/arch/arm/kernel/kprobes-test.c
>> @@ -111,9 +111,7 @@
>>    *	@ TESTCASE_START
>>    *	bl	__kprobes_test_case_start
>>    *	@ start of inline data...
>> - *	.ascii "mov r0, r7"	@ text title for test case
>> - *	.byte	0
>> - *	.align	2
>> + *	.word	title_addr	 @ text title for test case
>>    *
>>    *	@ TEST_ARG_REG
>>    *	.byte	ARG_TYPE_REG
>> @@ -959,7 +957,7 @@ void __naked __kprobes_test_case_start(void)
>>   	__asm__ __volatile__ (
>>   		"stmdb	sp!, {r4-r11}				\n\t"
>>   		"sub	sp, sp, #"__stringify(TEST_MEMORY_SIZE)"\n\t"
>> -		"bic	r0, lr, #1  @ r0 = inline title string	\n\t"
>> +		"bic	r0, lr, #3  @ r0 = inline title block	\n\t"
>>   		"mov	r1, sp					\n\t"
>>   		"bl	kprobes_test_case_start			\n\t"
>>   		"bx	r0					\n\t"
>> @@ -1336,15 +1334,15 @@ static unsigned long next_instruction(unsigned long pc)
>>   	return pc + 4;
>>   }
>>
>> -static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
>> +static uintptr_t __used kprobes_test_case_start(const char **title, void *stack)
>>   {
>>   	struct test_arg *args;
>>   	struct test_arg_end *end_arg;
>>   	unsigned long test_code;
>>
>> -	args = (struct test_arg *)PTR_ALIGN(title + strlen(title) + 1, 4);
>> +	args = (struct test_arg *)(title + 1);
>>
>> -	current_title = title;
>> +	current_title = *title;
>>   	current_args = args;
>>   	current_stack = stack;
>>
>> diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h
>> index e28a869..a71db09 100644
>> --- a/arch/arm/kernel/kprobes-test.h
>> +++ b/arch/arm/kernel/kprobes-test.h
>> @@ -113,9 +113,11 @@ struct test_arg_end {
>>   	"bl	__kprobes_test_case_start		\n\t"	\
>>   	/* don't use .asciz here as 'title' may be */		\
>>   	/* multiple strings to be concatenated.  */		\
>> -	".ascii "#title"				\n\t"	\
>> +	".pushsection .rodata				\n\t"	\
>> +	"9999: .ascii "#title"				\n\t"	\
>>   	".byte	0					\n\t"	\
>> -	".align	2					\n\t"
>> +	".popsection					\n\t"	\
>> +	".word	9999b					\n\t"
>>
>>   #define	TEST_ARG_REG(reg, val)					\
>>   	".byte	"__stringify(ARG_TYPE_REG)"		\n\t"	\
>> --
>> 1.7.10.4
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h>
  2013-07-25 21:08 ` [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h> Ben Dooks
@ 2013-07-29  8:01   ` Jon Medhurst (Tixy)
  2013-07-31 19:43     ` Ben Dooks
  0 siblings, 1 reply; 15+ messages in thread
From: Jon Medhurst (Tixy) @ 2013-07-29  8:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
> If we are running BE8, the data and instruction endian-ness do not
> match, so use <asm/opcodes.h> to correctly translate memory accesses
> into ARM instructions.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>y
> ---
>  arch/arm/kernel/kprobes-common.c |   14 ++++++++------
>  arch/arm/kernel/kprobes.c        |    9 +++++----
>  2 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
> index 18a7628..c0b202e 100644
> --- a/arch/arm/kernel/kprobes-common.c
> +++ b/arch/arm/kernel/kprobes-common.c
> @@ -14,6 +14,7 @@
>  #include <linux/kernel.h>
>  #include <linux/kprobes.h>
>  #include <asm/system_info.h>
> +#include <asm/opcodes.h>
>  
>  #include "kprobes.h"
>  
> @@ -305,7 +306,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
>  
>  	if (handler) {
>  		/* We can emulate the instruction in (possibly) modified form */
> -		asi->insn[0] = (insn & 0xfff00000) | (rn << 16) | reglist;
> +		asi->insn[0] = __opcode_to_mem_arm((insn & 0xfff00000) |
> +						   (rn << 16) | reglist);
>  		asi->insn_handler = handler;
>  		return INSN_GOOD;
>  	}
> @@ -338,9 +340,9 @@ prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
>  		thumb_insn[2] = 0x4770; /* Thumb bx lr */

The line above and the one before it not in this diff also need fixing
by changing to __opcode_to_mem_thumb16(0x4770).

>  		return insn;
>  	}
> -	asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
> +	asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
>  #else
> -	asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
> +	asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
>  #endif
>  	/* Make an ARM instruction unconditional */
>  	if (insn < 0xe0000000)
> @@ -360,12 +362,12 @@ set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
>  	if (thumb) {
>  		u16 *ip = (u16 *)asi->insn;
>  		if (is_wide_instruction(insn))
> -			*ip++ = insn >> 16;
> -		*ip++ = insn;
> +			*ip++ = ___asm_opcode_to_mem_thumb16(insn >> 16);
> +		*ip++ = ___asm_opcode_to_mem_thumb16(insn);


Should these two ___asm_opcode_thumb32_compose() not be
__opcode_thumb32_compose() ?

>  		return;
>  	}
>  #endif
> -	asi->insn[0] = insn;
> +	asi->insn[0] = __opcode_to_mem_arm(insn);
>  }
>  
>  /*
> diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
> index 170e9f3..3775af1 100644
> --- a/arch/arm/kernel/kprobes.c
> +++ b/arch/arm/kernel/kprobes.c
> @@ -26,6 +26,7 @@
>  #include <linux/stop_machine.h>
>  #include <linux/stringify.h>
>  #include <asm/traps.h>
> +#include <asm/opcodes.h>
>  #include <asm/cacheflush.h>
>  
>  #include "kprobes.h"
> @@ -62,10 +63,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>  #ifdef CONFIG_THUMB2_KERNEL
>  	thumb = true;
>  	addr &= ~1; /* Bit 0 would normally be set to indicate Thumb code */
> -	insn = ((u16 *)addr)[0];
> +	insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
>  	if (is_wide_instruction(insn)) {
> -		insn <<= 16;
> -		insn |= ((u16 *)addr)[1];
> +		u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
> +		insn = ___asm_opcode_thumb32_compose(insn, inst2);

Again, __opcode_thumb32_compose instead of
___asm_opcode_thumb32_compose

>  		decode_insn = thumb32_kprobe_decode_insn;
>  	} else
>  		decode_insn = thumb16_kprobe_decode_insn;
> @@ -73,7 +74,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>  	thumb = false;
>  	if (addr & 0x3)
>  		return -EINVAL;
> -	insn = *p->addr;
> +	insn = __mem_to_opcode_arm(*p->addr);
>  	decode_insn = arm_kprobe_decode_insn;
>  #endif
>  

-- 
Tixy

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

* [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h>
  2013-07-25 21:08 ` [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h> Ben Dooks
@ 2013-07-29  8:07   ` Jon Medhurst (Tixy)
  2013-07-31 19:38     ` Ben Dooks
  0 siblings, 1 reply; 15+ messages in thread
From: Jon Medhurst (Tixy) @ 2013-07-29  8:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
> Ensure we read instructions in the correct endian-ness by using
> the <asm/opcodes.h> helper to transform them as necessary.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  arch/arm/kernel/kprobes-test.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
> index 0cd63d0..6cfa04d 100644
> --- a/arch/arm/kernel/kprobes-test.c
> +++ b/arch/arm/kernel/kprobes-test.c
> @@ -1374,13 +1374,13 @@ static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
>  
>  	if (test_case_is_thumb) {
>  		u16 *p = (u16 *)(test_code & ~1);
> -		current_instruction = p[0];
> +		current_instruction = __mem_to_opcode_thumb16(p[0]);
>  		if (is_wide_instruction(current_instruction)) {
> -			current_instruction <<= 16;
> -			current_instruction |= p[1];
> +			u16 instr2 = __mem_to_opcode_thumb16(p[1]);
> +			current_instruction = ___asm_opcode_thumb32_compose(current_instruction, instr2);

Should it not be __opcode_thumb32_compose instead of
___asm_opcode_thumb32_compose ?

>  		}
>  	} else {
> -		current_instruction = *(u32 *)test_code;
> +		current_instruction = __mem_to_opcode_arm(*(u32 *)test_code);
>  	}
>  
>  	if (current_title[0] == '.')
> @@ -1593,7 +1593,6 @@ static int run_test_cases(void (*tests)(void), const union decode_item *table)
>  	return 0;
>  }
>  
> -

A random blank line removal, though by guess it shouldn't have been
there in the first place.

>  static int __init run_all_tests(void)
>  {
>  	int ret = 0;

-- 
Tixy

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

* [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h>
  2013-07-29  8:07   ` Jon Medhurst (Tixy)
@ 2013-07-31 19:38     ` Ben Dooks
  0 siblings, 0 replies; 15+ messages in thread
From: Ben Dooks @ 2013-07-31 19:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 29/07/13 09:07, Jon Medhurst (Tixy) wrote:
> On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
>> Ensure we read instructions in the correct endian-ness by using
>> the<asm/opcodes.h>  helper to transform them as necessary.
>>
>> Signed-off-by: Ben Dooks<ben.dooks@codethink.co.uk>
>> ---
>>   arch/arm/kernel/kprobes-test.c |    9 ++++-----
>>   1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
>> index 0cd63d0..6cfa04d 100644
>> --- a/arch/arm/kernel/kprobes-test.c
>> +++ b/arch/arm/kernel/kprobes-test.c
>> @@ -1374,13 +1374,13 @@ static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
>>
>>   	if (test_case_is_thumb) {
>>   		u16 *p = (u16 *)(test_code&  ~1);
>> -		current_instruction = p[0];
>> +		current_instruction = __mem_to_opcode_thumb16(p[0]);
>>   		if (is_wide_instruction(current_instruction)) {
>> -			current_instruction<<= 16;
>> -			current_instruction |= p[1];
>> +			u16 instr2 = __mem_to_opcode_thumb16(p[1]);
>> +			current_instruction = ___asm_opcode_thumb32_compose(current_instruction, instr2);
>
> Should it not be __opcode_thumb32_compose instead of
> ___asm_opcode_thumb32_compose ?

Ok, will change for the next version.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h>
  2013-07-29  8:01   ` Jon Medhurst (Tixy)
@ 2013-07-31 19:43     ` Ben Dooks
  2013-08-02 13:57       ` Dave Martin
  2013-08-02 14:03       ` Dave Martin
  0 siblings, 2 replies; 15+ messages in thread
From: Ben Dooks @ 2013-07-31 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

On 29/07/13 09:01, Jon Medhurst (Tixy) wrote:
> On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
>> If we are running BE8, the data and instruction endian-ness do not
>> match, so use<asm/opcodes.h>  to correctly translate memory accesses
>> into ARM instructions.
>>
>> Signed-off-by: Ben Dooks<ben.dooks@codethink.co.uk>y
>> ---
>>   arch/arm/kernel/kprobes-common.c |   14 ++++++++------
>>   arch/arm/kernel/kprobes.c        |    9 +++++----
>>   2 files changed, 13 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
>> index 18a7628..c0b202e 100644
>> --- a/arch/arm/kernel/kprobes-common.c
>> +++ b/arch/arm/kernel/kprobes-common.c
>> @@ -14,6 +14,7 @@
>>   #include<linux/kernel.h>
>>   #include<linux/kprobes.h>
>>   #include<asm/system_info.h>
>> +#include<asm/opcodes.h>
>>
>>   #include "kprobes.h"
>>
>> @@ -305,7 +306,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
>>
>>   	if (handler) {
>>   		/* We can emulate the instruction in (possibly) modified form */
>> -		asi->insn[0] = (insn&  0xfff00000) | (rn<<  16) | reglist;
>> +		asi->insn[0] = __opcode_to_mem_arm((insn&  0xfff00000) |
>> +						   (rn<<  16) | reglist);
>>   		asi->insn_handler = handler;
>>   		return INSN_GOOD;
>>   	}
>> @@ -338,9 +340,9 @@ prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
>>   		thumb_insn[2] = 0x4770; /* Thumb bx lr */
>
> The line above and the one before it not in this diff also need fixing
> by changing to __opcode_to_mem_thumb16(0x4770).

IIRC, these are then fixed by the set_emulated instruction, which is
also why the insn return is not swapped.

>>   		return insn;
>>   	}
>> -	asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
>> +	asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
>>   #else
>> -	asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
>> +	asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
>>   #endif
>>   	/* Make an ARM instruction unconditional */
>>   	if (insn<  0xe0000000)
>> @@ -360,12 +362,12 @@ set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
>>   	if (thumb) {
>>   		u16 *ip = (u16 *)asi->insn;
>>   		if (is_wide_instruction(insn))
>> -			*ip++ = insn>>  16;
>> -		*ip++ = insn;
>> +			*ip++ = ___asm_opcode_to_mem_thumb16(insn>>  16);
>> +		*ip++ = ___asm_opcode_to_mem_thumb16(insn);
>
>
> Should these two ___asm_opcode_thumb32_compose() not be
> __opcode_thumb32_compose() ?

I decided to leave this as is.

>>   		return;
>>   	}
>>   #endif
>> -	asi->insn[0] = insn;
>> +	asi->insn[0] = __opcode_to_mem_arm(insn);
>>   }
>>
>>   /*
>> diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
>> index 170e9f3..3775af1 100644
>> --- a/arch/arm/kernel/kprobes.c
>> +++ b/arch/arm/kernel/kprobes.c
>> @@ -26,6 +26,7 @@
>>   #include<linux/stop_machine.h>
>>   #include<linux/stringify.h>
>>   #include<asm/traps.h>
>> +#include<asm/opcodes.h>
>>   #include<asm/cacheflush.h>
>>
>>   #include "kprobes.h"
>> @@ -62,10 +63,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>>   #ifdef CONFIG_THUMB2_KERNEL
>>   	thumb = true;
>>   	addr&= ~1; /* Bit 0 would normally be set to indicate Thumb code */
>> -	insn = ((u16 *)addr)[0];
>> +	insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
>>   	if (is_wide_instruction(insn)) {
>> -		insn<<= 16;
>> -		insn |= ((u16 *)addr)[1];
>> +		u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
>> +		insn = ___asm_opcode_thumb32_compose(insn, inst2);
>
> Again, __opcode_thumb32_compose instead of
> ___asm_opcode_thumb32_compose
>
>>   		decode_insn = thumb32_kprobe_decode_insn;
>>   	} else
>>   		decode_insn = thumb16_kprobe_decode_insn;
>> @@ -73,7 +74,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>>   	thumb = false;
>>   	if (addr&  0x3)
>>   		return -EINVAL;
>> -	insn = *p->addr;
>> +	insn = __mem_to_opcode_arm(*p->addr);
>>   	decode_insn = arm_kprobe_decode_insn;
>>   #endif
>>
>


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h>
  2013-07-31 19:43     ` Ben Dooks
@ 2013-08-02 13:57       ` Dave Martin
  2013-08-02 13:58         ` Ben Dooks
  2013-08-02 14:03       ` Dave Martin
  1 sibling, 1 reply; 15+ messages in thread
From: Dave Martin @ 2013-08-02 13:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 31, 2013 at 08:43:07PM +0100, Ben Dooks wrote:
> On 29/07/13 09:01, Jon Medhurst (Tixy) wrote:
> >On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
> >>If we are running BE8, the data and instruction endian-ness do not
> >>match, so use<asm/opcodes.h>  to correctly translate memory accesses
> >>into ARM instructions.
> >>
> >>Signed-off-by: Ben Dooks<ben.dooks@codethink.co.uk>y
> >>---
> >>  arch/arm/kernel/kprobes-common.c |   14 ++++++++------
> >>  arch/arm/kernel/kprobes.c        |    9 +++++----
> >>  2 files changed, 13 insertions(+), 10 deletions(-)
> >>
> >>diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
> >>index 18a7628..c0b202e 100644
> >>--- a/arch/arm/kernel/kprobes-common.c
> >>+++ b/arch/arm/kernel/kprobes-common.c
> >>@@ -14,6 +14,7 @@
> >>  #include<linux/kernel.h>
> >>  #include<linux/kprobes.h>
> >>  #include<asm/system_info.h>
> >>+#include<asm/opcodes.h>
> >>
> >>  #include "kprobes.h"
> >>
> >>@@ -305,7 +306,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
> >>
> >>  	if (handler) {
> >>  		/* We can emulate the instruction in (possibly) modified form */
> >>-		asi->insn[0] = (insn&  0xfff00000) | (rn<<  16) | reglist;
> >>+		asi->insn[0] = __opcode_to_mem_arm((insn&  0xfff00000) |
> >>+						   (rn<<  16) | reglist);
> >>  		asi->insn_handler = handler;
> >>  		return INSN_GOOD;
> >>  	}
> >>@@ -338,9 +340,9 @@ prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
> >>  		thumb_insn[2] = 0x4770; /* Thumb bx lr */
> >
> >The line above and the one before it not in this diff also need fixing
> >by changing to __opcode_to_mem_thumb16(0x4770).
> 
> IIRC, these are then fixed by the set_emulated instruction, which is
> also why the insn return is not swapped.
> 
> >>  		return insn;
> >>  	}
> >>-	asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
> >>+	asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
> >>  #else
> >>-	asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
> >>+	asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
> >>  #endif
> >>  	/* Make an ARM instruction unconditional */
> >>  	if (insn<  0xe0000000)
> >>@@ -360,12 +362,12 @@ set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
> >>  	if (thumb) {
> >>  		u16 *ip = (u16 *)asi->insn;
> >>  		if (is_wide_instruction(insn))
> >>-			*ip++ = insn>>  16;
> >>-		*ip++ = insn;
> >>+			*ip++ = ___asm_opcode_to_mem_thumb16(insn>>  16);
> >>+		*ip++ = ___asm_opcode_to_mem_thumb16(insn);
> >
> >
> >Should these two ___asm_opcode_thumb32_compose() not be
> >__opcode_thumb32_compose() ?
> 
> I decided to leave this as is.

Although the intent is not made as clear in the header as it could be,
the ___asm() functions are not supposed to be used directly:
__opcode_thumb32_compose() will map to the correct thing based on
whether we are preprocessing assembler or C.

In particular, ___asm_opcode_thumb32_compose() will give you inefficient
swabbing if used directly in C.

> >>  		return;
> >>  	}
> >>  #endif
> >>-	asi->insn[0] = insn;
> >>+	asi->insn[0] = __opcode_to_mem_arm(insn);
> >>  }
> >>
> >>  /*
> >>diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
> >>index 170e9f3..3775af1 100644
> >>--- a/arch/arm/kernel/kprobes.c
> >>+++ b/arch/arm/kernel/kprobes.c
> >>@@ -26,6 +26,7 @@
> >>  #include<linux/stop_machine.h>
> >>  #include<linux/stringify.h>
> >>  #include<asm/traps.h>
> >>+#include<asm/opcodes.h>
> >>  #include<asm/cacheflush.h>
> >>
> >>  #include "kprobes.h"
> >>@@ -62,10 +63,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> >>  #ifdef CONFIG_THUMB2_KERNEL
> >>  	thumb = true;
> >>  	addr&= ~1; /* Bit 0 would normally be set to indicate Thumb code */
> >>-	insn = ((u16 *)addr)[0];
> >>+	insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
> >>  	if (is_wide_instruction(insn)) {
> >>-		insn<<= 16;
> >>-		insn |= ((u16 *)addr)[1];
> >>+		u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
> >>+		insn = ___asm_opcode_thumb32_compose(insn, inst2);
> >
> >Again, __opcode_thumb32_compose instead of
> >___asm_opcode_thumb32_compose

ditto, this should be changed.

Cheers
---Dave

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

* [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h>
  2013-08-02 13:57       ` Dave Martin
@ 2013-08-02 13:58         ` Ben Dooks
  0 siblings, 0 replies; 15+ messages in thread
From: Ben Dooks @ 2013-08-02 13:58 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/08/13 14:57, Dave Martin wrote:
> On Wed, Jul 31, 2013 at 08:43:07PM +0100, Ben Dooks wrote:
>> On 29/07/13 09:01, Jon Medhurst (Tixy) wrote:
>>> On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
>>>> If we are running BE8, the data and instruction endian-ness do not
>>>> match, so use<asm/opcodes.h>   to correctly translate memory accesses
>>>> into ARM instructions.
>>>>
>>>> Signed-off-by: Ben Dooks<ben.dooks@codethink.co.uk>y
>>>> ---
>>>>   arch/arm/kernel/kprobes-common.c |   14 ++++++++------
>>>>   arch/arm/kernel/kprobes.c        |    9 +++++----
>>>>   2 files changed, 13 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
>>>> index 18a7628..c0b202e 100644
>>>> --- a/arch/arm/kernel/kprobes-common.c
>>>> +++ b/arch/arm/kernel/kprobes-common.c
>>>> @@ -14,6 +14,7 @@
>>>>   #include<linux/kernel.h>
>>>>   #include<linux/kprobes.h>
>>>>   #include<asm/system_info.h>
>>>> +#include<asm/opcodes.h>
>>>>
>>>>   #include "kprobes.h"
>>>>
>>>> @@ -305,7 +306,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
>>>>
>>>>   	if (handler) {
>>>>   		/* We can emulate the instruction in (possibly) modified form */
>>>> -		asi->insn[0] = (insn&   0xfff00000) | (rn<<   16) | reglist;
>>>> +		asi->insn[0] = __opcode_to_mem_arm((insn&   0xfff00000) |
>>>> +						   (rn<<   16) | reglist);
>>>>   		asi->insn_handler = handler;
>>>>   		return INSN_GOOD;
>>>>   	}
>>>> @@ -338,9 +340,9 @@ prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
>>>>   		thumb_insn[2] = 0x4770; /* Thumb bx lr */
>>>
>>> The line above and the one before it not in this diff also need fixing
>>> by changing to __opcode_to_mem_thumb16(0x4770).
>>
>> IIRC, these are then fixed by the set_emulated instruction, which is
>> also why the insn return is not swapped.
>>
>>>>   		return insn;
>>>>   	}
>>>> -	asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
>>>> +	asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
>>>>   #else
>>>> -	asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
>>>> +	asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
>>>>   #endif
>>>>   	/* Make an ARM instruction unconditional */
>>>>   	if (insn<   0xe0000000)
>>>> @@ -360,12 +362,12 @@ set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
>>>>   	if (thumb) {
>>>>   		u16 *ip = (u16 *)asi->insn;
>>>>   		if (is_wide_instruction(insn))
>>>> -			*ip++ = insn>>   16;
>>>> -		*ip++ = insn;
>>>> +			*ip++ = ___asm_opcode_to_mem_thumb16(insn>>   16);
>>>> +		*ip++ = ___asm_opcode_to_mem_thumb16(insn);
>>>
>>>
>>> Should these two ___asm_opcode_thumb32_compose() not be
>>> __opcode_thumb32_compose() ?
>>
>> I decided to leave this as is.
>
> Although the intent is not made as clear in the header as it could be,
> the ___asm() functions are not supposed to be used directly:
> __opcode_thumb32_compose() will map to the correct thing based on
> whether we are preprocessing assembler or C.
>
> In particular, ___asm_opcode_thumb32_compose() will give you inefficient
> swabbing if used directly in C.
>
>>>>   		return;
>>>>   	}
>>>>   #endif
>>>> -	asi->insn[0] = insn;
>>>> +	asi->insn[0] = __opcode_to_mem_arm(insn);
>>>>   }
>>>>
>>>>   /*
>>>> diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
>>>> index 170e9f3..3775af1 100644
>>>> --- a/arch/arm/kernel/kprobes.c
>>>> +++ b/arch/arm/kernel/kprobes.c
>>>> @@ -26,6 +26,7 @@
>>>>   #include<linux/stop_machine.h>
>>>>   #include<linux/stringify.h>
>>>>   #include<asm/traps.h>
>>>> +#include<asm/opcodes.h>
>>>>   #include<asm/cacheflush.h>
>>>>
>>>>   #include "kprobes.h"
>>>> @@ -62,10 +63,10 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>>>>   #ifdef CONFIG_THUMB2_KERNEL
>>>>   	thumb = true;
>>>>   	addr&= ~1; /* Bit 0 would normally be set to indicate Thumb code */
>>>> -	insn = ((u16 *)addr)[0];
>>>> +	insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
>>>>   	if (is_wide_instruction(insn)) {
>>>> -		insn<<= 16;
>>>> -		insn |= ((u16 *)addr)[1];
>>>> +		u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
>>>> +		insn = ___asm_opcode_thumb32_compose(insn, inst2);
>>>
>>> Again, __opcode_thumb32_compose instead of
>>> ___asm_opcode_thumb32_compose
>
> ditto, this should be changed.
>
> Cheers
> ---Dave

Yes, already fixed thanks.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h>
  2013-07-31 19:43     ` Ben Dooks
  2013-08-02 13:57       ` Dave Martin
@ 2013-08-02 14:03       ` Dave Martin
  1 sibling, 0 replies; 15+ messages in thread
From: Dave Martin @ 2013-08-02 14:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 31, 2013 at 08:43:07PM +0100, Ben Dooks wrote:
> On 29/07/13 09:01, Jon Medhurst (Tixy) wrote:
> >On Thu, 2013-07-25 at 22:08 +0100, Ben Dooks wrote:
> >>If we are running BE8, the data and instruction endian-ness do not
> >>match, so use<asm/opcodes.h>  to correctly translate memory accesses
> >>into ARM instructions.
> >>
> >>Signed-off-by: Ben Dooks<ben.dooks@codethink.co.uk>y
> >>---
> >>  arch/arm/kernel/kprobes-common.c |   14 ++++++++------
> >>  arch/arm/kernel/kprobes.c        |    9 +++++----
> >>  2 files changed, 13 insertions(+), 10 deletions(-)
> >>
> >>diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
> >>index 18a7628..c0b202e 100644
> >>--- a/arch/arm/kernel/kprobes-common.c
> >>+++ b/arch/arm/kernel/kprobes-common.c
> >>@@ -14,6 +14,7 @@
> >>  #include<linux/kernel.h>
> >>  #include<linux/kprobes.h>
> >>  #include<asm/system_info.h>
> >>+#include<asm/opcodes.h>
> >>
> >>  #include "kprobes.h"
> >>
> >>@@ -305,7 +306,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
> >>
> >>  	if (handler) {
> >>  		/* We can emulate the instruction in (possibly) modified form */
> >>-		asi->insn[0] = (insn&  0xfff00000) | (rn<<  16) | reglist;
> >>+		asi->insn[0] = __opcode_to_mem_arm((insn&  0xfff00000) |
> >>+						   (rn<<  16) | reglist);
> >>  		asi->insn_handler = handler;
> >>  		return INSN_GOOD;
> >>  	}
> >>@@ -338,9 +340,9 @@ prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
> >>  		thumb_insn[2] = 0x4770; /* Thumb bx lr */
> >
> >The line above and the one before it not in this diff also need fixing
> >by changing to __opcode_to_mem_thumb16(0x4770).
> 
> IIRC, these are then fixed by the set_emulated instruction, which is
> also why the insn return is not swapped.

Ah, I see.

I think it would be better to have consistent behaviour between the ARM
and Thumb cases here: in its current form, this patch makes
set_emulated_insn() responsible for the swabbing in the Thumb case and
not in the ARM case.

Doing it in the same place for both cases would be preferable ... or was
there a reason why this doesn't work?

Cheers
---Dave

> >>  		return insn;
> >>  	}
> >>-	asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
> >>+	asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
> >>  #else
> >>-	asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
> >>+	asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
> >>  #endif
> >>  	/* Make an ARM instruction unconditional */
> >>  	if (insn<  0xe0000000)
> >>@@ -360,12 +362,12 @@ set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
> >>  	if (thumb) {
> >>  		u16 *ip = (u16 *)asi->insn;
> >>  		if (is_wide_instruction(insn))
> >>-			*ip++ = insn>>  16;
> >>-		*ip++ = insn;
> >>+			*ip++ = ___asm_opcode_to_mem_thumb16(insn>>  16);
> >>+		*ip++ = ___asm_opcode_to_mem_thumb16(insn);
> >

[...]

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

end of thread, other threads:[~2013-08-02 14:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-25 21:08 fyi - kprobes testing patches Ben Dooks
2013-07-25 21:08 ` [PATCH 1/4] ARM: kprobes: fix instruction fetch order with <asm/opcodes.h> Ben Dooks
2013-07-29  8:01   ` Jon Medhurst (Tixy)
2013-07-31 19:43     ` Ben Dooks
2013-08-02 13:57       ` Dave Martin
2013-08-02 13:58         ` Ben Dooks
2013-08-02 14:03       ` Dave Martin
2013-07-25 21:08 ` [PATCH 2/4] ARM: kprobes, change arm test to .instr Ben Dooks
2013-07-25 21:08 ` [PATCH 3/4] ARM: kprobes-test: use <asm/opcodes.h> Ben Dooks
2013-07-29  8:07   ` Jon Medhurst (Tixy)
2013-07-31 19:38     ` Ben Dooks
2013-07-25 21:08 ` [PATCH 4/4] ARM: kprobes-test: move to using a pointer to the title text Ben Dooks
2013-07-26 14:02   ` Dave Martin
2013-07-26 14:08     ` Ben Dooks
2013-07-26 10:52 ` fyi - kprobes testing patches Ben Dooks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.