18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * arch/arm/probes/decode-arm.c
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Some code moved here from arch/arm/kernel/kprobes-arm.c
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 2006, 2007 Motorola Inc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/kernel.h>
128c2ecf20Sopenharmony_ci#include <linux/module.h>
138c2ecf20Sopenharmony_ci#include <linux/stddef.h>
148c2ecf20Sopenharmony_ci#include <linux/ptrace.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include "decode.h"
178c2ecf20Sopenharmony_ci#include "decode-arm.h"
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci/*
248c2ecf20Sopenharmony_ci * To avoid the complications of mimicing single-stepping on a
258c2ecf20Sopenharmony_ci * processor without a Next-PC or a single-step mode, and to
268c2ecf20Sopenharmony_ci * avoid having to deal with the side-effects of boosting, we
278c2ecf20Sopenharmony_ci * simulate or emulate (almost) all ARM instructions.
288c2ecf20Sopenharmony_ci *
298c2ecf20Sopenharmony_ci * "Simulation" is where the instruction's behavior is duplicated in
308c2ecf20Sopenharmony_ci * C code.  "Emulation" is where the original instruction is rewritten
318c2ecf20Sopenharmony_ci * and executed, often by altering its registers.
328c2ecf20Sopenharmony_ci *
338c2ecf20Sopenharmony_ci * By having all behavior of the kprobe'd instruction completed before
348c2ecf20Sopenharmony_ci * returning from the kprobe_handler(), all locks (scheduler and
358c2ecf20Sopenharmony_ci * interrupt) can safely be released.  There is no need for secondary
368c2ecf20Sopenharmony_ci * breakpoints, no race with MP or preemptable kernels, nor having to
378c2ecf20Sopenharmony_ci * clean up resources counts at a later time impacting overall system
388c2ecf20Sopenharmony_ci * performance.  By rewriting the instruction, only the minimum registers
398c2ecf20Sopenharmony_ci * need to be loaded and saved back optimizing performance.
408c2ecf20Sopenharmony_ci *
418c2ecf20Sopenharmony_ci * Calling the insnslot_*_rwflags version of a function doesn't hurt
428c2ecf20Sopenharmony_ci * anything even when the CPSR flags aren't updated by the
438c2ecf20Sopenharmony_ci * instruction.  It's just a little slower in return for saving
448c2ecf20Sopenharmony_ci * a little space by not having a duplicate function that doesn't
458c2ecf20Sopenharmony_ci * update the flags.  (The same optimization can be said for
468c2ecf20Sopenharmony_ci * instructions that do or don't perform register writeback)
478c2ecf20Sopenharmony_ci * Also, instructions can either read the flags, only write the
488c2ecf20Sopenharmony_ci * flags, or read and write the flags.  To save combinations
498c2ecf20Sopenharmony_ci * rather than for sheer performance, flag functions just assume
508c2ecf20Sopenharmony_ci * read and write of flags.
518c2ecf20Sopenharmony_ci */
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_civoid __kprobes simulate_bbl(probes_opcode_t insn,
548c2ecf20Sopenharmony_ci		struct arch_probes_insn *asi, struct pt_regs *regs)
558c2ecf20Sopenharmony_ci{
568c2ecf20Sopenharmony_ci	long iaddr = (long) regs->ARM_pc - 4;
578c2ecf20Sopenharmony_ci	int disp  = branch_displacement(insn);
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci	if (insn & (1 << 24))
608c2ecf20Sopenharmony_ci		regs->ARM_lr = iaddr + 4;
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci	regs->ARM_pc = iaddr + 8 + disp;
638c2ecf20Sopenharmony_ci}
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_civoid __kprobes simulate_blx1(probes_opcode_t insn,
668c2ecf20Sopenharmony_ci		struct arch_probes_insn *asi, struct pt_regs *regs)
678c2ecf20Sopenharmony_ci{
688c2ecf20Sopenharmony_ci	long iaddr = (long) regs->ARM_pc - 4;
698c2ecf20Sopenharmony_ci	int disp = branch_displacement(insn);
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci	regs->ARM_lr = iaddr + 4;
728c2ecf20Sopenharmony_ci	regs->ARM_pc = iaddr + 8 + disp + ((insn >> 23) & 0x2);
738c2ecf20Sopenharmony_ci	regs->ARM_cpsr |= PSR_T_BIT;
748c2ecf20Sopenharmony_ci}
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_civoid __kprobes simulate_blx2bx(probes_opcode_t insn,
778c2ecf20Sopenharmony_ci		struct arch_probes_insn *asi, struct pt_regs *regs)
788c2ecf20Sopenharmony_ci{
798c2ecf20Sopenharmony_ci	int rm = insn & 0xf;
808c2ecf20Sopenharmony_ci	long rmv = regs->uregs[rm];
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci	if (insn & (1 << 5))
838c2ecf20Sopenharmony_ci		regs->ARM_lr = (long) regs->ARM_pc;
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci	regs->ARM_pc = rmv & ~0x1;
868c2ecf20Sopenharmony_ci	regs->ARM_cpsr &= ~PSR_T_BIT;
878c2ecf20Sopenharmony_ci	if (rmv & 0x1)
888c2ecf20Sopenharmony_ci		regs->ARM_cpsr |= PSR_T_BIT;
898c2ecf20Sopenharmony_ci}
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_civoid __kprobes simulate_mrs(probes_opcode_t insn,
928c2ecf20Sopenharmony_ci		struct arch_probes_insn *asi, struct pt_regs *regs)
938c2ecf20Sopenharmony_ci{
948c2ecf20Sopenharmony_ci	int rd = (insn >> 12) & 0xf;
958c2ecf20Sopenharmony_ci	unsigned long mask = 0xf8ff03df; /* Mask out execution state */
968c2ecf20Sopenharmony_ci	regs->uregs[rd] = regs->ARM_cpsr & mask;
978c2ecf20Sopenharmony_ci}
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_civoid __kprobes simulate_mov_ipsp(probes_opcode_t insn,
1008c2ecf20Sopenharmony_ci		struct arch_probes_insn *asi, struct pt_regs *regs)
1018c2ecf20Sopenharmony_ci{
1028c2ecf20Sopenharmony_ci	regs->uregs[12] = regs->uregs[13];
1038c2ecf20Sopenharmony_ci}
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci/*
1068c2ecf20Sopenharmony_ci * For the instruction masking and comparisons in all the "space_*"
1078c2ecf20Sopenharmony_ci * functions below, Do _not_ rearrange the order of tests unless
1088c2ecf20Sopenharmony_ci * you're very, very sure of what you are doing.  For the sake of
1098c2ecf20Sopenharmony_ci * efficiency, the masks for some tests sometimes assume other test
1108c2ecf20Sopenharmony_ci * have been done prior to them so the number of patterns to test
1118c2ecf20Sopenharmony_ci * for an instruction set can be as broad as possible to reduce the
1128c2ecf20Sopenharmony_ci * number of tests needed.
1138c2ecf20Sopenharmony_ci */
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_cistatic const union decode_item arm_1111_table[] = {
1168c2ecf20Sopenharmony_ci	/* Unconditional instructions					*/
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci	/* memory hint		1111 0100 x001 xxxx xxxx xxxx xxxx xxxx */
1198c2ecf20Sopenharmony_ci	/* PLDI (immediate)	1111 0100 x101 xxxx xxxx xxxx xxxx xxxx */
1208c2ecf20Sopenharmony_ci	/* PLDW (immediate)	1111 0101 x001 xxxx xxxx xxxx xxxx xxxx */
1218c2ecf20Sopenharmony_ci	/* PLD (immediate)	1111 0101 x101 xxxx xxxx xxxx xxxx xxxx */
1228c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0xfe300000, 0xf4100000, PROBES_PRELOAD_IMM),
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci	/* memory hint		1111 0110 x001 xxxx xxxx xxxx xxx0 xxxx */
1258c2ecf20Sopenharmony_ci	/* PLDI (register)	1111 0110 x101 xxxx xxxx xxxx xxx0 xxxx */
1268c2ecf20Sopenharmony_ci	/* PLDW (register)	1111 0111 x001 xxxx xxxx xxxx xxx0 xxxx */
1278c2ecf20Sopenharmony_ci	/* PLD (register)	1111 0111 x101 xxxx xxxx xxxx xxx0 xxxx */
1288c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0xfe300010, 0xf6100000, PROBES_PRELOAD_REG),
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci	/* BLX (immediate)	1111 101x xxxx xxxx xxxx xxxx xxxx xxxx */
1318c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0xfe000000, 0xfa000000, PROBES_BRANCH_IMM),
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci	/* CPS			1111 0001 0000 xxx0 xxxx xxxx xx0x xxxx */
1348c2ecf20Sopenharmony_ci	/* SETEND		1111 0001 0000 0001 xxxx xxxx 0000 xxxx */
1358c2ecf20Sopenharmony_ci	/* SRS			1111 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
1368c2ecf20Sopenharmony_ci	/* RFE			1111 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci	/* Coprocessor instructions... */
1398c2ecf20Sopenharmony_ci	/* MCRR2		1111 1100 0100 xxxx xxxx xxxx xxxx xxxx */
1408c2ecf20Sopenharmony_ci	/* MRRC2		1111 1100 0101 xxxx xxxx xxxx xxxx xxxx */
1418c2ecf20Sopenharmony_ci	/* LDC2			1111 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
1428c2ecf20Sopenharmony_ci	/* STC2			1111 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
1438c2ecf20Sopenharmony_ci	/* CDP2			1111 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
1448c2ecf20Sopenharmony_ci	/* MCR2			1111 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1458c2ecf20Sopenharmony_ci	/* MRC2			1111 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci	/* Other unallocated instructions...				*/
1488c2ecf20Sopenharmony_ci	DECODE_END
1498c2ecf20Sopenharmony_ci};
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_0001_0xx0____0xxx_table[] = {
1528c2ecf20Sopenharmony_ci	/* Miscellaneous instructions					*/
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci	/* MRS cpsr		cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */
1558c2ecf20Sopenharmony_ci	DECODE_SIMULATEX(0x0ff000f0, 0x01000000, PROBES_MRS,
1568c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, 0)),
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci	/* BX			cccc 0001 0010 xxxx xxxx xxxx 0001 xxxx */
1598c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0x0ff000f0, 0x01200010, PROBES_BRANCH_REG),
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci	/* BLX (register)	cccc 0001 0010 xxxx xxxx xxxx 0011 xxxx */
1628c2ecf20Sopenharmony_ci	DECODE_SIMULATEX(0x0ff000f0, 0x01200030, PROBES_BRANCH_REG,
1638c2ecf20Sopenharmony_ci						 REGS(0, 0, 0, 0, NOPC)),
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci	/* CLZ			cccc 0001 0110 xxxx xxxx xxxx 0001 xxxx */
1668c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff000f0, 0x01600010, PROBES_CLZ,
1678c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, NOPC)),
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	/* QADD			cccc 0001 0000 xxxx xxxx xxxx 0101 xxxx */
1708c2ecf20Sopenharmony_ci	/* QSUB			cccc 0001 0010 xxxx xxxx xxxx 0101 xxxx */
1718c2ecf20Sopenharmony_ci	/* QDADD		cccc 0001 0100 xxxx xxxx xxxx 0101 xxxx */
1728c2ecf20Sopenharmony_ci	/* QDSUB		cccc 0001 0110 xxxx xxxx xxxx 0101 xxxx */
1738c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f9000f0, 0x01000050, PROBES_SATURATING_ARITHMETIC,
1748c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, 0, 0, NOPC)),
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	/* BXJ			cccc 0001 0010 xxxx xxxx xxxx 0010 xxxx */
1778c2ecf20Sopenharmony_ci	/* MSR			cccc 0001 0x10 xxxx xxxx xxxx 0000 xxxx */
1788c2ecf20Sopenharmony_ci	/* MRS spsr		cccc 0001 0100 xxxx xxxx xxxx 0000 xxxx */
1798c2ecf20Sopenharmony_ci	/* BKPT			1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
1808c2ecf20Sopenharmony_ci	/* SMC			cccc 0001 0110 xxxx xxxx xxxx 0111 xxxx */
1818c2ecf20Sopenharmony_ci	/* And unallocated instructions...				*/
1828c2ecf20Sopenharmony_ci	DECODE_END
1838c2ecf20Sopenharmony_ci};
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_0001_0xx0____1xx0_table[] = {
1868c2ecf20Sopenharmony_ci	/* Halfword multiply and multiply-accumulate			*/
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci	/* SMLALxy		cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */
1898c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff00090, 0x01400080, PROBES_MUL1,
1908c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci	/* SMULWy		cccc 0001 0010 xxxx xxxx xxxx 1x10 xxxx */
1938c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff000b0, 0x012000a0),
1948c2ecf20Sopenharmony_ci	/* SMULxy		cccc 0001 0110 xxxx xxxx xxxx 1xx0 xxxx */
1958c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff00090, 0x01600080, PROBES_MUL2,
1968c2ecf20Sopenharmony_ci						 REGS(NOPC, 0, NOPC, 0, NOPC)),
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci	/* SMLAxy		cccc 0001 0000 xxxx xxxx xxxx 1xx0 xxxx */
1998c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff00090, 0x01000080),
2008c2ecf20Sopenharmony_ci	/* SMLAWy		cccc 0001 0010 xxxx xxxx xxxx 1x00 xxxx */
2018c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff000b0, 0x01200080, PROBES_MUL2,
2028c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci	DECODE_END
2058c2ecf20Sopenharmony_ci};
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_0000_____1001_table[] = {
2088c2ecf20Sopenharmony_ci	/* Multiply and multiply-accumulate				*/
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci	/* MUL			cccc 0000 0000 xxxx xxxx xxxx 1001 xxxx */
2118c2ecf20Sopenharmony_ci	/* MULS			cccc 0000 0001 xxxx xxxx xxxx 1001 xxxx */
2128c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fe000f0, 0x00000090, PROBES_MUL2,
2138c2ecf20Sopenharmony_ci						 REGS(NOPC, 0, NOPC, 0, NOPC)),
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci	/* MLA			cccc 0000 0010 xxxx xxxx xxxx 1001 xxxx */
2168c2ecf20Sopenharmony_ci	/* MLAS			cccc 0000 0011 xxxx xxxx xxxx 1001 xxxx */
2178c2ecf20Sopenharmony_ci	DECODE_OR	(0x0fe000f0, 0x00200090),
2188c2ecf20Sopenharmony_ci	/* MLS			cccc 0000 0110 xxxx xxxx xxxx 1001 xxxx */
2198c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff000f0, 0x00600090, PROBES_MUL2,
2208c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci	/* UMAAL		cccc 0000 0100 xxxx xxxx xxxx 1001 xxxx */
2238c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff000f0, 0x00400090),
2248c2ecf20Sopenharmony_ci	/* UMULL		cccc 0000 1000 xxxx xxxx xxxx 1001 xxxx */
2258c2ecf20Sopenharmony_ci	/* UMULLS		cccc 0000 1001 xxxx xxxx xxxx 1001 xxxx */
2268c2ecf20Sopenharmony_ci	/* UMLAL		cccc 0000 1010 xxxx xxxx xxxx 1001 xxxx */
2278c2ecf20Sopenharmony_ci	/* UMLALS		cccc 0000 1011 xxxx xxxx xxxx 1001 xxxx */
2288c2ecf20Sopenharmony_ci	/* SMULL		cccc 0000 1100 xxxx xxxx xxxx 1001 xxxx */
2298c2ecf20Sopenharmony_ci	/* SMULLS		cccc 0000 1101 xxxx xxxx xxxx 1001 xxxx */
2308c2ecf20Sopenharmony_ci	/* SMLAL		cccc 0000 1110 xxxx xxxx xxxx 1001 xxxx */
2318c2ecf20Sopenharmony_ci	/* SMLALS		cccc 0000 1111 xxxx xxxx xxxx 1001 xxxx */
2328c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f8000f0, 0x00800090, PROBES_MUL1,
2338c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci	DECODE_END
2368c2ecf20Sopenharmony_ci};
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_0001_____1001_table[] = {
2398c2ecf20Sopenharmony_ci	/* Synchronization primitives					*/
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci#if __LINUX_ARM_ARCH__ < 6
2428c2ecf20Sopenharmony_ci	/* Deprecated on ARMv6 and may be UNDEFINED on v7		*/
2438c2ecf20Sopenharmony_ci	/* SMP/SWPB		cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */
2448c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fb000f0, 0x01000090, PROBES_SWP,
2458c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, 0, 0, NOPC)),
2468c2ecf20Sopenharmony_ci#endif
2478c2ecf20Sopenharmony_ci	/* LDREX/STREX{,D,B,H}	cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */
2488c2ecf20Sopenharmony_ci	/* And unallocated instructions...				*/
2498c2ecf20Sopenharmony_ci	DECODE_END
2508c2ecf20Sopenharmony_ci};
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_000x_____1xx1_table[] = {
2538c2ecf20Sopenharmony_ci	/* Extra load/store instructions				*/
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci	/* STRHT		cccc 0000 xx10 xxxx xxxx xxxx 1011 xxxx */
2568c2ecf20Sopenharmony_ci	/* ???			cccc 0000 xx10 xxxx xxxx xxxx 11x1 xxxx */
2578c2ecf20Sopenharmony_ci	/* LDRHT		cccc 0000 xx11 xxxx xxxx xxxx 1011 xxxx */
2588c2ecf20Sopenharmony_ci	/* LDRSBT		cccc 0000 xx11 xxxx xxxx xxxx 1101 xxxx */
2598c2ecf20Sopenharmony_ci	/* LDRSHT		cccc 0000 xx11 xxxx xxxx xxxx 1111 xxxx */
2608c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0f200090, 0x00200090),
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci	/* LDRD/STRD lr,pc,{...	cccc 000x x0x0 xxxx 111x xxxx 1101 xxxx */
2638c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0e10e0d0, 0x0000e0d0),
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci	/* LDRD (register)	cccc 000x x0x0 xxxx xxxx xxxx 1101 xxxx */
2668c2ecf20Sopenharmony_ci	/* STRD (register)	cccc 000x x0x0 xxxx xxxx xxxx 1111 xxxx */
2678c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e5000d0, 0x000000d0, PROBES_LDRSTRD,
2688c2ecf20Sopenharmony_ci						 REGS(NOPCWB, NOPCX, 0, 0, NOPC)),
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci	/* LDRD (immediate)	cccc 000x x1x0 xxxx xxxx xxxx 1101 xxxx */
2718c2ecf20Sopenharmony_ci	/* STRD (immediate)	cccc 000x x1x0 xxxx xxxx xxxx 1111 xxxx */
2728c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e5000d0, 0x004000d0, PROBES_LDRSTRD,
2738c2ecf20Sopenharmony_ci						 REGS(NOPCWB, NOPCX, 0, 0, 0)),
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci	/* STRH (register)	cccc 000x x0x0 xxxx xxxx xxxx 1011 xxxx */
2768c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e5000f0, 0x000000b0, PROBES_STORE_EXTRA,
2778c2ecf20Sopenharmony_ci						 REGS(NOPCWB, NOPC, 0, 0, NOPC)),
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci	/* LDRH (register)	cccc 000x x0x1 xxxx xxxx xxxx 1011 xxxx */
2808c2ecf20Sopenharmony_ci	/* LDRSB (register)	cccc 000x x0x1 xxxx xxxx xxxx 1101 xxxx */
2818c2ecf20Sopenharmony_ci	/* LDRSH (register)	cccc 000x x0x1 xxxx xxxx xxxx 1111 xxxx */
2828c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e500090, 0x00100090, PROBES_LOAD_EXTRA,
2838c2ecf20Sopenharmony_ci						 REGS(NOPCWB, NOPC, 0, 0, NOPC)),
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci	/* STRH (immediate)	cccc 000x x1x0 xxxx xxxx xxxx 1011 xxxx */
2868c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e5000f0, 0x004000b0, PROBES_STORE_EXTRA,
2878c2ecf20Sopenharmony_ci						 REGS(NOPCWB, NOPC, 0, 0, 0)),
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci	/* LDRH (immediate)	cccc 000x x1x1 xxxx xxxx xxxx 1011 xxxx */
2908c2ecf20Sopenharmony_ci	/* LDRSB (immediate)	cccc 000x x1x1 xxxx xxxx xxxx 1101 xxxx */
2918c2ecf20Sopenharmony_ci	/* LDRSH (immediate)	cccc 000x x1x1 xxxx xxxx xxxx 1111 xxxx */
2928c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e500090, 0x00500090, PROBES_LOAD_EXTRA,
2938c2ecf20Sopenharmony_ci						 REGS(NOPCWB, NOPC, 0, 0, 0)),
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci	DECODE_END
2968c2ecf20Sopenharmony_ci};
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_000x_table[] = {
2998c2ecf20Sopenharmony_ci	/* Data-processing (register)					*/
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci	/* <op>S PC, ...	cccc 000x xxx1 xxxx 1111 xxxx xxxx xxxx */
3028c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0e10f000, 0x0010f000),
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci	/* MOV IP, SP		1110 0001 1010 0000 1100 0000 0000 1101 */
3058c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0xffffffff, 0xe1a0c00d, PROBES_MOV_IP_SP),
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ci	/* TST (register)	cccc 0001 0001 xxxx xxxx xxxx xxx0 xxxx */
3088c2ecf20Sopenharmony_ci	/* TEQ (register)	cccc 0001 0011 xxxx xxxx xxxx xxx0 xxxx */
3098c2ecf20Sopenharmony_ci	/* CMP (register)	cccc 0001 0101 xxxx xxxx xxxx xxx0 xxxx */
3108c2ecf20Sopenharmony_ci	/* CMN (register)	cccc 0001 0111 xxxx xxxx xxxx xxx0 xxxx */
3118c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f900010, 0x01100000, PROBES_DATA_PROCESSING_REG,
3128c2ecf20Sopenharmony_ci						 REGS(ANY, 0, 0, 0, ANY)),
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci	/* MOV (register)	cccc 0001 101x xxxx xxxx xxxx xxx0 xxxx */
3158c2ecf20Sopenharmony_ci	/* MVN (register)	cccc 0001 111x xxxx xxxx xxxx xxx0 xxxx */
3168c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fa00010, 0x01a00000, PROBES_DATA_PROCESSING_REG,
3178c2ecf20Sopenharmony_ci						 REGS(0, ANY, 0, 0, ANY)),
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci	/* AND (register)	cccc 0000 000x xxxx xxxx xxxx xxx0 xxxx */
3208c2ecf20Sopenharmony_ci	/* EOR (register)	cccc 0000 001x xxxx xxxx xxxx xxx0 xxxx */
3218c2ecf20Sopenharmony_ci	/* SUB (register)	cccc 0000 010x xxxx xxxx xxxx xxx0 xxxx */
3228c2ecf20Sopenharmony_ci	/* RSB (register)	cccc 0000 011x xxxx xxxx xxxx xxx0 xxxx */
3238c2ecf20Sopenharmony_ci	/* ADD (register)	cccc 0000 100x xxxx xxxx xxxx xxx0 xxxx */
3248c2ecf20Sopenharmony_ci	/* ADC (register)	cccc 0000 101x xxxx xxxx xxxx xxx0 xxxx */
3258c2ecf20Sopenharmony_ci	/* SBC (register)	cccc 0000 110x xxxx xxxx xxxx xxx0 xxxx */
3268c2ecf20Sopenharmony_ci	/* RSC (register)	cccc 0000 111x xxxx xxxx xxxx xxx0 xxxx */
3278c2ecf20Sopenharmony_ci	/* ORR (register)	cccc 0001 100x xxxx xxxx xxxx xxx0 xxxx */
3288c2ecf20Sopenharmony_ci	/* BIC (register)	cccc 0001 110x xxxx xxxx xxxx xxx0 xxxx */
3298c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e000010, 0x00000000, PROBES_DATA_PROCESSING_REG,
3308c2ecf20Sopenharmony_ci						 REGS(ANY, ANY, 0, 0, ANY)),
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci	/* TST (reg-shift reg)	cccc 0001 0001 xxxx xxxx xxxx 0xx1 xxxx */
3338c2ecf20Sopenharmony_ci	/* TEQ (reg-shift reg)	cccc 0001 0011 xxxx xxxx xxxx 0xx1 xxxx */
3348c2ecf20Sopenharmony_ci	/* CMP (reg-shift reg)	cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */
3358c2ecf20Sopenharmony_ci	/* CMN (reg-shift reg)	cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */
3368c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f900090, 0x01100010, PROBES_DATA_PROCESSING_REG,
3378c2ecf20Sopenharmony_ci						 REGS(NOPC, 0, NOPC, 0, NOPC)),
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci	/* MOV (reg-shift reg)	cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */
3408c2ecf20Sopenharmony_ci	/* MVN (reg-shift reg)	cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */
3418c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fa00090, 0x01a00010, PROBES_DATA_PROCESSING_REG,
3428c2ecf20Sopenharmony_ci						 REGS(0, NOPC, NOPC, 0, NOPC)),
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci	/* AND (reg-shift reg)	cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */
3458c2ecf20Sopenharmony_ci	/* EOR (reg-shift reg)	cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */
3468c2ecf20Sopenharmony_ci	/* SUB (reg-shift reg)	cccc 0000 010x xxxx xxxx xxxx 0xx1 xxxx */
3478c2ecf20Sopenharmony_ci	/* RSB (reg-shift reg)	cccc 0000 011x xxxx xxxx xxxx 0xx1 xxxx */
3488c2ecf20Sopenharmony_ci	/* ADD (reg-shift reg)	cccc 0000 100x xxxx xxxx xxxx 0xx1 xxxx */
3498c2ecf20Sopenharmony_ci	/* ADC (reg-shift reg)	cccc 0000 101x xxxx xxxx xxxx 0xx1 xxxx */
3508c2ecf20Sopenharmony_ci	/* SBC (reg-shift reg)	cccc 0000 110x xxxx xxxx xxxx 0xx1 xxxx */
3518c2ecf20Sopenharmony_ci	/* RSC (reg-shift reg)	cccc 0000 111x xxxx xxxx xxxx 0xx1 xxxx */
3528c2ecf20Sopenharmony_ci	/* ORR (reg-shift reg)	cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */
3538c2ecf20Sopenharmony_ci	/* BIC (reg-shift reg)	cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */
3548c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG,
3558c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_ci	DECODE_END
3588c2ecf20Sopenharmony_ci};
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_001x_table[] = {
3618c2ecf20Sopenharmony_ci	/* Data-processing (immediate)					*/
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci	/* MOVW			cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
3648c2ecf20Sopenharmony_ci	/* MOVT			cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
3658c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fb00000, 0x03000000, PROBES_MOV_HALFWORD,
3668c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, 0)),
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci	/* YIELD		cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
3698c2ecf20Sopenharmony_ci	DECODE_OR	(0x0fff00ff, 0x03200001),
3708c2ecf20Sopenharmony_ci	/* SEV			cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
3718c2ecf20Sopenharmony_ci	DECODE_EMULATE	(0x0fff00ff, 0x03200004, PROBES_SEV),
3728c2ecf20Sopenharmony_ci	/* NOP			cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
3738c2ecf20Sopenharmony_ci	/* WFE			cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
3748c2ecf20Sopenharmony_ci	/* WFI			cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
3758c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0x0fff00fc, 0x03200000, PROBES_WFE),
3768c2ecf20Sopenharmony_ci	/* DBG			cccc 0011 0010 0000 xxxx xxxx ffff xxxx */
3778c2ecf20Sopenharmony_ci	/* unallocated hints	cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
3788c2ecf20Sopenharmony_ci	/* MSR (immediate)	cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */
3798c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0fb00000, 0x03200000),
3808c2ecf20Sopenharmony_ci
3818c2ecf20Sopenharmony_ci	/* <op>S PC, ...	cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx */
3828c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0e10f000, 0x0210f000),
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ci	/* TST (immediate)	cccc 0011 0001 xxxx xxxx xxxx xxxx xxxx */
3858c2ecf20Sopenharmony_ci	/* TEQ (immediate)	cccc 0011 0011 xxxx xxxx xxxx xxxx xxxx */
3868c2ecf20Sopenharmony_ci	/* CMP (immediate)	cccc 0011 0101 xxxx xxxx xxxx xxxx xxxx */
3878c2ecf20Sopenharmony_ci	/* CMN (immediate)	cccc 0011 0111 xxxx xxxx xxxx xxxx xxxx */
3888c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f900000, 0x03100000, PROBES_DATA_PROCESSING_IMM,
3898c2ecf20Sopenharmony_ci						 REGS(ANY, 0, 0, 0, 0)),
3908c2ecf20Sopenharmony_ci
3918c2ecf20Sopenharmony_ci	/* MOV (immediate)	cccc 0011 101x xxxx xxxx xxxx xxxx xxxx */
3928c2ecf20Sopenharmony_ci	/* MVN (immediate)	cccc 0011 111x xxxx xxxx xxxx xxxx xxxx */
3938c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fa00000, 0x03a00000, PROBES_DATA_PROCESSING_IMM,
3948c2ecf20Sopenharmony_ci						 REGS(0, ANY, 0, 0, 0)),
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci	/* AND (immediate)	cccc 0010 000x xxxx xxxx xxxx xxxx xxxx */
3978c2ecf20Sopenharmony_ci	/* EOR (immediate)	cccc 0010 001x xxxx xxxx xxxx xxxx xxxx */
3988c2ecf20Sopenharmony_ci	/* SUB (immediate)	cccc 0010 010x xxxx xxxx xxxx xxxx xxxx */
3998c2ecf20Sopenharmony_ci	/* RSB (immediate)	cccc 0010 011x xxxx xxxx xxxx xxxx xxxx */
4008c2ecf20Sopenharmony_ci	/* ADD (immediate)	cccc 0010 100x xxxx xxxx xxxx xxxx xxxx */
4018c2ecf20Sopenharmony_ci	/* ADC (immediate)	cccc 0010 101x xxxx xxxx xxxx xxxx xxxx */
4028c2ecf20Sopenharmony_ci	/* SBC (immediate)	cccc 0010 110x xxxx xxxx xxxx xxxx xxxx */
4038c2ecf20Sopenharmony_ci	/* RSC (immediate)	cccc 0010 111x xxxx xxxx xxxx xxxx xxxx */
4048c2ecf20Sopenharmony_ci	/* ORR (immediate)	cccc 0011 100x xxxx xxxx xxxx xxxx xxxx */
4058c2ecf20Sopenharmony_ci	/* BIC (immediate)	cccc 0011 110x xxxx xxxx xxxx xxxx xxxx */
4068c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e000000, 0x02000000, PROBES_DATA_PROCESSING_IMM,
4078c2ecf20Sopenharmony_ci						 REGS(ANY, ANY, 0, 0, 0)),
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_ci	DECODE_END
4108c2ecf20Sopenharmony_ci};
4118c2ecf20Sopenharmony_ci
4128c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_0110_____xxx1_table[] = {
4138c2ecf20Sopenharmony_ci	/* Media instructions						*/
4148c2ecf20Sopenharmony_ci
4158c2ecf20Sopenharmony_ci	/* SEL			cccc 0110 1000 xxxx xxxx xxxx 1011 xxxx */
4168c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff000f0, 0x068000b0, PROBES_SATURATE,
4178c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, 0, 0, NOPC)),
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci	/* SSAT			cccc 0110 101x xxxx xxxx xxxx xx01 xxxx */
4208c2ecf20Sopenharmony_ci	/* USAT			cccc 0110 111x xxxx xxxx xxxx xx01 xxxx */
4218c2ecf20Sopenharmony_ci	DECODE_OR(0x0fa00030, 0x06a00010),
4228c2ecf20Sopenharmony_ci	/* SSAT16		cccc 0110 1010 xxxx xxxx xxxx 0011 xxxx */
4238c2ecf20Sopenharmony_ci	/* USAT16		cccc 0110 1110 xxxx xxxx xxxx 0011 xxxx */
4248c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fb000f0, 0x06a00030, PROBES_SATURATE,
4258c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, NOPC)),
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_ci	/* REV			cccc 0110 1011 xxxx xxxx xxxx 0011 xxxx */
4288c2ecf20Sopenharmony_ci	/* REV16		cccc 0110 1011 xxxx xxxx xxxx 1011 xxxx */
4298c2ecf20Sopenharmony_ci	/* RBIT			cccc 0110 1111 xxxx xxxx xxxx 0011 xxxx */
4308c2ecf20Sopenharmony_ci	/* REVSH		cccc 0110 1111 xxxx xxxx xxxx 1011 xxxx */
4318c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fb00070, 0x06b00030, PROBES_REV,
4328c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, NOPC)),
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci	/* ???			cccc 0110 0x00 xxxx xxxx xxxx xxx1 xxxx */
4358c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0fb00010, 0x06000010),
4368c2ecf20Sopenharmony_ci	/* ???			cccc 0110 0xxx xxxx xxxx xxxx 1011 xxxx */
4378c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0f8000f0, 0x060000b0),
4388c2ecf20Sopenharmony_ci	/* ???			cccc 0110 0xxx xxxx xxxx xxxx 1101 xxxx */
4398c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0f8000f0, 0x060000d0),
4408c2ecf20Sopenharmony_ci	/* SADD16		cccc 0110 0001 xxxx xxxx xxxx 0001 xxxx */
4418c2ecf20Sopenharmony_ci	/* SADDSUBX		cccc 0110 0001 xxxx xxxx xxxx 0011 xxxx */
4428c2ecf20Sopenharmony_ci	/* SSUBADDX		cccc 0110 0001 xxxx xxxx xxxx 0101 xxxx */
4438c2ecf20Sopenharmony_ci	/* SSUB16		cccc 0110 0001 xxxx xxxx xxxx 0111 xxxx */
4448c2ecf20Sopenharmony_ci	/* SADD8		cccc 0110 0001 xxxx xxxx xxxx 1001 xxxx */
4458c2ecf20Sopenharmony_ci	/* SSUB8		cccc 0110 0001 xxxx xxxx xxxx 1111 xxxx */
4468c2ecf20Sopenharmony_ci	/* QADD16		cccc 0110 0010 xxxx xxxx xxxx 0001 xxxx */
4478c2ecf20Sopenharmony_ci	/* QADDSUBX		cccc 0110 0010 xxxx xxxx xxxx 0011 xxxx */
4488c2ecf20Sopenharmony_ci	/* QSUBADDX		cccc 0110 0010 xxxx xxxx xxxx 0101 xxxx */
4498c2ecf20Sopenharmony_ci	/* QSUB16		cccc 0110 0010 xxxx xxxx xxxx 0111 xxxx */
4508c2ecf20Sopenharmony_ci	/* QADD8		cccc 0110 0010 xxxx xxxx xxxx 1001 xxxx */
4518c2ecf20Sopenharmony_ci	/* QSUB8		cccc 0110 0010 xxxx xxxx xxxx 1111 xxxx */
4528c2ecf20Sopenharmony_ci	/* SHADD16		cccc 0110 0011 xxxx xxxx xxxx 0001 xxxx */
4538c2ecf20Sopenharmony_ci	/* SHADDSUBX		cccc 0110 0011 xxxx xxxx xxxx 0011 xxxx */
4548c2ecf20Sopenharmony_ci	/* SHSUBADDX		cccc 0110 0011 xxxx xxxx xxxx 0101 xxxx */
4558c2ecf20Sopenharmony_ci	/* SHSUB16		cccc 0110 0011 xxxx xxxx xxxx 0111 xxxx */
4568c2ecf20Sopenharmony_ci	/* SHADD8		cccc 0110 0011 xxxx xxxx xxxx 1001 xxxx */
4578c2ecf20Sopenharmony_ci	/* SHSUB8		cccc 0110 0011 xxxx xxxx xxxx 1111 xxxx */
4588c2ecf20Sopenharmony_ci	/* UADD16		cccc 0110 0101 xxxx xxxx xxxx 0001 xxxx */
4598c2ecf20Sopenharmony_ci	/* UADDSUBX		cccc 0110 0101 xxxx xxxx xxxx 0011 xxxx */
4608c2ecf20Sopenharmony_ci	/* USUBADDX		cccc 0110 0101 xxxx xxxx xxxx 0101 xxxx */
4618c2ecf20Sopenharmony_ci	/* USUB16		cccc 0110 0101 xxxx xxxx xxxx 0111 xxxx */
4628c2ecf20Sopenharmony_ci	/* UADD8		cccc 0110 0101 xxxx xxxx xxxx 1001 xxxx */
4638c2ecf20Sopenharmony_ci	/* USUB8		cccc 0110 0101 xxxx xxxx xxxx 1111 xxxx */
4648c2ecf20Sopenharmony_ci	/* UQADD16		cccc 0110 0110 xxxx xxxx xxxx 0001 xxxx */
4658c2ecf20Sopenharmony_ci	/* UQADDSUBX		cccc 0110 0110 xxxx xxxx xxxx 0011 xxxx */
4668c2ecf20Sopenharmony_ci	/* UQSUBADDX		cccc 0110 0110 xxxx xxxx xxxx 0101 xxxx */
4678c2ecf20Sopenharmony_ci	/* UQSUB16		cccc 0110 0110 xxxx xxxx xxxx 0111 xxxx */
4688c2ecf20Sopenharmony_ci	/* UQADD8		cccc 0110 0110 xxxx xxxx xxxx 1001 xxxx */
4698c2ecf20Sopenharmony_ci	/* UQSUB8		cccc 0110 0110 xxxx xxxx xxxx 1111 xxxx */
4708c2ecf20Sopenharmony_ci	/* UHADD16		cccc 0110 0111 xxxx xxxx xxxx 0001 xxxx */
4718c2ecf20Sopenharmony_ci	/* UHADDSUBX		cccc 0110 0111 xxxx xxxx xxxx 0011 xxxx */
4728c2ecf20Sopenharmony_ci	/* UHSUBADDX		cccc 0110 0111 xxxx xxxx xxxx 0101 xxxx */
4738c2ecf20Sopenharmony_ci	/* UHSUB16		cccc 0110 0111 xxxx xxxx xxxx 0111 xxxx */
4748c2ecf20Sopenharmony_ci	/* UHADD8		cccc 0110 0111 xxxx xxxx xxxx 1001 xxxx */
4758c2ecf20Sopenharmony_ci	/* UHSUB8		cccc 0110 0111 xxxx xxxx xxxx 1111 xxxx */
4768c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f800010, 0x06000010, PROBES_MMI,
4778c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, 0, 0, NOPC)),
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci	/* PKHBT		cccc 0110 1000 xxxx xxxx xxxx x001 xxxx */
4808c2ecf20Sopenharmony_ci	/* PKHTB		cccc 0110 1000 xxxx xxxx xxxx x101 xxxx */
4818c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff00030, 0x06800010, PROBES_PACK,
4828c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, 0, 0, NOPC)),
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_ci	/* ???			cccc 0110 1001 xxxx xxxx xxxx 0111 xxxx */
4858c2ecf20Sopenharmony_ci	/* ???			cccc 0110 1101 xxxx xxxx xxxx 0111 xxxx */
4868c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0fb000f0, 0x06900070),
4878c2ecf20Sopenharmony_ci
4888c2ecf20Sopenharmony_ci	/* SXTB16		cccc 0110 1000 1111 xxxx xxxx 0111 xxxx */
4898c2ecf20Sopenharmony_ci	/* SXTB			cccc 0110 1010 1111 xxxx xxxx 0111 xxxx */
4908c2ecf20Sopenharmony_ci	/* SXTH			cccc 0110 1011 1111 xxxx xxxx 0111 xxxx */
4918c2ecf20Sopenharmony_ci	/* UXTB16		cccc 0110 1100 1111 xxxx xxxx 0111 xxxx */
4928c2ecf20Sopenharmony_ci	/* UXTB			cccc 0110 1110 1111 xxxx xxxx 0111 xxxx */
4938c2ecf20Sopenharmony_ci	/* UXTH			cccc 0110 1111 1111 xxxx xxxx 0111 xxxx */
4948c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f8f00f0, 0x068f0070, PROBES_EXTEND,
4958c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, NOPC)),
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci	/* SXTAB16		cccc 0110 1000 xxxx xxxx xxxx 0111 xxxx */
4988c2ecf20Sopenharmony_ci	/* SXTAB		cccc 0110 1010 xxxx xxxx xxxx 0111 xxxx */
4998c2ecf20Sopenharmony_ci	/* SXTAH		cccc 0110 1011 xxxx xxxx xxxx 0111 xxxx */
5008c2ecf20Sopenharmony_ci	/* UXTAB16		cccc 0110 1100 xxxx xxxx xxxx 0111 xxxx */
5018c2ecf20Sopenharmony_ci	/* UXTAB		cccc 0110 1110 xxxx xxxx xxxx 0111 xxxx */
5028c2ecf20Sopenharmony_ci	/* UXTAH		cccc 0110 1111 xxxx xxxx xxxx 0111 xxxx */
5038c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0f8000f0, 0x06800070, PROBES_EXTEND_ADD,
5048c2ecf20Sopenharmony_ci						 REGS(NOPCX, NOPC, 0, 0, NOPC)),
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci	DECODE_END
5078c2ecf20Sopenharmony_ci};
5088c2ecf20Sopenharmony_ci
5098c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_0111_____xxx1_table[] = {
5108c2ecf20Sopenharmony_ci	/* Media instructions						*/
5118c2ecf20Sopenharmony_ci
5128c2ecf20Sopenharmony_ci	/* UNDEFINED		cccc 0111 1111 xxxx xxxx xxxx 1111 xxxx */
5138c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0ff000f0, 0x07f000f0),
5148c2ecf20Sopenharmony_ci
5158c2ecf20Sopenharmony_ci	/* SMLALD		cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */
5168c2ecf20Sopenharmony_ci	/* SMLSLD		cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */
5178c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff00090, 0x07400010, PROBES_MUL_ADD_LONG,
5188c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
5198c2ecf20Sopenharmony_ci
5208c2ecf20Sopenharmony_ci	/* SMUAD		cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx */
5218c2ecf20Sopenharmony_ci	/* SMUSD		cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx */
5228c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff0f090, 0x0700f010),
5238c2ecf20Sopenharmony_ci	/* SMMUL		cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx */
5248c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff0f0d0, 0x0750f010),
5258c2ecf20Sopenharmony_ci	/* USAD8		cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx */
5268c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff0f0f0, 0x0780f010, PROBES_MUL_ADD,
5278c2ecf20Sopenharmony_ci						 REGS(NOPC, 0, NOPC, 0, NOPC)),
5288c2ecf20Sopenharmony_ci
5298c2ecf20Sopenharmony_ci	/* SMLAD		cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx */
5308c2ecf20Sopenharmony_ci	/* SMLSD		cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx */
5318c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff00090, 0x07000010),
5328c2ecf20Sopenharmony_ci	/* SMMLA		cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx */
5338c2ecf20Sopenharmony_ci	DECODE_OR	(0x0ff000d0, 0x07500010),
5348c2ecf20Sopenharmony_ci	/* USADA8		cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx */
5358c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff000f0, 0x07800010, PROBES_MUL_ADD,
5368c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPCX, NOPC, 0, NOPC)),
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci	/* SMMLS		cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx */
5398c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0ff000d0, 0x075000d0, PROBES_MUL_ADD,
5408c2ecf20Sopenharmony_ci						 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
5418c2ecf20Sopenharmony_ci
5428c2ecf20Sopenharmony_ci	/* SBFX			cccc 0111 101x xxxx xxxx xxxx x101 xxxx */
5438c2ecf20Sopenharmony_ci	/* UBFX			cccc 0111 111x xxxx xxxx xxxx x101 xxxx */
5448c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fa00070, 0x07a00050, PROBES_BITFIELD,
5458c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, NOPC)),
5468c2ecf20Sopenharmony_ci
5478c2ecf20Sopenharmony_ci	/* BFC			cccc 0111 110x xxxx xxxx xxxx x001 1111 */
5488c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fe0007f, 0x07c0001f, PROBES_BITFIELD,
5498c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, 0)),
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_ci	/* BFI			cccc 0111 110x xxxx xxxx xxxx x001 xxxx */
5528c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0fe00070, 0x07c00010, PROBES_BITFIELD,
5538c2ecf20Sopenharmony_ci						 REGS(0, NOPC, 0, 0, NOPCX)),
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_ci	DECODE_END
5568c2ecf20Sopenharmony_ci};
5578c2ecf20Sopenharmony_ci
5588c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_01xx_table[] = {
5598c2ecf20Sopenharmony_ci	/* Load/store word and unsigned byte				*/
5608c2ecf20Sopenharmony_ci
5618c2ecf20Sopenharmony_ci	/* LDRB/STRB pc,[...]	cccc 01xx x0xx xxxx xxxx xxxx xxxx xxxx */
5628c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0c40f000, 0x0440f000),
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci	/* STRT			cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */
5658c2ecf20Sopenharmony_ci	/* LDRT			cccc 01x0 x011 xxxx xxxx xxxx xxxx xxxx */
5668c2ecf20Sopenharmony_ci	/* STRBT		cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */
5678c2ecf20Sopenharmony_ci	/* LDRBT		cccc 01x0 x111 xxxx xxxx xxxx xxxx xxxx */
5688c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0d200000, 0x04200000),
5698c2ecf20Sopenharmony_ci
5708c2ecf20Sopenharmony_ci	/* STR (immediate)	cccc 010x x0x0 xxxx xxxx xxxx xxxx xxxx */
5718c2ecf20Sopenharmony_ci	/* STRB (immediate)	cccc 010x x1x0 xxxx xxxx xxxx xxxx xxxx */
5728c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e100000, 0x04000000, PROBES_STORE,
5738c2ecf20Sopenharmony_ci						 REGS(NOPCWB, ANY, 0, 0, 0)),
5748c2ecf20Sopenharmony_ci
5758c2ecf20Sopenharmony_ci	/* LDR (immediate)	cccc 010x x0x1 xxxx xxxx xxxx xxxx xxxx */
5768c2ecf20Sopenharmony_ci	/* LDRB (immediate)	cccc 010x x1x1 xxxx xxxx xxxx xxxx xxxx */
5778c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e100000, 0x04100000, PROBES_LOAD,
5788c2ecf20Sopenharmony_ci						 REGS(NOPCWB, ANY, 0, 0, 0)),
5798c2ecf20Sopenharmony_ci
5808c2ecf20Sopenharmony_ci	/* STR (register)	cccc 011x x0x0 xxxx xxxx xxxx xxxx xxxx */
5818c2ecf20Sopenharmony_ci	/* STRB (register)	cccc 011x x1x0 xxxx xxxx xxxx xxxx xxxx */
5828c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e100000, 0x06000000, PROBES_STORE,
5838c2ecf20Sopenharmony_ci						 REGS(NOPCWB, ANY, 0, 0, NOPC)),
5848c2ecf20Sopenharmony_ci
5858c2ecf20Sopenharmony_ci	/* LDR (register)	cccc 011x x0x1 xxxx xxxx xxxx xxxx xxxx */
5868c2ecf20Sopenharmony_ci	/* LDRB (register)	cccc 011x x1x1 xxxx xxxx xxxx xxxx xxxx */
5878c2ecf20Sopenharmony_ci	DECODE_EMULATEX	(0x0e100000, 0x06100000, PROBES_LOAD,
5888c2ecf20Sopenharmony_ci						 REGS(NOPCWB, ANY, 0, 0, NOPC)),
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci	DECODE_END
5918c2ecf20Sopenharmony_ci};
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_cistatic const union decode_item arm_cccc_100x_table[] = {
5948c2ecf20Sopenharmony_ci	/* Block data transfer instructions				*/
5958c2ecf20Sopenharmony_ci
5968c2ecf20Sopenharmony_ci	/* LDM			cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
5978c2ecf20Sopenharmony_ci	/* STM			cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */
5988c2ecf20Sopenharmony_ci	DECODE_CUSTOM	(0x0e400000, 0x08000000, PROBES_LDMSTM),
5998c2ecf20Sopenharmony_ci
6008c2ecf20Sopenharmony_ci	/* STM (user registers)	cccc 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
6018c2ecf20Sopenharmony_ci	/* LDM (user registers)	cccc 100x x1x1 xxxx 0xxx xxxx xxxx xxxx */
6028c2ecf20Sopenharmony_ci	/* LDM (exception ret)	cccc 100x x1x1 xxxx 1xxx xxxx xxxx xxxx */
6038c2ecf20Sopenharmony_ci	DECODE_END
6048c2ecf20Sopenharmony_ci};
6058c2ecf20Sopenharmony_ci
6068c2ecf20Sopenharmony_ciconst union decode_item probes_decode_arm_table[] = {
6078c2ecf20Sopenharmony_ci	/*
6088c2ecf20Sopenharmony_ci	 * Unconditional instructions
6098c2ecf20Sopenharmony_ci	 *			1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
6108c2ecf20Sopenharmony_ci	 */
6118c2ecf20Sopenharmony_ci	DECODE_TABLE	(0xf0000000, 0xf0000000, arm_1111_table),
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_ci	/*
6148c2ecf20Sopenharmony_ci	 * Miscellaneous instructions
6158c2ecf20Sopenharmony_ci	 *			cccc 0001 0xx0 xxxx xxxx xxxx 0xxx xxxx
6168c2ecf20Sopenharmony_ci	 */
6178c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0f900080, 0x01000000, arm_cccc_0001_0xx0____0xxx_table),
6188c2ecf20Sopenharmony_ci
6198c2ecf20Sopenharmony_ci	/*
6208c2ecf20Sopenharmony_ci	 * Halfword multiply and multiply-accumulate
6218c2ecf20Sopenharmony_ci	 *			cccc 0001 0xx0 xxxx xxxx xxxx 1xx0 xxxx
6228c2ecf20Sopenharmony_ci	 */
6238c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0f900090, 0x01000080, arm_cccc_0001_0xx0____1xx0_table),
6248c2ecf20Sopenharmony_ci
6258c2ecf20Sopenharmony_ci	/*
6268c2ecf20Sopenharmony_ci	 * Multiply and multiply-accumulate
6278c2ecf20Sopenharmony_ci	 *			cccc 0000 xxxx xxxx xxxx xxxx 1001 xxxx
6288c2ecf20Sopenharmony_ci	 */
6298c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0f0000f0, 0x00000090, arm_cccc_0000_____1001_table),
6308c2ecf20Sopenharmony_ci
6318c2ecf20Sopenharmony_ci	/*
6328c2ecf20Sopenharmony_ci	 * Synchronization primitives
6338c2ecf20Sopenharmony_ci	 *			cccc 0001 xxxx xxxx xxxx xxxx 1001 xxxx
6348c2ecf20Sopenharmony_ci	 */
6358c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0f0000f0, 0x01000090, arm_cccc_0001_____1001_table),
6368c2ecf20Sopenharmony_ci
6378c2ecf20Sopenharmony_ci	/*
6388c2ecf20Sopenharmony_ci	 * Extra load/store instructions
6398c2ecf20Sopenharmony_ci	 *			cccc 000x xxxx xxxx xxxx xxxx 1xx1 xxxx
6408c2ecf20Sopenharmony_ci	 */
6418c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0e000090, 0x00000090, arm_cccc_000x_____1xx1_table),
6428c2ecf20Sopenharmony_ci
6438c2ecf20Sopenharmony_ci	/*
6448c2ecf20Sopenharmony_ci	 * Data-processing (register)
6458c2ecf20Sopenharmony_ci	 *			cccc 000x xxxx xxxx xxxx xxxx xxx0 xxxx
6468c2ecf20Sopenharmony_ci	 * Data-processing (register-shifted register)
6478c2ecf20Sopenharmony_ci	 *			cccc 000x xxxx xxxx xxxx xxxx 0xx1 xxxx
6488c2ecf20Sopenharmony_ci	 */
6498c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0e000000, 0x00000000, arm_cccc_000x_table),
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_ci	/*
6528c2ecf20Sopenharmony_ci	 * Data-processing (immediate)
6538c2ecf20Sopenharmony_ci	 *			cccc 001x xxxx xxxx xxxx xxxx xxxx xxxx
6548c2ecf20Sopenharmony_ci	 */
6558c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0e000000, 0x02000000, arm_cccc_001x_table),
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_ci	/*
6588c2ecf20Sopenharmony_ci	 * Media instructions
6598c2ecf20Sopenharmony_ci	 *			cccc 011x xxxx xxxx xxxx xxxx xxx1 xxxx
6608c2ecf20Sopenharmony_ci	 */
6618c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0f000010, 0x06000010, arm_cccc_0110_____xxx1_table),
6628c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0f000010, 0x07000010, arm_cccc_0111_____xxx1_table),
6638c2ecf20Sopenharmony_ci
6648c2ecf20Sopenharmony_ci	/*
6658c2ecf20Sopenharmony_ci	 * Load/store word and unsigned byte
6668c2ecf20Sopenharmony_ci	 *			cccc 01xx xxxx xxxx xxxx xxxx xxxx xxxx
6678c2ecf20Sopenharmony_ci	 */
6688c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0c000000, 0x04000000, arm_cccc_01xx_table),
6698c2ecf20Sopenharmony_ci
6708c2ecf20Sopenharmony_ci	/*
6718c2ecf20Sopenharmony_ci	 * Block data transfer instructions
6728c2ecf20Sopenharmony_ci	 *			cccc 100x xxxx xxxx xxxx xxxx xxxx xxxx
6738c2ecf20Sopenharmony_ci	 */
6748c2ecf20Sopenharmony_ci	DECODE_TABLE	(0x0e000000, 0x08000000, arm_cccc_100x_table),
6758c2ecf20Sopenharmony_ci
6768c2ecf20Sopenharmony_ci	/* B			cccc 1010 xxxx xxxx xxxx xxxx xxxx xxxx */
6778c2ecf20Sopenharmony_ci	/* BL			cccc 1011 xxxx xxxx xxxx xxxx xxxx xxxx */
6788c2ecf20Sopenharmony_ci	DECODE_SIMULATE	(0x0e000000, 0x0a000000, PROBES_BRANCH),
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_ci	/*
6818c2ecf20Sopenharmony_ci	 * Supervisor Call, and coprocessor instructions
6828c2ecf20Sopenharmony_ci	 */
6838c2ecf20Sopenharmony_ci
6848c2ecf20Sopenharmony_ci	/* MCRR			cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx */
6858c2ecf20Sopenharmony_ci	/* MRRC			cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx */
6868c2ecf20Sopenharmony_ci	/* LDC			cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
6878c2ecf20Sopenharmony_ci	/* STC			cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
6888c2ecf20Sopenharmony_ci	/* CDP			cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
6898c2ecf20Sopenharmony_ci	/* MCR			cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
6908c2ecf20Sopenharmony_ci	/* MRC			cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
6918c2ecf20Sopenharmony_ci	/* SVC			cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
6928c2ecf20Sopenharmony_ci	DECODE_REJECT	(0x0c000000, 0x0c000000),
6938c2ecf20Sopenharmony_ci
6948c2ecf20Sopenharmony_ci	DECODE_END
6958c2ecf20Sopenharmony_ci};
6968c2ecf20Sopenharmony_ci#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
6978c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(probes_decode_arm_table);
6988c2ecf20Sopenharmony_ci#endif
6998c2ecf20Sopenharmony_ci
7008c2ecf20Sopenharmony_cistatic void __kprobes arm_singlestep(probes_opcode_t insn,
7018c2ecf20Sopenharmony_ci		struct arch_probes_insn *asi, struct pt_regs *regs)
7028c2ecf20Sopenharmony_ci{
7038c2ecf20Sopenharmony_ci	regs->ARM_pc += 4;
7048c2ecf20Sopenharmony_ci	asi->insn_handler(insn, asi, regs);
7058c2ecf20Sopenharmony_ci}
7068c2ecf20Sopenharmony_ci
7078c2ecf20Sopenharmony_ci/* Return:
7088c2ecf20Sopenharmony_ci *   INSN_REJECTED     If instruction is one not allowed to kprobe,
7098c2ecf20Sopenharmony_ci *   INSN_GOOD         If instruction is supported and uses instruction slot,
7108c2ecf20Sopenharmony_ci *   INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.
7118c2ecf20Sopenharmony_ci *
7128c2ecf20Sopenharmony_ci * For instructions we don't want to kprobe (INSN_REJECTED return result):
7138c2ecf20Sopenharmony_ci *   These are generally ones that modify the processor state making
7148c2ecf20Sopenharmony_ci *   them "hard" to simulate such as switches processor modes or
7158c2ecf20Sopenharmony_ci *   make accesses in alternate modes.  Any of these could be simulated
7168c2ecf20Sopenharmony_ci *   if the work was put into it, but low return considering they
7178c2ecf20Sopenharmony_ci *   should also be very rare.
7188c2ecf20Sopenharmony_ci */
7198c2ecf20Sopenharmony_cienum probes_insn __kprobes
7208c2ecf20Sopenharmony_ciarm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
7218c2ecf20Sopenharmony_ci		       bool emulate, const union decode_action *actions,
7228c2ecf20Sopenharmony_ci		       const struct decode_checker *checkers[])
7238c2ecf20Sopenharmony_ci{
7248c2ecf20Sopenharmony_ci	asi->insn_singlestep = arm_singlestep;
7258c2ecf20Sopenharmony_ci	asi->insn_check_cc = probes_condition_checks[insn>>28];
7268c2ecf20Sopenharmony_ci	return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
7278c2ecf20Sopenharmony_ci				  emulate, actions, checkers);
7288c2ecf20Sopenharmony_ci}
729