armv8_deprecated.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2014 ARM Limited
  4. */
  5. #include <linux/cpu.h>
  6. #include <linux/init.h>
  7. #include <linux/list.h>
  8. #include <linux/perf_event.h>
  9. #include <linux/sched.h>
  10. #include <linux/slab.h>
  11. #include <linux/sysctl.h>
  12. #include <linux/uaccess.h>
  13. #include <asm/cpufeature.h>
  14. #include <asm/insn.h>
  15. #include <asm/sysreg.h>
  16. #include <asm/system_misc.h>
  17. #include <asm/traps.h>
  18. #include <asm/kprobes.h>
  19. #define CREATE_TRACE_POINTS
  20. #include "trace-events-emulation.h"
  21. /*
  22. * The runtime support for deprecated instruction support can be in one of
  23. * following three states -
  24. *
  25. * 0 = undef
  26. * 1 = emulate (software emulation)
  27. * 2 = hw (supported in hardware)
  28. */
  29. enum insn_emulation_mode {
  30. INSN_UNDEF,
  31. INSN_EMULATE,
  32. INSN_HW,
  33. };
  34. enum legacy_insn_status {
  35. INSN_DEPRECATED,
  36. INSN_OBSOLETE,
  37. };
  38. struct insn_emulation_ops {
  39. const char *name;
  40. enum legacy_insn_status status;
  41. struct undef_hook *hooks;
  42. int (*set_hw_mode)(bool enable);
  43. };
  44. struct insn_emulation {
  45. struct list_head node;
  46. struct insn_emulation_ops *ops;
  47. int current_mode;
  48. int min;
  49. int max;
  50. };
  51. static LIST_HEAD(insn_emulation);
  52. static int nr_insn_emulated __initdata;
  53. static DEFINE_RAW_SPINLOCK(insn_emulation_lock);
  54. static DEFINE_MUTEX(insn_emulation_mutex);
  55. static void register_emulation_hooks(struct insn_emulation_ops *ops)
  56. {
  57. struct undef_hook *hook;
  58. BUG_ON(!ops->hooks);
  59. for (hook = ops->hooks; hook->instr_mask; hook++)
  60. register_undef_hook(hook);
  61. pr_notice("Registered %s emulation handler\n", ops->name);
  62. }
  63. static void remove_emulation_hooks(struct insn_emulation_ops *ops)
  64. {
  65. struct undef_hook *hook;
  66. BUG_ON(!ops->hooks);
  67. for (hook = ops->hooks; hook->instr_mask; hook++)
  68. unregister_undef_hook(hook);
  69. pr_notice("Removed %s emulation handler\n", ops->name);
  70. }
  71. static void enable_insn_hw_mode(void *data)
  72. {
  73. struct insn_emulation *insn = (struct insn_emulation *)data;
  74. if (insn->ops->set_hw_mode)
  75. insn->ops->set_hw_mode(true);
  76. }
  77. static void disable_insn_hw_mode(void *data)
  78. {
  79. struct insn_emulation *insn = (struct insn_emulation *)data;
  80. if (insn->ops->set_hw_mode)
  81. insn->ops->set_hw_mode(false);
  82. }
  83. /* Run set_hw_mode(mode) on all active CPUs */
  84. static int run_all_cpu_set_hw_mode(struct insn_emulation *insn, bool enable)
  85. {
  86. if (!insn->ops->set_hw_mode)
  87. return -EINVAL;
  88. if (enable)
  89. on_each_cpu(enable_insn_hw_mode, (void *)insn, true);
  90. else
  91. on_each_cpu(disable_insn_hw_mode, (void *)insn, true);
  92. return 0;
  93. }
  94. /*
  95. * Run set_hw_mode for all insns on a starting CPU.
  96. * Returns:
  97. * 0 - If all the hooks ran successfully.
  98. * -EINVAL - At least one hook is not supported by the CPU.
  99. */
  100. static int run_all_insn_set_hw_mode(unsigned int cpu)
  101. {
  102. int rc = 0;
  103. unsigned long flags;
  104. struct insn_emulation *insn;
  105. raw_spin_lock_irqsave(&insn_emulation_lock, flags);
  106. list_for_each_entry(insn, &insn_emulation, node) {
  107. bool enable = (insn->current_mode == INSN_HW);
  108. if (insn->ops->set_hw_mode && insn->ops->set_hw_mode(enable)) {
  109. pr_warn("CPU[%u] cannot support the emulation of %s",
  110. cpu, insn->ops->name);
  111. rc = -EINVAL;
  112. }
  113. }
  114. raw_spin_unlock_irqrestore(&insn_emulation_lock, flags);
  115. return rc;
  116. }
  117. static int update_insn_emulation_mode(struct insn_emulation *insn,
  118. enum insn_emulation_mode prev)
  119. {
  120. int ret = 0;
  121. switch (prev) {
  122. case INSN_UNDEF: /* Nothing to be done */
  123. break;
  124. case INSN_EMULATE:
  125. remove_emulation_hooks(insn->ops);
  126. break;
  127. case INSN_HW:
  128. if (!run_all_cpu_set_hw_mode(insn, false))
  129. pr_notice("Disabled %s support\n", insn->ops->name);
  130. break;
  131. }
  132. switch (insn->current_mode) {
  133. case INSN_UNDEF:
  134. break;
  135. case INSN_EMULATE:
  136. register_emulation_hooks(insn->ops);
  137. break;
  138. case INSN_HW:
  139. ret = run_all_cpu_set_hw_mode(insn, true);
  140. if (!ret)
  141. pr_notice("Enabled %s support\n", insn->ops->name);
  142. break;
  143. }
  144. return ret;
  145. }
  146. static void __init register_insn_emulation(struct insn_emulation_ops *ops)
  147. {
  148. unsigned long flags;
  149. struct insn_emulation *insn;
  150. insn = kzalloc(sizeof(*insn), GFP_KERNEL);
  151. if (!insn)
  152. return;
  153. insn->ops = ops;
  154. insn->min = INSN_UNDEF;
  155. switch (ops->status) {
  156. case INSN_DEPRECATED:
  157. insn->current_mode = INSN_EMULATE;
  158. /* Disable the HW mode if it was turned on at early boot time */
  159. run_all_cpu_set_hw_mode(insn, false);
  160. insn->max = INSN_HW;
  161. break;
  162. case INSN_OBSOLETE:
  163. insn->current_mode = INSN_UNDEF;
  164. insn->max = INSN_EMULATE;
  165. break;
  166. }
  167. raw_spin_lock_irqsave(&insn_emulation_lock, flags);
  168. list_add(&insn->node, &insn_emulation);
  169. nr_insn_emulated++;
  170. raw_spin_unlock_irqrestore(&insn_emulation_lock, flags);
  171. /* Register any handlers if required */
  172. update_insn_emulation_mode(insn, INSN_UNDEF);
  173. }
  174. static int emulation_proc_handler(struct ctl_table *table, int write,
  175. void *buffer, size_t *lenp,
  176. loff_t *ppos)
  177. {
  178. int ret = 0;
  179. struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode);
  180. enum insn_emulation_mode prev_mode = insn->current_mode;
  181. mutex_lock(&insn_emulation_mutex);
  182. ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
  183. if (ret || !write || prev_mode == insn->current_mode)
  184. goto ret;
  185. ret = update_insn_emulation_mode(insn, prev_mode);
  186. if (ret) {
  187. /* Mode change failed, revert to previous mode. */
  188. insn->current_mode = prev_mode;
  189. update_insn_emulation_mode(insn, INSN_UNDEF);
  190. }
  191. ret:
  192. mutex_unlock(&insn_emulation_mutex);
  193. return ret;
  194. }
  195. static void __init register_insn_emulation_sysctl(void)
  196. {
  197. unsigned long flags;
  198. int i = 0;
  199. struct insn_emulation *insn;
  200. struct ctl_table *insns_sysctl, *sysctl;
  201. insns_sysctl = kcalloc(nr_insn_emulated + 1, sizeof(*sysctl),
  202. GFP_KERNEL);
  203. if (!insns_sysctl)
  204. return;
  205. raw_spin_lock_irqsave(&insn_emulation_lock, flags);
  206. list_for_each_entry(insn, &insn_emulation, node) {
  207. sysctl = &insns_sysctl[i];
  208. sysctl->mode = 0644;
  209. sysctl->maxlen = sizeof(int);
  210. sysctl->procname = insn->ops->name;
  211. sysctl->data = &insn->current_mode;
  212. sysctl->extra1 = &insn->min;
  213. sysctl->extra2 = &insn->max;
  214. sysctl->proc_handler = emulation_proc_handler;
  215. i++;
  216. }
  217. raw_spin_unlock_irqrestore(&insn_emulation_lock, flags);
  218. register_sysctl("abi", insns_sysctl);
  219. }
  220. /*
  221. * Implement emulation of the SWP/SWPB instructions using load-exclusive and
  222. * store-exclusive.
  223. *
  224. * Syntax of SWP{B} instruction: SWP{B}<c> <Rt>, <Rt2>, [<Rn>]
  225. * Where: Rt = destination
  226. * Rt2 = source
  227. * Rn = address
  228. */
  229. /*
  230. * Error-checking SWP macros implemented using ldxr{b}/stxr{b}
  231. */
  232. /* Arbitrary constant to ensure forward-progress of the LL/SC loop */
  233. #define __SWP_LL_SC_LOOPS 4
  234. #define __user_swpX_asm(data, addr, res, temp, temp2, B) \
  235. do { \
  236. uaccess_enable_privileged(); \
  237. __asm__ __volatile__( \
  238. " mov %w3, %w6\n" \
  239. "0: ldxr"B" %w2, [%4]\n" \
  240. "1: stxr"B" %w0, %w1, [%4]\n" \
  241. " cbz %w0, 2f\n" \
  242. " sub %w3, %w3, #1\n" \
  243. " cbnz %w3, 0b\n" \
  244. " mov %w0, %w5\n" \
  245. " b 3f\n" \
  246. "2:\n" \
  247. " mov %w1, %w2\n" \
  248. "3:\n" \
  249. _ASM_EXTABLE_UACCESS_ERR(0b, 3b, %w0) \
  250. _ASM_EXTABLE_UACCESS_ERR(1b, 3b, %w0) \
  251. : "=&r" (res), "+r" (data), "=&r" (temp), "=&r" (temp2) \
  252. : "r" ((unsigned long)addr), "i" (-EAGAIN), \
  253. "i" (__SWP_LL_SC_LOOPS) \
  254. : "memory"); \
  255. uaccess_disable_privileged(); \
  256. } while (0)
  257. #define __user_swp_asm(data, addr, res, temp, temp2) \
  258. __user_swpX_asm(data, addr, res, temp, temp2, "")
  259. #define __user_swpb_asm(data, addr, res, temp, temp2) \
  260. __user_swpX_asm(data, addr, res, temp, temp2, "b")
  261. /*
  262. * Bit 22 of the instruction encoding distinguishes between
  263. * the SWP and SWPB variants (bit set means SWPB).
  264. */
  265. #define TYPE_SWPB (1 << 22)
  266. static int emulate_swpX(unsigned int address, unsigned int *data,
  267. unsigned int type)
  268. {
  269. unsigned int res = 0;
  270. if ((type != TYPE_SWPB) && (address & 0x3)) {
  271. /* SWP to unaligned address not permitted */
  272. pr_debug("SWP instruction on unaligned pointer!\n");
  273. return -EFAULT;
  274. }
  275. while (1) {
  276. unsigned long temp, temp2;
  277. if (type == TYPE_SWPB)
  278. __user_swpb_asm(*data, address, res, temp, temp2);
  279. else
  280. __user_swp_asm(*data, address, res, temp, temp2);
  281. if (likely(res != -EAGAIN) || signal_pending(current))
  282. break;
  283. cond_resched();
  284. }
  285. return res;
  286. }
  287. #define ARM_OPCODE_CONDTEST_FAIL 0
  288. #define ARM_OPCODE_CONDTEST_PASS 1
  289. #define ARM_OPCODE_CONDTEST_UNCOND 2
  290. #define ARM_OPCODE_CONDITION_UNCOND 0xf
  291. static unsigned int __kprobes aarch32_check_condition(u32 opcode, u32 psr)
  292. {
  293. u32 cc_bits = opcode >> 28;
  294. if (cc_bits != ARM_OPCODE_CONDITION_UNCOND) {
  295. if ((*aarch32_opcode_cond_checks[cc_bits])(psr))
  296. return ARM_OPCODE_CONDTEST_PASS;
  297. else
  298. return ARM_OPCODE_CONDTEST_FAIL;
  299. }
  300. return ARM_OPCODE_CONDTEST_UNCOND;
  301. }
  302. /*
  303. * swp_handler logs the id of calling process, dissects the instruction, sanity
  304. * checks the memory location, calls emulate_swpX for the actual operation and
  305. * deals with fixup/error handling before returning
  306. */
  307. static int swp_handler(struct pt_regs *regs, u32 instr)
  308. {
  309. u32 destreg, data, type, address = 0;
  310. const void __user *user_ptr;
  311. int rn, rt2, res = 0;
  312. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  313. type = instr & TYPE_SWPB;
  314. switch (aarch32_check_condition(instr, regs->pstate)) {
  315. case ARM_OPCODE_CONDTEST_PASS:
  316. break;
  317. case ARM_OPCODE_CONDTEST_FAIL:
  318. /* Condition failed - return to next instruction */
  319. goto ret;
  320. case ARM_OPCODE_CONDTEST_UNCOND:
  321. /* If unconditional encoding - not a SWP, undef */
  322. return -EFAULT;
  323. default:
  324. return -EINVAL;
  325. }
  326. rn = aarch32_insn_extract_reg_num(instr, A32_RN_OFFSET);
  327. rt2 = aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET);
  328. address = (u32)regs->user_regs.regs[rn];
  329. data = (u32)regs->user_regs.regs[rt2];
  330. destreg = aarch32_insn_extract_reg_num(instr, A32_RT_OFFSET);
  331. pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n",
  332. rn, address, destreg,
  333. aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET), data);
  334. /* Check access in reasonable access range for both SWP and SWPB */
  335. user_ptr = (const void __user *)(unsigned long)(address & ~3);
  336. if (!access_ok(user_ptr, 4)) {
  337. pr_debug("SWP{B} emulation: access to 0x%08x not allowed!\n",
  338. address);
  339. goto fault;
  340. }
  341. res = emulate_swpX(address, &data, type);
  342. if (res == -EFAULT)
  343. goto fault;
  344. else if (res == 0)
  345. regs->user_regs.regs[destreg] = data;
  346. ret:
  347. if (type == TYPE_SWPB)
  348. trace_instruction_emulation("swpb", regs->pc);
  349. else
  350. trace_instruction_emulation("swp", regs->pc);
  351. pr_warn_ratelimited("\"%s\" (%ld) uses obsolete SWP{B} instruction at 0x%llx\n",
  352. current->comm, (unsigned long)current->pid, regs->pc);
  353. arm64_skip_faulting_instruction(regs, 4);
  354. return 0;
  355. fault:
  356. pr_debug("SWP{B} emulation: access caused memory abort!\n");
  357. arm64_notify_segfault(address);
  358. return 0;
  359. }
  360. /*
  361. * Only emulate SWP/SWPB executed in ARM state/User mode.
  362. * The kernel must be SWP free and SWP{B} does not exist in Thumb.
  363. */
  364. static struct undef_hook swp_hooks[] = {
  365. {
  366. .instr_mask = 0x0fb00ff0,
  367. .instr_val = 0x01000090,
  368. .pstate_mask = PSR_AA32_MODE_MASK,
  369. .pstate_val = PSR_AA32_MODE_USR,
  370. .fn = swp_handler
  371. },
  372. { }
  373. };
  374. static struct insn_emulation_ops swp_ops = {
  375. .name = "swp",
  376. .status = INSN_OBSOLETE,
  377. .hooks = swp_hooks,
  378. .set_hw_mode = NULL,
  379. };
  380. static int cp15barrier_handler(struct pt_regs *regs, u32 instr)
  381. {
  382. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  383. switch (aarch32_check_condition(instr, regs->pstate)) {
  384. case ARM_OPCODE_CONDTEST_PASS:
  385. break;
  386. case ARM_OPCODE_CONDTEST_FAIL:
  387. /* Condition failed - return to next instruction */
  388. goto ret;
  389. case ARM_OPCODE_CONDTEST_UNCOND:
  390. /* If unconditional encoding - not a barrier instruction */
  391. return -EFAULT;
  392. default:
  393. return -EINVAL;
  394. }
  395. switch (aarch32_insn_mcr_extract_crm(instr)) {
  396. case 10:
  397. /*
  398. * dmb - mcr p15, 0, Rt, c7, c10, 5
  399. * dsb - mcr p15, 0, Rt, c7, c10, 4
  400. */
  401. if (aarch32_insn_mcr_extract_opc2(instr) == 5) {
  402. dmb(sy);
  403. trace_instruction_emulation(
  404. "mcr p15, 0, Rt, c7, c10, 5 ; dmb", regs->pc);
  405. } else {
  406. dsb(sy);
  407. trace_instruction_emulation(
  408. "mcr p15, 0, Rt, c7, c10, 4 ; dsb", regs->pc);
  409. }
  410. break;
  411. case 5:
  412. /*
  413. * isb - mcr p15, 0, Rt, c7, c5, 4
  414. *
  415. * Taking an exception or returning from one acts as an
  416. * instruction barrier. So no explicit barrier needed here.
  417. */
  418. trace_instruction_emulation(
  419. "mcr p15, 0, Rt, c7, c5, 4 ; isb", regs->pc);
  420. break;
  421. }
  422. ret:
  423. pr_warn_ratelimited("\"%s\" (%ld) uses deprecated CP15 Barrier instruction at 0x%llx\n",
  424. current->comm, (unsigned long)current->pid, regs->pc);
  425. arm64_skip_faulting_instruction(regs, 4);
  426. return 0;
  427. }
  428. static int cp15_barrier_set_hw_mode(bool enable)
  429. {
  430. if (enable)
  431. sysreg_clear_set(sctlr_el1, 0, SCTLR_EL1_CP15BEN);
  432. else
  433. sysreg_clear_set(sctlr_el1, SCTLR_EL1_CP15BEN, 0);
  434. return 0;
  435. }
  436. static struct undef_hook cp15_barrier_hooks[] = {
  437. {
  438. .instr_mask = 0x0fff0fdf,
  439. .instr_val = 0x0e070f9a,
  440. .pstate_mask = PSR_AA32_MODE_MASK,
  441. .pstate_val = PSR_AA32_MODE_USR,
  442. .fn = cp15barrier_handler,
  443. },
  444. {
  445. .instr_mask = 0x0fff0fff,
  446. .instr_val = 0x0e070f95,
  447. .pstate_mask = PSR_AA32_MODE_MASK,
  448. .pstate_val = PSR_AA32_MODE_USR,
  449. .fn = cp15barrier_handler,
  450. },
  451. { }
  452. };
  453. static struct insn_emulation_ops cp15_barrier_ops = {
  454. .name = "cp15_barrier",
  455. .status = INSN_DEPRECATED,
  456. .hooks = cp15_barrier_hooks,
  457. .set_hw_mode = cp15_barrier_set_hw_mode,
  458. };
  459. static int setend_set_hw_mode(bool enable)
  460. {
  461. if (!cpu_supports_mixed_endian_el0())
  462. return -EINVAL;
  463. if (enable)
  464. sysreg_clear_set(sctlr_el1, SCTLR_EL1_SED, 0);
  465. else
  466. sysreg_clear_set(sctlr_el1, 0, SCTLR_EL1_SED);
  467. return 0;
  468. }
  469. static int compat_setend_handler(struct pt_regs *regs, u32 big_endian)
  470. {
  471. char *insn;
  472. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  473. if (big_endian) {
  474. insn = "setend be";
  475. regs->pstate |= PSR_AA32_E_BIT;
  476. } else {
  477. insn = "setend le";
  478. regs->pstate &= ~PSR_AA32_E_BIT;
  479. }
  480. trace_instruction_emulation(insn, regs->pc);
  481. pr_warn_ratelimited("\"%s\" (%ld) uses deprecated setend instruction at 0x%llx\n",
  482. current->comm, (unsigned long)current->pid, regs->pc);
  483. return 0;
  484. }
  485. static int a32_setend_handler(struct pt_regs *regs, u32 instr)
  486. {
  487. int rc = compat_setend_handler(regs, (instr >> 9) & 1);
  488. arm64_skip_faulting_instruction(regs, 4);
  489. return rc;
  490. }
  491. static int t16_setend_handler(struct pt_regs *regs, u32 instr)
  492. {
  493. int rc = compat_setend_handler(regs, (instr >> 3) & 1);
  494. arm64_skip_faulting_instruction(regs, 2);
  495. return rc;
  496. }
  497. static struct undef_hook setend_hooks[] = {
  498. {
  499. .instr_mask = 0xfffffdff,
  500. .instr_val = 0xf1010000,
  501. .pstate_mask = PSR_AA32_MODE_MASK,
  502. .pstate_val = PSR_AA32_MODE_USR,
  503. .fn = a32_setend_handler,
  504. },
  505. {
  506. /* Thumb mode */
  507. .instr_mask = 0xfffffff7,
  508. .instr_val = 0x0000b650,
  509. .pstate_mask = (PSR_AA32_T_BIT | PSR_AA32_MODE_MASK),
  510. .pstate_val = (PSR_AA32_T_BIT | PSR_AA32_MODE_USR),
  511. .fn = t16_setend_handler,
  512. },
  513. {}
  514. };
  515. static struct insn_emulation_ops setend_ops = {
  516. .name = "setend",
  517. .status = INSN_DEPRECATED,
  518. .hooks = setend_hooks,
  519. .set_hw_mode = setend_set_hw_mode,
  520. };
  521. /*
  522. * Invoked as core_initcall, which guarantees that the instruction
  523. * emulation is ready for userspace.
  524. */
  525. static int __init armv8_deprecated_init(void)
  526. {
  527. if (IS_ENABLED(CONFIG_SWP_EMULATION))
  528. register_insn_emulation(&swp_ops);
  529. if (IS_ENABLED(CONFIG_CP15_BARRIER_EMULATION))
  530. register_insn_emulation(&cp15_barrier_ops);
  531. if (IS_ENABLED(CONFIG_SETEND_EMULATION)) {
  532. if (system_supports_mixed_endian_el0())
  533. register_insn_emulation(&setend_ops);
  534. else
  535. pr_info("setend instruction emulation is not supported on this system\n");
  536. }
  537. cpuhp_setup_state_nocalls(CPUHP_AP_ARM64_ISNDEP_STARTING,
  538. "arm64/isndep:starting",
  539. run_all_insn_set_hw_mode, NULL);
  540. register_insn_emulation_sysctl();
  541. return 0;
  542. }
  543. core_initcall(armv8_deprecated_init);