ARM: 6412/1: kprobes-decode: add support for MOVW instruction

The MOVW instruction moves a 16-bit immediate into the bottom halfword
of the destination register.

This patch ensures that kprobes leaves the 16-bit immediate intact, rather
than assume a 12-bit immediate and mask out the upper 4 bits.

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Will Deacon and committed by Russell King ccdf2e1b 7f58217b

+4 -3
+4 -3
arch/arm/kernel/kprobes-decode.c
··· 1162 1162 { 1163 1163 /* 1164 1164 * MSR : cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx 1165 - * Undef : cccc 0011 0x00 xxxx xxxx xxxx xxxx xxxx 1165 + * Undef : cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx 1166 1166 * ALU op with S bit and Rd == 15 : 1167 1167 * cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx 1168 1168 */ 1169 - if ((insn & 0x0f900000) == 0x03200000 || /* MSR & Undef */ 1169 + if ((insn & 0x0fb00000) == 0x03200000 || /* MSR */ 1170 + (insn & 0x0ff00000) == 0x03400000 || /* Undef */ 1170 1171 (insn & 0x0e10f000) == 0x0210f000) /* ALU s-bit, R15 */ 1171 1172 return INSN_REJECTED; 1172 1173 ··· 1178 1177 * *S (bit 20) updates condition codes 1179 1178 * ADC/SBC/RSC reads the C flag 1180 1179 */ 1181 - insn &= 0xfff00fff; /* Rn = r0, Rd = r0 */ 1180 + insn &= 0xffff0fff; /* Rd = r0 */ 1182 1181 asi->insn[0] = insn; 1183 1182 asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */ 1184 1183 emulate_alu_imm_rwflags : emulate_alu_imm_rflags;