armv8_deprecated.c 16 KB

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