aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Medhurst <tixy@yxit.co.uk>2011-06-08 13:09:36 -0400
committerTixy <tixy@medhuaa1.miniserver.com>2011-07-13 13:32:49 -0400
commitad2e81a78d016176b9f194414495a4ce166399e1 (patch)
treef37252b50c502da6e985899bf0c9a7b181520d71
parent2ce5d03307222b3d5b7c5e9849eb4857eb979fa9 (diff)
ARM: kprobes: Migrate ARM space_cccc_0111__1 to decoding tables
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-rw-r--r--arch/arm/kernel/kprobes-arm.c82
1 files changed, 36 insertions, 46 deletions
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c
index 62035057846a..58faacc598bf 100644
--- a/arch/arm/kernel/kprobes-arm.c
+++ b/arch/arm/kernel/kprobes-arm.c
@@ -1373,57 +1373,47 @@ static const union decode_item arm_cccc_0110_____xxx1_table[] = {
1373 DECODE_END 1373 DECODE_END
1374}; 1374};
1375 1375
1376static enum kprobe_insn __kprobes 1376static const union decode_item arm_cccc_0111_____xxx1_table[] = {
1377space_cccc_0111__1(kprobe_opcode_t insn, struct arch_specific_insn *asi) 1377 /* Media instructions */
1378{
1379 /* Undef : cccc 0111 1111 xxxx xxxx xxxx 1111 xxxx */
1380 if ((insn & 0x0ff000f0) == 0x03f000f0)
1381 return INSN_REJECTED;
1382 1378
1383 /* SMLALD : cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */ 1379 /* UNDEFINED cccc 0111 1111 xxxx xxxx xxxx 1111 xxxx */
1384 /* SMLSLD : cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */ 1380 DECODE_REJECT (0x0ff000f0, 0x07f000f0),
1385 if ((insn & 0x0ff00090) == 0x07400010)
1386 return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn, asi);
1387
1388 /* SMLAD : cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx :Q */
1389 /* SMUAD : cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx :Q */
1390 /* SMLSD : cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx :Q */
1391 /* SMUSD : cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx : */
1392 /* SMMLA : cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx : */
1393 /* SMMUL : cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx : */
1394 /* USADA8 : cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx : */
1395 /* USAD8 : cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx : */
1396 if ((insn & 0x0ff00090) == 0x07000010 ||
1397 (insn & 0x0ff000d0) == 0x07500010 ||
1398 (insn & 0x0ff000f0) == 0x07800010) {
1399
1400 if ((insn & 0x0000f000) == 0x0000f000)
1401 return prep_emulate_rd16rs8rm0_wflags(insn, asi);
1402 else
1403 return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1404 }
1405 1381
1406 /* SMMLS : cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx : */ 1382 /* SMLALD cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */
1407 if ((insn & 0x0ff000d0) == 0x075000d0) 1383 /* SMLSLD cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */
1408 return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi); 1384 DECODE_CUSTOM (0x0ff00090, 0x07400010, prep_emulate_rdhi16rdlo12rs8rm0_wflags),
1409 1385
1410 /* SBFX : cccc 0111 101x xxxx xxxx xxxx x101 xxxx : */ 1386 /* SMUAD cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx */
1411 /* UBFX : cccc 0111 111x xxxx xxxx xxxx x101 xxxx : */ 1387 /* SMUSD cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx */
1412 if ((insn & 0x0fa00070) == 0x07a00050) 1388 DECODE_OR (0x0ff0f090, 0x0700f010),
1413 return prep_emulate_rd12rm0(insn, asi); 1389 /* SMMUL cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx */
1390 DECODE_OR (0x0ff0f0d0, 0x0750f010),
1391 /* USAD8 cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx */
1392 DECODE_CUSTOM (0x0ff0f0f0, 0x0780f010, prep_emulate_rd16rs8rm0_wflags),
1414 1393
1415 /* BFI : cccc 0111 110x xxxx xxxx xxxx x001 xxxx : */ 1394 /* SMLAD cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx */
1416 /* BFC : cccc 0111 110x xxxx xxxx xxxx x001 1111 : */ 1395 /* SMLSD cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx */
1417 if ((insn & 0x0fe00070) == 0x07c00010) { 1396 DECODE_OR (0x0ff00090, 0x07000010),
1397 /* SMMLA cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx */
1398 DECODE_OR (0x0ff000d0, 0x07500010),
1399 /* USADA8 cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx */
1400 DECODE_CUSTOM (0x0ff000f0, 0x07800010, prep_emulate_rd16rn12rs8rm0_wflags),
1418 1401
1419 if ((insn & 0x0000000f) == 0x0000000f) 1402 /* SMMLS cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx */
1420 return prep_emulate_rd12_modify(insn, asi); 1403 DECODE_CUSTOM (0x0ff000d0, 0x075000d0, prep_emulate_rd16rn12rs8rm0_wflags),
1421 else
1422 return prep_emulate_rd12rn0_modify(insn, asi);
1423 }
1424 1404
1425 return INSN_REJECTED; 1405 /* SBFX cccc 0111 101x xxxx xxxx xxxx x101 xxxx */
1426} 1406 /* UBFX cccc 0111 111x xxxx xxxx xxxx x101 xxxx */
1407 DECODE_CUSTOM (0x0fa00070, 0x07a00050, prep_emulate_rd12rm0),
1408
1409 /* BFC cccc 0111 110x xxxx xxxx xxxx x001 1111 */
1410 DECODE_CUSTOM (0x0fe0007f, 0x07c0001f, prep_emulate_rd12_modify),
1411
1412 /* BFI cccc 0111 110x xxxx xxxx xxxx x001 xxxx */
1413 DECODE_CUSTOM (0x0fe00070, 0x07c00010, prep_emulate_rd12rn0_modify),
1414
1415 DECODE_END
1416};
1427 1417
1428static enum kprobe_insn __kprobes 1418static enum kprobe_insn __kprobes
1429space_cccc_01xx(kprobe_opcode_t insn, struct arch_specific_insn *asi) 1419space_cccc_01xx(kprobe_opcode_t insn, struct arch_specific_insn *asi)
@@ -1532,7 +1522,7 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1532 1522
1533 else if ((insn & 0x0f000010) == 0x07000010) 1523 else if ((insn & 0x0f000010) == 0x07000010)
1534 1524
1535 return space_cccc_0111__1(insn, asi); 1525 return kprobe_decode_insn(insn, asi, arm_cccc_0111_____xxx1_table, false);
1536 1526
1537 else if ((insn & 0x0c000000) == 0x04000000) 1527 else if ((insn & 0x0c000000) == 0x04000000)
1538 1528