ARM: probes: Use correct action types for MOVW, SEV and WFI
authorJon Medhurst <tixy@linaro.org>
Wed, 7 Jan 2015 11:42:30 +0000 (11:42 +0000)
committerJon Medhurst <tixy@linaro.org>
Fri, 9 Jan 2015 09:36:51 +0000 (09:36 +0000)
This doesn't correct any bugs when probing these instructions but makes
MOVW slightly faster and makes everything more symmetric with the Thumb
instruction cases.

We can also remove the now redundant PROBES_EMULATE_NONE and
PROBES_SIMULATE_NOP actions.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
arch/arm/probes/decode-arm.c
arch/arm/probes/decode-arm.h
arch/arm/probes/kprobes/actions-arm.c
arch/arm/probes/uprobes/actions-arm.c

index e39cc75952f2797ee3e604a03c84035c821887a0..04114f74a2d2e1fbb46be954dc823511be5e40de 100644 (file)
@@ -370,17 +370,17 @@ static const union decode_item arm_cccc_001x_table[] = {
 
        /* MOVW                 cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
        /* MOVT                 cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
-       DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_DATA_PROCESSING_IMM,
+       DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_MOV_HALFWORD,
                                                 REGS(0, NOPC, 0, 0, 0)),
 
        /* YIELD                cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
        DECODE_OR       (0x0fff00ff, 0x03200001),
        /* SEV                  cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
-       DECODE_EMULATE  (0x0fff00ff, 0x03200004, PROBES_EMULATE_NONE),
+       DECODE_EMULATE  (0x0fff00ff, 0x03200004, PROBES_SEV),
        /* NOP                  cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
        /* WFE                  cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
        /* WFI                  cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
-       DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_SIMULATE_NOP),
+       DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_WFE),
        /* DBG                  cccc 0011 0010 0000 xxxx xxxx ffff xxxx */
        /* unallocated hints    cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
        /* MSR (immediate)      cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */
index 9c56b40d6a5713e40725bc5fc7983a292f6f58fb..cb0b263319300909875e4e53f46d36a37f6daa35 100644 (file)
@@ -18,8 +18,6 @@
 #include "decode.h"
 
 enum probes_arm_action {
-       PROBES_EMULATE_NONE,
-       PROBES_SIMULATE_NOP,
        PROBES_PRELOAD_IMM,
        PROBES_PRELOAD_REG,
        PROBES_BRANCH_IMM,
index 8797879f7b3ab6b3dc1d9ba9f1182cb906907f81..2206f2d80c76010ece0a666a2a8c34aa26221915 100644 (file)
@@ -302,8 +302,6 @@ emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(probes_opcode_t insn,
 }
 
 const union decode_action kprobes_arm_actions[NUM_PROBES_ARM_ACTIONS] = {
-       [PROBES_EMULATE_NONE] = {.handler = probes_emulate_none},
-       [PROBES_SIMULATE_NOP] = {.handler = probes_simulate_nop},
        [PROBES_PRELOAD_IMM] = {.handler = probes_simulate_nop},
        [PROBES_PRELOAD_REG] = {.handler = probes_simulate_nop},
        [PROBES_BRANCH_IMM] = {.handler = simulate_blx1},
index 1dd4916ba8aaa976b88554ea34b608dd2d3acc29..76eb44972ebeafe412e2ed7a9f38747c1508d2f0 100644 (file)
@@ -195,8 +195,6 @@ uprobe_decode_ldmstm(probes_opcode_t insn,
 }
 
 const union decode_action uprobes_probes_actions[] = {
-       [PROBES_EMULATE_NONE] = {.handler = probes_simulate_nop},
-       [PROBES_SIMULATE_NOP] = {.handler = probes_simulate_nop},
        [PROBES_PRELOAD_IMM] = {.handler = probes_simulate_nop},
        [PROBES_PRELOAD_REG] = {.handler = probes_simulate_nop},
        [PROBES_BRANCH_IMM] = {.handler = simulate_blx1},