decode-arm.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. /*
  2. *
  3. * arch/arm/probes/decode-arm.c
  4. *
  5. * Some code moved here from arch/arm/kernel/kprobes-arm.c
  6. *
  7. * Copyright (C) 2006, 2007 Motorola Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/module.h>
  20. #include <linux/stddef.h>
  21. #include <linux/ptrace.h>
  22. #include "decode.h"
  23. #include "decode-arm.h"
  24. #define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
  25. #define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
  26. /*
  27. * To avoid the complications of mimicing single-stepping on a
  28. * processor without a Next-PC or a single-step mode, and to
  29. * avoid having to deal with the side-effects of boosting, we
  30. * simulate or emulate (almost) all ARM instructions.
  31. *
  32. * "Simulation" is where the instruction's behavior is duplicated in
  33. * C code. "Emulation" is where the original instruction is rewritten
  34. * and executed, often by altering its registers.
  35. *
  36. * By having all behavior of the kprobe'd instruction completed before
  37. * returning from the kprobe_handler(), all locks (scheduler and
  38. * interrupt) can safely be released. There is no need for secondary
  39. * breakpoints, no race with MP or preemptable kernels, nor having to
  40. * clean up resources counts at a later time impacting overall system
  41. * performance. By rewriting the instruction, only the minimum registers
  42. * need to be loaded and saved back optimizing performance.
  43. *
  44. * Calling the insnslot_*_rwflags version of a function doesn't hurt
  45. * anything even when the CPSR flags aren't updated by the
  46. * instruction. It's just a little slower in return for saving
  47. * a little space by not having a duplicate function that doesn't
  48. * update the flags. (The same optimization can be said for
  49. * instructions that do or don't perform register writeback)
  50. * Also, instructions can either read the flags, only write the
  51. * flags, or read and write the flags. To save combinations
  52. * rather than for sheer performance, flag functions just assume
  53. * read and write of flags.
  54. */
  55. void __kprobes simulate_bbl(probes_opcode_t insn,
  56. struct arch_probes_insn *asi, struct pt_regs *regs)
  57. {
  58. long iaddr = (long) regs->ARM_pc - 4;
  59. int disp = branch_displacement(insn);
  60. if (insn & (1 << 24))
  61. regs->ARM_lr = iaddr + 4;
  62. regs->ARM_pc = iaddr + 8 + disp;
  63. }
  64. void __kprobes simulate_blx1(probes_opcode_t insn,
  65. struct arch_probes_insn *asi, struct pt_regs *regs)
  66. {
  67. long iaddr = (long) regs->ARM_pc - 4;
  68. int disp = branch_displacement(insn);
  69. regs->ARM_lr = iaddr + 4;
  70. regs->ARM_pc = iaddr + 8 + disp + ((insn >> 23) & 0x2);
  71. regs->ARM_cpsr |= PSR_T_BIT;
  72. }
  73. void __kprobes simulate_blx2bx(probes_opcode_t insn,
  74. struct arch_probes_insn *asi, struct pt_regs *regs)
  75. {
  76. int rm = insn & 0xf;
  77. long rmv = regs->uregs[rm];
  78. if (insn & (1 << 5))
  79. regs->ARM_lr = (long) regs->ARM_pc;
  80. regs->ARM_pc = rmv & ~0x1;
  81. regs->ARM_cpsr &= ~PSR_T_BIT;
  82. if (rmv & 0x1)
  83. regs->ARM_cpsr |= PSR_T_BIT;
  84. }
  85. void __kprobes simulate_mrs(probes_opcode_t insn,
  86. struct arch_probes_insn *asi, struct pt_regs *regs)
  87. {
  88. int rd = (insn >> 12) & 0xf;
  89. unsigned long mask = 0xf8ff03df; /* Mask out execution state */
  90. regs->uregs[rd] = regs->ARM_cpsr & mask;
  91. }
  92. void __kprobes simulate_mov_ipsp(probes_opcode_t insn,
  93. struct arch_probes_insn *asi, struct pt_regs *regs)
  94. {
  95. regs->uregs[12] = regs->uregs[13];
  96. }
  97. /*
  98. * For the instruction masking and comparisons in all the "space_*"
  99. * functions below, Do _not_ rearrange the order of tests unless
  100. * you're very, very sure of what you are doing. For the sake of
  101. * efficiency, the masks for some tests sometimes assume other test
  102. * have been done prior to them so the number of patterns to test
  103. * for an instruction set can be as broad as possible to reduce the
  104. * number of tests needed.
  105. */
  106. static const union decode_item arm_1111_table[] = {
  107. /* Unconditional instructions */
  108. /* memory hint 1111 0100 x001 xxxx xxxx xxxx xxxx xxxx */
  109. /* PLDI (immediate) 1111 0100 x101 xxxx xxxx xxxx xxxx xxxx */
  110. /* PLDW (immediate) 1111 0101 x001 xxxx xxxx xxxx xxxx xxxx */
  111. /* PLD (immediate) 1111 0101 x101 xxxx xxxx xxxx xxxx xxxx */
  112. DECODE_SIMULATE (0xfe300000, 0xf4100000, PROBES_PRELOAD_IMM),
  113. /* memory hint 1111 0110 x001 xxxx xxxx xxxx xxx0 xxxx */
  114. /* PLDI (register) 1111 0110 x101 xxxx xxxx xxxx xxx0 xxxx */
  115. /* PLDW (register) 1111 0111 x001 xxxx xxxx xxxx xxx0 xxxx */
  116. /* PLD (register) 1111 0111 x101 xxxx xxxx xxxx xxx0 xxxx */
  117. DECODE_SIMULATE (0xfe300010, 0xf6100000, PROBES_PRELOAD_REG),
  118. /* BLX (immediate) 1111 101x xxxx xxxx xxxx xxxx xxxx xxxx */
  119. DECODE_SIMULATE (0xfe000000, 0xfa000000, PROBES_BRANCH_IMM),
  120. /* CPS 1111 0001 0000 xxx0 xxxx xxxx xx0x xxxx */
  121. /* SETEND 1111 0001 0000 0001 xxxx xxxx 0000 xxxx */
  122. /* SRS 1111 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
  123. /* RFE 1111 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
  124. /* Coprocessor instructions... */
  125. /* MCRR2 1111 1100 0100 xxxx xxxx xxxx xxxx xxxx */
  126. /* MRRC2 1111 1100 0101 xxxx xxxx xxxx xxxx xxxx */
  127. /* LDC2 1111 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
  128. /* STC2 1111 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
  129. /* CDP2 1111 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
  130. /* MCR2 1111 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
  131. /* MRC2 1111 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
  132. /* Other unallocated instructions... */
  133. DECODE_END
  134. };
  135. static const union decode_item arm_cccc_0001_0xx0____0xxx_table[] = {
  136. /* Miscellaneous instructions */
  137. /* MRS cpsr cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */
  138. DECODE_SIMULATEX(0x0ff000f0, 0x01000000, PROBES_MRS,
  139. REGS(0, NOPC, 0, 0, 0)),
  140. /* BX cccc 0001 0010 xxxx xxxx xxxx 0001 xxxx */
  141. DECODE_SIMULATE (0x0ff000f0, 0x01200010, PROBES_BRANCH_REG),
  142. /* BLX (register) cccc 0001 0010 xxxx xxxx xxxx 0011 xxxx */
  143. DECODE_SIMULATEX(0x0ff000f0, 0x01200030, PROBES_BRANCH_REG,
  144. REGS(0, 0, 0, 0, NOPC)),
  145. /* CLZ cccc 0001 0110 xxxx xxxx xxxx 0001 xxxx */
  146. DECODE_EMULATEX (0x0ff000f0, 0x01600010, PROBES_CLZ,
  147. REGS(0, NOPC, 0, 0, NOPC)),
  148. /* QADD cccc 0001 0000 xxxx xxxx xxxx 0101 xxxx */
  149. /* QSUB cccc 0001 0010 xxxx xxxx xxxx 0101 xxxx */
  150. /* QDADD cccc 0001 0100 xxxx xxxx xxxx 0101 xxxx */
  151. /* QDSUB cccc 0001 0110 xxxx xxxx xxxx 0101 xxxx */
  152. DECODE_EMULATEX (0x0f9000f0, 0x01000050, PROBES_SATURATING_ARITHMETIC,
  153. REGS(NOPC, NOPC, 0, 0, NOPC)),
  154. /* BXJ cccc 0001 0010 xxxx xxxx xxxx 0010 xxxx */
  155. /* MSR cccc 0001 0x10 xxxx xxxx xxxx 0000 xxxx */
  156. /* MRS spsr cccc 0001 0100 xxxx xxxx xxxx 0000 xxxx */
  157. /* BKPT 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
  158. /* SMC cccc 0001 0110 xxxx xxxx xxxx 0111 xxxx */
  159. /* And unallocated instructions... */
  160. DECODE_END
  161. };
  162. static const union decode_item arm_cccc_0001_0xx0____1xx0_table[] = {
  163. /* Halfword multiply and multiply-accumulate */
  164. /* SMLALxy cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */
  165. DECODE_EMULATEX (0x0ff00090, 0x01400080, PROBES_MUL1,
  166. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  167. /* SMULWy cccc 0001 0010 xxxx xxxx xxxx 1x10 xxxx */
  168. DECODE_OR (0x0ff000b0, 0x012000a0),
  169. /* SMULxy cccc 0001 0110 xxxx xxxx xxxx 1xx0 xxxx */
  170. DECODE_EMULATEX (0x0ff00090, 0x01600080, PROBES_MUL2,
  171. REGS(NOPC, 0, NOPC, 0, NOPC)),
  172. /* SMLAxy cccc 0001 0000 xxxx xxxx xxxx 1xx0 xxxx */
  173. DECODE_OR (0x0ff00090, 0x01000080),
  174. /* SMLAWy cccc 0001 0010 xxxx xxxx xxxx 1x00 xxxx */
  175. DECODE_EMULATEX (0x0ff000b0, 0x01200080, PROBES_MUL2,
  176. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  177. DECODE_END
  178. };
  179. static const union decode_item arm_cccc_0000_____1001_table[] = {
  180. /* Multiply and multiply-accumulate */
  181. /* MUL cccc 0000 0000 xxxx xxxx xxxx 1001 xxxx */
  182. /* MULS cccc 0000 0001 xxxx xxxx xxxx 1001 xxxx */
  183. DECODE_EMULATEX (0x0fe000f0, 0x00000090, PROBES_MUL2,
  184. REGS(NOPC, 0, NOPC, 0, NOPC)),
  185. /* MLA cccc 0000 0010 xxxx xxxx xxxx 1001 xxxx */
  186. /* MLAS cccc 0000 0011 xxxx xxxx xxxx 1001 xxxx */
  187. DECODE_OR (0x0fe000f0, 0x00200090),
  188. /* MLS cccc 0000 0110 xxxx xxxx xxxx 1001 xxxx */
  189. DECODE_EMULATEX (0x0ff000f0, 0x00600090, PROBES_MUL2,
  190. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  191. /* UMAAL cccc 0000 0100 xxxx xxxx xxxx 1001 xxxx */
  192. DECODE_OR (0x0ff000f0, 0x00400090),
  193. /* UMULL cccc 0000 1000 xxxx xxxx xxxx 1001 xxxx */
  194. /* UMULLS cccc 0000 1001 xxxx xxxx xxxx 1001 xxxx */
  195. /* UMLAL cccc 0000 1010 xxxx xxxx xxxx 1001 xxxx */
  196. /* UMLALS cccc 0000 1011 xxxx xxxx xxxx 1001 xxxx */
  197. /* SMULL cccc 0000 1100 xxxx xxxx xxxx 1001 xxxx */
  198. /* SMULLS cccc 0000 1101 xxxx xxxx xxxx 1001 xxxx */
  199. /* SMLAL cccc 0000 1110 xxxx xxxx xxxx 1001 xxxx */
  200. /* SMLALS cccc 0000 1111 xxxx xxxx xxxx 1001 xxxx */
  201. DECODE_EMULATEX (0x0f8000f0, 0x00800090, PROBES_MUL1,
  202. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  203. DECODE_END
  204. };
  205. static const union decode_item arm_cccc_0001_____1001_table[] = {
  206. /* Synchronization primitives */
  207. #if __LINUX_ARM_ARCH__ < 6
  208. /* Deprecated on ARMv6 and may be UNDEFINED on v7 */
  209. /* SMP/SWPB cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */
  210. DECODE_EMULATEX (0x0fb000f0, 0x01000090, PROBES_SWP,
  211. REGS(NOPC, NOPC, 0, 0, NOPC)),
  212. #endif
  213. /* LDREX/STREX{,D,B,H} cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */
  214. /* And unallocated instructions... */
  215. DECODE_END
  216. };
  217. static const union decode_item arm_cccc_000x_____1xx1_table[] = {
  218. /* Extra load/store instructions */
  219. /* STRHT cccc 0000 xx10 xxxx xxxx xxxx 1011 xxxx */
  220. /* ??? cccc 0000 xx10 xxxx xxxx xxxx 11x1 xxxx */
  221. /* LDRHT cccc 0000 xx11 xxxx xxxx xxxx 1011 xxxx */
  222. /* LDRSBT cccc 0000 xx11 xxxx xxxx xxxx 1101 xxxx */
  223. /* LDRSHT cccc 0000 xx11 xxxx xxxx xxxx 1111 xxxx */
  224. DECODE_REJECT (0x0f200090, 0x00200090),
  225. /* LDRD/STRD lr,pc,{... cccc 000x x0x0 xxxx 111x xxxx 1101 xxxx */
  226. DECODE_REJECT (0x0e10e0d0, 0x0000e0d0),
  227. /* LDRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1101 xxxx */
  228. /* STRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1111 xxxx */
  229. DECODE_EMULATEX (0x0e5000d0, 0x000000d0, PROBES_LDRSTRD,
  230. REGS(NOPCWB, NOPCX, 0, 0, NOPC)),
  231. /* LDRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1101 xxxx */
  232. /* STRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1111 xxxx */
  233. DECODE_EMULATEX (0x0e5000d0, 0x004000d0, PROBES_LDRSTRD,
  234. REGS(NOPCWB, NOPCX, 0, 0, 0)),
  235. /* STRH (register) cccc 000x x0x0 xxxx xxxx xxxx 1011 xxxx */
  236. DECODE_EMULATEX (0x0e5000f0, 0x000000b0, PROBES_STORE_EXTRA,
  237. REGS(NOPCWB, NOPC, 0, 0, NOPC)),
  238. /* LDRH (register) cccc 000x x0x1 xxxx xxxx xxxx 1011 xxxx */
  239. /* LDRSB (register) cccc 000x x0x1 xxxx xxxx xxxx 1101 xxxx */
  240. /* LDRSH (register) cccc 000x x0x1 xxxx xxxx xxxx 1111 xxxx */
  241. DECODE_EMULATEX (0x0e500090, 0x00100090, PROBES_LOAD_EXTRA,
  242. REGS(NOPCWB, NOPC, 0, 0, NOPC)),
  243. /* STRH (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1011 xxxx */
  244. DECODE_EMULATEX (0x0e5000f0, 0x004000b0, PROBES_STORE_EXTRA,
  245. REGS(NOPCWB, NOPC, 0, 0, 0)),
  246. /* LDRH (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1011 xxxx */
  247. /* LDRSB (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1101 xxxx */
  248. /* LDRSH (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1111 xxxx */
  249. DECODE_EMULATEX (0x0e500090, 0x00500090, PROBES_LOAD_EXTRA,
  250. REGS(NOPCWB, NOPC, 0, 0, 0)),
  251. DECODE_END
  252. };
  253. static const union decode_item arm_cccc_000x_table[] = {
  254. /* Data-processing (register) */
  255. /* <op>S PC, ... cccc 000x xxx1 xxxx 1111 xxxx xxxx xxxx */
  256. DECODE_REJECT (0x0e10f000, 0x0010f000),
  257. /* MOV IP, SP 1110 0001 1010 0000 1100 0000 0000 1101 */
  258. DECODE_SIMULATE (0xffffffff, 0xe1a0c00d, PROBES_MOV_IP_SP),
  259. /* TST (register) cccc 0001 0001 xxxx xxxx xxxx xxx0 xxxx */
  260. /* TEQ (register) cccc 0001 0011 xxxx xxxx xxxx xxx0 xxxx */
  261. /* CMP (register) cccc 0001 0101 xxxx xxxx xxxx xxx0 xxxx */
  262. /* CMN (register) cccc 0001 0111 xxxx xxxx xxxx xxx0 xxxx */
  263. DECODE_EMULATEX (0x0f900010, 0x01100000, PROBES_DATA_PROCESSING_REG,
  264. REGS(ANY, 0, 0, 0, ANY)),
  265. /* MOV (register) cccc 0001 101x xxxx xxxx xxxx xxx0 xxxx */
  266. /* MVN (register) cccc 0001 111x xxxx xxxx xxxx xxx0 xxxx */
  267. DECODE_EMULATEX (0x0fa00010, 0x01a00000, PROBES_DATA_PROCESSING_REG,
  268. REGS(0, ANY, 0, 0, ANY)),
  269. /* AND (register) cccc 0000 000x xxxx xxxx xxxx xxx0 xxxx */
  270. /* EOR (register) cccc 0000 001x xxxx xxxx xxxx xxx0 xxxx */
  271. /* SUB (register) cccc 0000 010x xxxx xxxx xxxx xxx0 xxxx */
  272. /* RSB (register) cccc 0000 011x xxxx xxxx xxxx xxx0 xxxx */
  273. /* ADD (register) cccc 0000 100x xxxx xxxx xxxx xxx0 xxxx */
  274. /* ADC (register) cccc 0000 101x xxxx xxxx xxxx xxx0 xxxx */
  275. /* SBC (register) cccc 0000 110x xxxx xxxx xxxx xxx0 xxxx */
  276. /* RSC (register) cccc 0000 111x xxxx xxxx xxxx xxx0 xxxx */
  277. /* ORR (register) cccc 0001 100x xxxx xxxx xxxx xxx0 xxxx */
  278. /* BIC (register) cccc 0001 110x xxxx xxxx xxxx xxx0 xxxx */
  279. DECODE_EMULATEX (0x0e000010, 0x00000000, PROBES_DATA_PROCESSING_REG,
  280. REGS(ANY, ANY, 0, 0, ANY)),
  281. /* TST (reg-shift reg) cccc 0001 0001 xxxx xxxx xxxx 0xx1 xxxx */
  282. /* TEQ (reg-shift reg) cccc 0001 0011 xxxx xxxx xxxx 0xx1 xxxx */
  283. /* CMP (reg-shift reg) cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */
  284. /* CMN (reg-shift reg) cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */
  285. DECODE_EMULATEX (0x0f900090, 0x01100010, PROBES_DATA_PROCESSING_REG,
  286. REGS(NOPC, 0, NOPC, 0, NOPC)),
  287. /* MOV (reg-shift reg) cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */
  288. /* MVN (reg-shift reg) cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */
  289. DECODE_EMULATEX (0x0fa00090, 0x01a00010, PROBES_DATA_PROCESSING_REG,
  290. REGS(0, NOPC, NOPC, 0, NOPC)),
  291. /* AND (reg-shift reg) cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */
  292. /* EOR (reg-shift reg) cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */
  293. /* SUB (reg-shift reg) cccc 0000 010x xxxx xxxx xxxx 0xx1 xxxx */
  294. /* RSB (reg-shift reg) cccc 0000 011x xxxx xxxx xxxx 0xx1 xxxx */
  295. /* ADD (reg-shift reg) cccc 0000 100x xxxx xxxx xxxx 0xx1 xxxx */
  296. /* ADC (reg-shift reg) cccc 0000 101x xxxx xxxx xxxx 0xx1 xxxx */
  297. /* SBC (reg-shift reg) cccc 0000 110x xxxx xxxx xxxx 0xx1 xxxx */
  298. /* RSC (reg-shift reg) cccc 0000 111x xxxx xxxx xxxx 0xx1 xxxx */
  299. /* ORR (reg-shift reg) cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */
  300. /* BIC (reg-shift reg) cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */
  301. DECODE_EMULATEX (0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG,
  302. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  303. DECODE_END
  304. };
  305. static const union decode_item arm_cccc_001x_table[] = {
  306. /* Data-processing (immediate) */
  307. /* MOVW cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
  308. /* MOVT cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
  309. DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_MOV_HALFWORD,
  310. REGS(0, NOPC, 0, 0, 0)),
  311. /* YIELD cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
  312. DECODE_OR (0x0fff00ff, 0x03200001),
  313. /* SEV cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
  314. DECODE_EMULATE (0x0fff00ff, 0x03200004, PROBES_SEV),
  315. /* NOP cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
  316. /* WFE cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
  317. /* WFI cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
  318. DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_WFE),
  319. /* DBG cccc 0011 0010 0000 xxxx xxxx ffff xxxx */
  320. /* unallocated hints cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
  321. /* MSR (immediate) cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */
  322. DECODE_REJECT (0x0fb00000, 0x03200000),
  323. /* <op>S PC, ... cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx */
  324. DECODE_REJECT (0x0e10f000, 0x0210f000),
  325. /* TST (immediate) cccc 0011 0001 xxxx xxxx xxxx xxxx xxxx */
  326. /* TEQ (immediate) cccc 0011 0011 xxxx xxxx xxxx xxxx xxxx */
  327. /* CMP (immediate) cccc 0011 0101 xxxx xxxx xxxx xxxx xxxx */
  328. /* CMN (immediate) cccc 0011 0111 xxxx xxxx xxxx xxxx xxxx */
  329. DECODE_EMULATEX (0x0f900000, 0x03100000, PROBES_DATA_PROCESSING_IMM,
  330. REGS(ANY, 0, 0, 0, 0)),
  331. /* MOV (immediate) cccc 0011 101x xxxx xxxx xxxx xxxx xxxx */
  332. /* MVN (immediate) cccc 0011 111x xxxx xxxx xxxx xxxx xxxx */
  333. DECODE_EMULATEX (0x0fa00000, 0x03a00000, PROBES_DATA_PROCESSING_IMM,
  334. REGS(0, ANY, 0, 0, 0)),
  335. /* AND (immediate) cccc 0010 000x xxxx xxxx xxxx xxxx xxxx */
  336. /* EOR (immediate) cccc 0010 001x xxxx xxxx xxxx xxxx xxxx */
  337. /* SUB (immediate) cccc 0010 010x xxxx xxxx xxxx xxxx xxxx */
  338. /* RSB (immediate) cccc 0010 011x xxxx xxxx xxxx xxxx xxxx */
  339. /* ADD (immediate) cccc 0010 100x xxxx xxxx xxxx xxxx xxxx */
  340. /* ADC (immediate) cccc 0010 101x xxxx xxxx xxxx xxxx xxxx */
  341. /* SBC (immediate) cccc 0010 110x xxxx xxxx xxxx xxxx xxxx */
  342. /* RSC (immediate) cccc 0010 111x xxxx xxxx xxxx xxxx xxxx */
  343. /* ORR (immediate) cccc 0011 100x xxxx xxxx xxxx xxxx xxxx */
  344. /* BIC (immediate) cccc 0011 110x xxxx xxxx xxxx xxxx xxxx */
  345. DECODE_EMULATEX (0x0e000000, 0x02000000, PROBES_DATA_PROCESSING_IMM,
  346. REGS(ANY, ANY, 0, 0, 0)),
  347. DECODE_END
  348. };
  349. static const union decode_item arm_cccc_0110_____xxx1_table[] = {
  350. /* Media instructions */
  351. /* SEL cccc 0110 1000 xxxx xxxx xxxx 1011 xxxx */
  352. DECODE_EMULATEX (0x0ff000f0, 0x068000b0, PROBES_SATURATE,
  353. REGS(NOPC, NOPC, 0, 0, NOPC)),
  354. /* SSAT cccc 0110 101x xxxx xxxx xxxx xx01 xxxx */
  355. /* USAT cccc 0110 111x xxxx xxxx xxxx xx01 xxxx */
  356. DECODE_OR(0x0fa00030, 0x06a00010),
  357. /* SSAT16 cccc 0110 1010 xxxx xxxx xxxx 0011 xxxx */
  358. /* USAT16 cccc 0110 1110 xxxx xxxx xxxx 0011 xxxx */
  359. DECODE_EMULATEX (0x0fb000f0, 0x06a00030, PROBES_SATURATE,
  360. REGS(0, NOPC, 0, 0, NOPC)),
  361. /* REV cccc 0110 1011 xxxx xxxx xxxx 0011 xxxx */
  362. /* REV16 cccc 0110 1011 xxxx xxxx xxxx 1011 xxxx */
  363. /* RBIT cccc 0110 1111 xxxx xxxx xxxx 0011 xxxx */
  364. /* REVSH cccc 0110 1111 xxxx xxxx xxxx 1011 xxxx */
  365. DECODE_EMULATEX (0x0fb00070, 0x06b00030, PROBES_REV,
  366. REGS(0, NOPC, 0, 0, NOPC)),
  367. /* ??? cccc 0110 0x00 xxxx xxxx xxxx xxx1 xxxx */
  368. DECODE_REJECT (0x0fb00010, 0x06000010),
  369. /* ??? cccc 0110 0xxx xxxx xxxx xxxx 1011 xxxx */
  370. DECODE_REJECT (0x0f8000f0, 0x060000b0),
  371. /* ??? cccc 0110 0xxx xxxx xxxx xxxx 1101 xxxx */
  372. DECODE_REJECT (0x0f8000f0, 0x060000d0),
  373. /* SADD16 cccc 0110 0001 xxxx xxxx xxxx 0001 xxxx */
  374. /* SADDSUBX cccc 0110 0001 xxxx xxxx xxxx 0011 xxxx */
  375. /* SSUBADDX cccc 0110 0001 xxxx xxxx xxxx 0101 xxxx */
  376. /* SSUB16 cccc 0110 0001 xxxx xxxx xxxx 0111 xxxx */
  377. /* SADD8 cccc 0110 0001 xxxx xxxx xxxx 1001 xxxx */
  378. /* SSUB8 cccc 0110 0001 xxxx xxxx xxxx 1111 xxxx */
  379. /* QADD16 cccc 0110 0010 xxxx xxxx xxxx 0001 xxxx */
  380. /* QADDSUBX cccc 0110 0010 xxxx xxxx xxxx 0011 xxxx */
  381. /* QSUBADDX cccc 0110 0010 xxxx xxxx xxxx 0101 xxxx */
  382. /* QSUB16 cccc 0110 0010 xxxx xxxx xxxx 0111 xxxx */
  383. /* QADD8 cccc 0110 0010 xxxx xxxx xxxx 1001 xxxx */
  384. /* QSUB8 cccc 0110 0010 xxxx xxxx xxxx 1111 xxxx */
  385. /* SHADD16 cccc 0110 0011 xxxx xxxx xxxx 0001 xxxx */
  386. /* SHADDSUBX cccc 0110 0011 xxxx xxxx xxxx 0011 xxxx */
  387. /* SHSUBADDX cccc 0110 0011 xxxx xxxx xxxx 0101 xxxx */
  388. /* SHSUB16 cccc 0110 0011 xxxx xxxx xxxx 0111 xxxx */
  389. /* SHADD8 cccc 0110 0011 xxxx xxxx xxxx 1001 xxxx */
  390. /* SHSUB8 cccc 0110 0011 xxxx xxxx xxxx 1111 xxxx */
  391. /* UADD16 cccc 0110 0101 xxxx xxxx xxxx 0001 xxxx */
  392. /* UADDSUBX cccc 0110 0101 xxxx xxxx xxxx 0011 xxxx */
  393. /* USUBADDX cccc 0110 0101 xxxx xxxx xxxx 0101 xxxx */
  394. /* USUB16 cccc 0110 0101 xxxx xxxx xxxx 0111 xxxx */
  395. /* UADD8 cccc 0110 0101 xxxx xxxx xxxx 1001 xxxx */
  396. /* USUB8 cccc 0110 0101 xxxx xxxx xxxx 1111 xxxx */
  397. /* UQADD16 cccc 0110 0110 xxxx xxxx xxxx 0001 xxxx */
  398. /* UQADDSUBX cccc 0110 0110 xxxx xxxx xxxx 0011 xxxx */
  399. /* UQSUBADDX cccc 0110 0110 xxxx xxxx xxxx 0101 xxxx */
  400. /* UQSUB16 cccc 0110 0110 xxxx xxxx xxxx 0111 xxxx */
  401. /* UQADD8 cccc 0110 0110 xxxx xxxx xxxx 1001 xxxx */
  402. /* UQSUB8 cccc 0110 0110 xxxx xxxx xxxx 1111 xxxx */
  403. /* UHADD16 cccc 0110 0111 xxxx xxxx xxxx 0001 xxxx */
  404. /* UHADDSUBX cccc 0110 0111 xxxx xxxx xxxx 0011 xxxx */
  405. /* UHSUBADDX cccc 0110 0111 xxxx xxxx xxxx 0101 xxxx */
  406. /* UHSUB16 cccc 0110 0111 xxxx xxxx xxxx 0111 xxxx */
  407. /* UHADD8 cccc 0110 0111 xxxx xxxx xxxx 1001 xxxx */
  408. /* UHSUB8 cccc 0110 0111 xxxx xxxx xxxx 1111 xxxx */
  409. DECODE_EMULATEX (0x0f800010, 0x06000010, PROBES_MMI,
  410. REGS(NOPC, NOPC, 0, 0, NOPC)),
  411. /* PKHBT cccc 0110 1000 xxxx xxxx xxxx x001 xxxx */
  412. /* PKHTB cccc 0110 1000 xxxx xxxx xxxx x101 xxxx */
  413. DECODE_EMULATEX (0x0ff00030, 0x06800010, PROBES_PACK,
  414. REGS(NOPC, NOPC, 0, 0, NOPC)),
  415. /* ??? cccc 0110 1001 xxxx xxxx xxxx 0111 xxxx */
  416. /* ??? cccc 0110 1101 xxxx xxxx xxxx 0111 xxxx */
  417. DECODE_REJECT (0x0fb000f0, 0x06900070),
  418. /* SXTB16 cccc 0110 1000 1111 xxxx xxxx 0111 xxxx */
  419. /* SXTB cccc 0110 1010 1111 xxxx xxxx 0111 xxxx */
  420. /* SXTH cccc 0110 1011 1111 xxxx xxxx 0111 xxxx */
  421. /* UXTB16 cccc 0110 1100 1111 xxxx xxxx 0111 xxxx */
  422. /* UXTB cccc 0110 1110 1111 xxxx xxxx 0111 xxxx */
  423. /* UXTH cccc 0110 1111 1111 xxxx xxxx 0111 xxxx */
  424. DECODE_EMULATEX (0x0f8f00f0, 0x068f0070, PROBES_EXTEND,
  425. REGS(0, NOPC, 0, 0, NOPC)),
  426. /* SXTAB16 cccc 0110 1000 xxxx xxxx xxxx 0111 xxxx */
  427. /* SXTAB cccc 0110 1010 xxxx xxxx xxxx 0111 xxxx */
  428. /* SXTAH cccc 0110 1011 xxxx xxxx xxxx 0111 xxxx */
  429. /* UXTAB16 cccc 0110 1100 xxxx xxxx xxxx 0111 xxxx */
  430. /* UXTAB cccc 0110 1110 xxxx xxxx xxxx 0111 xxxx */
  431. /* UXTAH cccc 0110 1111 xxxx xxxx xxxx 0111 xxxx */
  432. DECODE_EMULATEX (0x0f8000f0, 0x06800070, PROBES_EXTEND_ADD,
  433. REGS(NOPCX, NOPC, 0, 0, NOPC)),
  434. DECODE_END
  435. };
  436. static const union decode_item arm_cccc_0111_____xxx1_table[] = {
  437. /* Media instructions */
  438. /* UNDEFINED cccc 0111 1111 xxxx xxxx xxxx 1111 xxxx */
  439. DECODE_REJECT (0x0ff000f0, 0x07f000f0),
  440. /* SMLALD cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */
  441. /* SMLSLD cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */
  442. DECODE_EMULATEX (0x0ff00090, 0x07400010, PROBES_MUL_ADD_LONG,
  443. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  444. /* SMUAD cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx */
  445. /* SMUSD cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx */
  446. DECODE_OR (0x0ff0f090, 0x0700f010),
  447. /* SMMUL cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx */
  448. DECODE_OR (0x0ff0f0d0, 0x0750f010),
  449. /* USAD8 cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx */
  450. DECODE_EMULATEX (0x0ff0f0f0, 0x0780f010, PROBES_MUL_ADD,
  451. REGS(NOPC, 0, NOPC, 0, NOPC)),
  452. /* SMLAD cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx */
  453. /* SMLSD cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx */
  454. DECODE_OR (0x0ff00090, 0x07000010),
  455. /* SMMLA cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx */
  456. DECODE_OR (0x0ff000d0, 0x07500010),
  457. /* USADA8 cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx */
  458. DECODE_EMULATEX (0x0ff000f0, 0x07800010, PROBES_MUL_ADD,
  459. REGS(NOPC, NOPCX, NOPC, 0, NOPC)),
  460. /* SMMLS cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx */
  461. DECODE_EMULATEX (0x0ff000d0, 0x075000d0, PROBES_MUL_ADD,
  462. REGS(NOPC, NOPC, NOPC, 0, NOPC)),
  463. /* SBFX cccc 0111 101x xxxx xxxx xxxx x101 xxxx */
  464. /* UBFX cccc 0111 111x xxxx xxxx xxxx x101 xxxx */
  465. DECODE_EMULATEX (0x0fa00070, 0x07a00050, PROBES_BITFIELD,
  466. REGS(0, NOPC, 0, 0, NOPC)),
  467. /* BFC cccc 0111 110x xxxx xxxx xxxx x001 1111 */
  468. DECODE_EMULATEX (0x0fe0007f, 0x07c0001f, PROBES_BITFIELD,
  469. REGS(0, NOPC, 0, 0, 0)),
  470. /* BFI cccc 0111 110x xxxx xxxx xxxx x001 xxxx */
  471. DECODE_EMULATEX (0x0fe00070, 0x07c00010, PROBES_BITFIELD,
  472. REGS(0, NOPC, 0, 0, NOPCX)),
  473. DECODE_END
  474. };
  475. static const union decode_item arm_cccc_01xx_table[] = {
  476. /* Load/store word and unsigned byte */
  477. /* LDRB/STRB pc,[...] cccc 01xx x0xx xxxx xxxx xxxx xxxx xxxx */
  478. DECODE_REJECT (0x0c40f000, 0x0440f000),
  479. /* STRT cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */
  480. /* LDRT cccc 01x0 x011 xxxx xxxx xxxx xxxx xxxx */
  481. /* STRBT cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */
  482. /* LDRBT cccc 01x0 x111 xxxx xxxx xxxx xxxx xxxx */
  483. DECODE_REJECT (0x0d200000, 0x04200000),
  484. /* STR (immediate) cccc 010x x0x0 xxxx xxxx xxxx xxxx xxxx */
  485. /* STRB (immediate) cccc 010x x1x0 xxxx xxxx xxxx xxxx xxxx */
  486. DECODE_EMULATEX (0x0e100000, 0x04000000, PROBES_STORE,
  487. REGS(NOPCWB, ANY, 0, 0, 0)),
  488. /* LDR (immediate) cccc 010x x0x1 xxxx xxxx xxxx xxxx xxxx */
  489. /* LDRB (immediate) cccc 010x x1x1 xxxx xxxx xxxx xxxx xxxx */
  490. DECODE_EMULATEX (0x0e100000, 0x04100000, PROBES_LOAD,
  491. REGS(NOPCWB, ANY, 0, 0, 0)),
  492. /* STR (register) cccc 011x x0x0 xxxx xxxx xxxx xxxx xxxx */
  493. /* STRB (register) cccc 011x x1x0 xxxx xxxx xxxx xxxx xxxx */
  494. DECODE_EMULATEX (0x0e100000, 0x06000000, PROBES_STORE,
  495. REGS(NOPCWB, ANY, 0, 0, NOPC)),
  496. /* LDR (register) cccc 011x x0x1 xxxx xxxx xxxx xxxx xxxx */
  497. /* LDRB (register) cccc 011x x1x1 xxxx xxxx xxxx xxxx xxxx */
  498. DECODE_EMULATEX (0x0e100000, 0x06100000, PROBES_LOAD,
  499. REGS(NOPCWB, ANY, 0, 0, NOPC)),
  500. DECODE_END
  501. };
  502. static const union decode_item arm_cccc_100x_table[] = {
  503. /* Block data transfer instructions */
  504. /* LDM cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
  505. /* STM cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */
  506. DECODE_CUSTOM (0x0e400000, 0x08000000, PROBES_LDMSTM),
  507. /* STM (user registers) cccc 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
  508. /* LDM (user registers) cccc 100x x1x1 xxxx 0xxx xxxx xxxx xxxx */
  509. /* LDM (exception ret) cccc 100x x1x1 xxxx 1xxx xxxx xxxx xxxx */
  510. DECODE_END
  511. };
  512. const union decode_item probes_decode_arm_table[] = {
  513. /*
  514. * Unconditional instructions
  515. * 1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
  516. */
  517. DECODE_TABLE (0xf0000000, 0xf0000000, arm_1111_table),
  518. /*
  519. * Miscellaneous instructions
  520. * cccc 0001 0xx0 xxxx xxxx xxxx 0xxx xxxx
  521. */
  522. DECODE_TABLE (0x0f900080, 0x01000000, arm_cccc_0001_0xx0____0xxx_table),
  523. /*
  524. * Halfword multiply and multiply-accumulate
  525. * cccc 0001 0xx0 xxxx xxxx xxxx 1xx0 xxxx
  526. */
  527. DECODE_TABLE (0x0f900090, 0x01000080, arm_cccc_0001_0xx0____1xx0_table),
  528. /*
  529. * Multiply and multiply-accumulate
  530. * cccc 0000 xxxx xxxx xxxx xxxx 1001 xxxx
  531. */
  532. DECODE_TABLE (0x0f0000f0, 0x00000090, arm_cccc_0000_____1001_table),
  533. /*
  534. * Synchronization primitives
  535. * cccc 0001 xxxx xxxx xxxx xxxx 1001 xxxx
  536. */
  537. DECODE_TABLE (0x0f0000f0, 0x01000090, arm_cccc_0001_____1001_table),
  538. /*
  539. * Extra load/store instructions
  540. * cccc 000x xxxx xxxx xxxx xxxx 1xx1 xxxx
  541. */
  542. DECODE_TABLE (0x0e000090, 0x00000090, arm_cccc_000x_____1xx1_table),
  543. /*
  544. * Data-processing (register)
  545. * cccc 000x xxxx xxxx xxxx xxxx xxx0 xxxx
  546. * Data-processing (register-shifted register)
  547. * cccc 000x xxxx xxxx xxxx xxxx 0xx1 xxxx
  548. */
  549. DECODE_TABLE (0x0e000000, 0x00000000, arm_cccc_000x_table),
  550. /*
  551. * Data-processing (immediate)
  552. * cccc 001x xxxx xxxx xxxx xxxx xxxx xxxx
  553. */
  554. DECODE_TABLE (0x0e000000, 0x02000000, arm_cccc_001x_table),
  555. /*
  556. * Media instructions
  557. * cccc 011x xxxx xxxx xxxx xxxx xxx1 xxxx
  558. */
  559. DECODE_TABLE (0x0f000010, 0x06000010, arm_cccc_0110_____xxx1_table),
  560. DECODE_TABLE (0x0f000010, 0x07000010, arm_cccc_0111_____xxx1_table),
  561. /*
  562. * Load/store word and unsigned byte
  563. * cccc 01xx xxxx xxxx xxxx xxxx xxxx xxxx
  564. */
  565. DECODE_TABLE (0x0c000000, 0x04000000, arm_cccc_01xx_table),
  566. /*
  567. * Block data transfer instructions
  568. * cccc 100x xxxx xxxx xxxx xxxx xxxx xxxx
  569. */
  570. DECODE_TABLE (0x0e000000, 0x08000000, arm_cccc_100x_table),
  571. /* B cccc 1010 xxxx xxxx xxxx xxxx xxxx xxxx */
  572. /* BL cccc 1011 xxxx xxxx xxxx xxxx xxxx xxxx */
  573. DECODE_SIMULATE (0x0e000000, 0x0a000000, PROBES_BRANCH),
  574. /*
  575. * Supervisor Call, and coprocessor instructions
  576. */
  577. /* MCRR cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx */
  578. /* MRRC cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx */
  579. /* LDC cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
  580. /* STC cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
  581. /* CDP cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
  582. /* MCR cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
  583. /* MRC cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
  584. /* SVC cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
  585. DECODE_REJECT (0x0c000000, 0x0c000000),
  586. DECODE_END
  587. };
  588. #ifdef CONFIG_ARM_KPROBES_TEST_MODULE
  589. EXPORT_SYMBOL_GPL(probes_decode_arm_table);
  590. #endif
  591. static void __kprobes arm_singlestep(probes_opcode_t insn,
  592. struct arch_probes_insn *asi, struct pt_regs *regs)
  593. {
  594. regs->ARM_pc += 4;
  595. asi->insn_handler(insn, asi, regs);
  596. }
  597. /* Return:
  598. * INSN_REJECTED If instruction is one not allowed to kprobe,
  599. * INSN_GOOD If instruction is supported and uses instruction slot,
  600. * INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.
  601. *
  602. * For instructions we don't want to kprobe (INSN_REJECTED return result):
  603. * These are generally ones that modify the processor state making
  604. * them "hard" to simulate such as switches processor modes or
  605. * make accesses in alternate modes. Any of these could be simulated
  606. * if the work was put into it, but low return considering they
  607. * should also be very rare.
  608. */
  609. enum probes_insn __kprobes
  610. arm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
  611. bool emulate, const union decode_action *actions,
  612. const struct decode_checker *checkers[])
  613. {
  614. asi->insn_singlestep = arm_singlestep;
  615. asi->insn_check_cc = probes_condition_checks[insn>>28];
  616. return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
  617. emulate, actions, checkers);
  618. }