armv8_deprecated.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  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 <asm/alternative.h>
  16. #include <asm/cpufeature.h>
  17. #include <asm/insn.h>
  18. #include <asm/opcodes.h>
  19. #include <asm/sysreg.h>
  20. #include <asm/system_misc.h>
  21. #include <asm/traps.h>
  22. #include <asm/uaccess.h>
  23. #include <asm/cpufeature.h>
  24. #define CREATE_TRACE_POINTS
  25. #include "trace-events-emulation.h"
  26. /*
  27. * The runtime support for deprecated instruction support can be in one of
  28. * following three states -
  29. *
  30. * 0 = undef
  31. * 1 = emulate (software emulation)
  32. * 2 = hw (supported in hardware)
  33. */
  34. enum insn_emulation_mode {
  35. INSN_UNDEF,
  36. INSN_EMULATE,
  37. INSN_HW,
  38. };
  39. enum legacy_insn_status {
  40. INSN_DEPRECATED,
  41. INSN_OBSOLETE,
  42. };
  43. struct insn_emulation_ops {
  44. const char *name;
  45. enum legacy_insn_status status;
  46. struct undef_hook *hooks;
  47. int (*set_hw_mode)(bool enable);
  48. };
  49. struct insn_emulation {
  50. struct list_head node;
  51. struct insn_emulation_ops *ops;
  52. int current_mode;
  53. int min;
  54. int max;
  55. };
  56. static LIST_HEAD(insn_emulation);
  57. static int nr_insn_emulated __initdata;
  58. static DEFINE_RAW_SPINLOCK(insn_emulation_lock);
  59. static void register_emulation_hooks(struct insn_emulation_ops *ops)
  60. {
  61. struct undef_hook *hook;
  62. BUG_ON(!ops->hooks);
  63. for (hook = ops->hooks; hook->instr_mask; hook++)
  64. register_undef_hook(hook);
  65. pr_notice("Registered %s emulation handler\n", ops->name);
  66. }
  67. static void remove_emulation_hooks(struct insn_emulation_ops *ops)
  68. {
  69. struct undef_hook *hook;
  70. BUG_ON(!ops->hooks);
  71. for (hook = ops->hooks; hook->instr_mask; hook++)
  72. unregister_undef_hook(hook);
  73. pr_notice("Removed %s emulation handler\n", ops->name);
  74. }
  75. static void enable_insn_hw_mode(void *data)
  76. {
  77. struct insn_emulation *insn = (struct insn_emulation *)data;
  78. if (insn->ops->set_hw_mode)
  79. insn->ops->set_hw_mode(true);
  80. }
  81. static void disable_insn_hw_mode(void *data)
  82. {
  83. struct insn_emulation *insn = (struct insn_emulation *)data;
  84. if (insn->ops->set_hw_mode)
  85. insn->ops->set_hw_mode(false);
  86. }
  87. /* Run set_hw_mode(mode) on all active CPUs */
  88. static int run_all_cpu_set_hw_mode(struct insn_emulation *insn, bool enable)
  89. {
  90. if (!insn->ops->set_hw_mode)
  91. return -EINVAL;
  92. if (enable)
  93. on_each_cpu(enable_insn_hw_mode, (void *)insn, true);
  94. else
  95. on_each_cpu(disable_insn_hw_mode, (void *)insn, true);
  96. return 0;
  97. }
  98. /*
  99. * Run set_hw_mode for all insns on a starting CPU.
  100. * Returns:
  101. * 0 - If all the hooks ran successfully.
  102. * -EINVAL - At least one hook is not supported by the CPU.
  103. */
  104. static int run_all_insn_set_hw_mode(unsigned long cpu)
  105. {
  106. int rc = 0;
  107. unsigned long flags;
  108. struct insn_emulation *insn;
  109. raw_spin_lock_irqsave(&insn_emulation_lock, flags);
  110. list_for_each_entry(insn, &insn_emulation, node) {
  111. bool enable = (insn->current_mode == INSN_HW);
  112. if (insn->ops->set_hw_mode && insn->ops->set_hw_mode(enable)) {
  113. pr_warn("CPU[%ld] cannot support the emulation of %s",
  114. cpu, insn->ops->name);
  115. rc = -EINVAL;
  116. }
  117. }
  118. raw_spin_unlock_irqrestore(&insn_emulation_lock, flags);
  119. return rc;
  120. }
  121. static int update_insn_emulation_mode(struct insn_emulation *insn,
  122. enum insn_emulation_mode prev)
  123. {
  124. int ret = 0;
  125. switch (prev) {
  126. case INSN_UNDEF: /* Nothing to be done */
  127. break;
  128. case INSN_EMULATE:
  129. remove_emulation_hooks(insn->ops);
  130. break;
  131. case INSN_HW:
  132. if (!run_all_cpu_set_hw_mode(insn, false))
  133. pr_notice("Disabled %s support\n", insn->ops->name);
  134. break;
  135. }
  136. switch (insn->current_mode) {
  137. case INSN_UNDEF:
  138. break;
  139. case INSN_EMULATE:
  140. register_emulation_hooks(insn->ops);
  141. break;
  142. case INSN_HW:
  143. ret = run_all_cpu_set_hw_mode(insn, true);
  144. if (!ret)
  145. pr_notice("Enabled %s support\n", insn->ops->name);
  146. break;
  147. }
  148. return ret;
  149. }
  150. static void __init register_insn_emulation(struct insn_emulation_ops *ops)
  151. {
  152. unsigned long flags;
  153. struct insn_emulation *insn;
  154. insn = kzalloc(sizeof(*insn), GFP_KERNEL);
  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 struct ctl_table ctl_abi[] = {
  198. {
  199. .procname = "abi",
  200. .mode = 0555,
  201. },
  202. { }
  203. };
  204. static void __init register_insn_emulation_sysctl(struct ctl_table *table)
  205. {
  206. unsigned long flags;
  207. int i = 0;
  208. struct insn_emulation *insn;
  209. struct ctl_table *insns_sysctl, *sysctl;
  210. insns_sysctl = kzalloc(sizeof(*sysctl) * (nr_insn_emulated + 1),
  211. GFP_KERNEL);
  212. raw_spin_lock_irqsave(&insn_emulation_lock, flags);
  213. list_for_each_entry(insn, &insn_emulation, node) {
  214. sysctl = &insns_sysctl[i];
  215. sysctl->mode = 0644;
  216. sysctl->maxlen = sizeof(int);
  217. sysctl->procname = insn->ops->name;
  218. sysctl->data = insn;
  219. sysctl->extra1 = &insn->min;
  220. sysctl->extra2 = &insn->max;
  221. sysctl->proc_handler = emulation_proc_handler;
  222. i++;
  223. }
  224. raw_spin_unlock_irqrestore(&insn_emulation_lock, flags);
  225. table->child = insns_sysctl;
  226. register_sysctl_table(table);
  227. }
  228. /*
  229. * Implement emulation of the SWP/SWPB instructions using load-exclusive and
  230. * store-exclusive.
  231. *
  232. * Syntax of SWP{B} instruction: SWP{B}<c> <Rt>, <Rt2>, [<Rn>]
  233. * Where: Rt = destination
  234. * Rt2 = source
  235. * Rn = address
  236. */
  237. /*
  238. * Error-checking SWP macros implemented using ldxr{b}/stxr{b}
  239. */
  240. #define __user_swpX_asm(data, addr, res, temp, B) \
  241. __asm__ __volatile__( \
  242. ALTERNATIVE("nop", SET_PSTATE_PAN(0), ARM64_HAS_PAN, \
  243. CONFIG_ARM64_PAN) \
  244. "0: ldxr"B" %w2, [%3]\n" \
  245. "1: stxr"B" %w0, %w1, [%3]\n" \
  246. " cbz %w0, 2f\n" \
  247. " mov %w0, %w4\n" \
  248. " b 3f\n" \
  249. "2:\n" \
  250. " mov %w1, %w2\n" \
  251. "3:\n" \
  252. " .pushsection .fixup,\"ax\"\n" \
  253. " .align 2\n" \
  254. "4: mov %w0, %w5\n" \
  255. " b 3b\n" \
  256. " .popsection" \
  257. _ASM_EXTABLE(0b, 4b) \
  258. _ASM_EXTABLE(1b, 4b) \
  259. ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN, \
  260. CONFIG_ARM64_PAN) \
  261. : "=&r" (res), "+r" (data), "=&r" (temp) \
  262. : "r" (addr), "i" (-EAGAIN), "i" (-EFAULT) \
  263. : "memory")
  264. #define __user_swp_asm(data, addr, res, temp) \
  265. __user_swpX_asm(data, addr, res, temp, "")
  266. #define __user_swpb_asm(data, addr, res, temp) \
  267. __user_swpX_asm(data, addr, res, temp, "b")
  268. /*
  269. * Bit 22 of the instruction encoding distinguishes between
  270. * the SWP and SWPB variants (bit set means SWPB).
  271. */
  272. #define TYPE_SWPB (1 << 22)
  273. /*
  274. * Set up process info to signal segmentation fault - called on access error.
  275. */
  276. static void set_segfault(struct pt_regs *regs, unsigned long addr)
  277. {
  278. siginfo_t info;
  279. down_read(&current->mm->mmap_sem);
  280. if (find_vma(current->mm, addr) == NULL)
  281. info.si_code = SEGV_MAPERR;
  282. else
  283. info.si_code = SEGV_ACCERR;
  284. up_read(&current->mm->mmap_sem);
  285. info.si_signo = SIGSEGV;
  286. info.si_errno = 0;
  287. info.si_addr = (void *) instruction_pointer(regs);
  288. pr_debug("SWP{B} emulation: access caused memory abort!\n");
  289. arm64_notify_die("Illegal memory access", regs, &info, 0);
  290. }
  291. static int emulate_swpX(unsigned int address, unsigned int *data,
  292. unsigned int type)
  293. {
  294. unsigned int res = 0;
  295. if ((type != TYPE_SWPB) && (address & 0x3)) {
  296. /* SWP to unaligned address not permitted */
  297. pr_debug("SWP instruction on unaligned pointer!\n");
  298. return -EFAULT;
  299. }
  300. while (1) {
  301. unsigned long temp;
  302. if (type == TYPE_SWPB)
  303. __user_swpb_asm(*data, address, res, temp);
  304. else
  305. __user_swp_asm(*data, address, res, temp);
  306. if (likely(res != -EAGAIN) || signal_pending(current))
  307. break;
  308. cond_resched();
  309. }
  310. return res;
  311. }
  312. /*
  313. * swp_handler logs the id of calling process, dissects the instruction, sanity
  314. * checks the memory location, calls emulate_swpX for the actual operation and
  315. * deals with fixup/error handling before returning
  316. */
  317. static int swp_handler(struct pt_regs *regs, u32 instr)
  318. {
  319. u32 destreg, data, type, address = 0;
  320. int rn, rt2, res = 0;
  321. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  322. type = instr & TYPE_SWPB;
  323. switch (arm_check_condition(instr, regs->pstate)) {
  324. case ARM_OPCODE_CONDTEST_PASS:
  325. break;
  326. case ARM_OPCODE_CONDTEST_FAIL:
  327. /* Condition failed - return to next instruction */
  328. goto ret;
  329. case ARM_OPCODE_CONDTEST_UNCOND:
  330. /* If unconditional encoding - not a SWP, undef */
  331. return -EFAULT;
  332. default:
  333. return -EINVAL;
  334. }
  335. rn = aarch32_insn_extract_reg_num(instr, A32_RN_OFFSET);
  336. rt2 = aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET);
  337. address = (u32)regs->user_regs.regs[rn];
  338. data = (u32)regs->user_regs.regs[rt2];
  339. destreg = aarch32_insn_extract_reg_num(instr, A32_RT_OFFSET);
  340. pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n",
  341. rn, address, destreg,
  342. aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET), data);
  343. /* Check access in reasonable access range for both SWP and SWPB */
  344. if (!access_ok(VERIFY_WRITE, (address & ~3), 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. regs->pc += 4;
  362. return 0;
  363. fault:
  364. set_segfault(regs, address);
  365. return 0;
  366. }
  367. /*
  368. * Only emulate SWP/SWPB executed in ARM state/User mode.
  369. * The kernel must be SWP free and SWP{B} does not exist in Thumb.
  370. */
  371. static struct undef_hook swp_hooks[] = {
  372. {
  373. .instr_mask = 0x0fb00ff0,
  374. .instr_val = 0x01000090,
  375. .pstate_mask = COMPAT_PSR_MODE_MASK,
  376. .pstate_val = COMPAT_PSR_MODE_USR,
  377. .fn = swp_handler
  378. },
  379. { }
  380. };
  381. static struct insn_emulation_ops swp_ops = {
  382. .name = "swp",
  383. .status = INSN_OBSOLETE,
  384. .hooks = swp_hooks,
  385. .set_hw_mode = NULL,
  386. };
  387. static int cp15barrier_handler(struct pt_regs *regs, u32 instr)
  388. {
  389. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  390. switch (arm_check_condition(instr, regs->pstate)) {
  391. case ARM_OPCODE_CONDTEST_PASS:
  392. break;
  393. case ARM_OPCODE_CONDTEST_FAIL:
  394. /* Condition failed - return to next instruction */
  395. goto ret;
  396. case ARM_OPCODE_CONDTEST_UNCOND:
  397. /* If unconditional encoding - not a barrier instruction */
  398. return -EFAULT;
  399. default:
  400. return -EINVAL;
  401. }
  402. switch (aarch32_insn_mcr_extract_crm(instr)) {
  403. case 10:
  404. /*
  405. * dmb - mcr p15, 0, Rt, c7, c10, 5
  406. * dsb - mcr p15, 0, Rt, c7, c10, 4
  407. */
  408. if (aarch32_insn_mcr_extract_opc2(instr) == 5) {
  409. dmb(sy);
  410. trace_instruction_emulation(
  411. "mcr p15, 0, Rt, c7, c10, 5 ; dmb", regs->pc);
  412. } else {
  413. dsb(sy);
  414. trace_instruction_emulation(
  415. "mcr p15, 0, Rt, c7, c10, 4 ; dsb", regs->pc);
  416. }
  417. break;
  418. case 5:
  419. /*
  420. * isb - mcr p15, 0, Rt, c7, c5, 4
  421. *
  422. * Taking an exception or returning from one acts as an
  423. * instruction barrier. So no explicit barrier needed here.
  424. */
  425. trace_instruction_emulation(
  426. "mcr p15, 0, Rt, c7, c5, 4 ; isb", regs->pc);
  427. break;
  428. }
  429. ret:
  430. pr_warn_ratelimited("\"%s\" (%ld) uses deprecated CP15 Barrier instruction at 0x%llx\n",
  431. current->comm, (unsigned long)current->pid, regs->pc);
  432. regs->pc += 4;
  433. return 0;
  434. }
  435. static int cp15_barrier_set_hw_mode(bool enable)
  436. {
  437. if (enable)
  438. config_sctlr_el1(0, SCTLR_EL1_CP15BEN);
  439. else
  440. config_sctlr_el1(SCTLR_EL1_CP15BEN, 0);
  441. return 0;
  442. }
  443. static struct undef_hook cp15_barrier_hooks[] = {
  444. {
  445. .instr_mask = 0x0fff0fdf,
  446. .instr_val = 0x0e070f9a,
  447. .pstate_mask = COMPAT_PSR_MODE_MASK,
  448. .pstate_val = COMPAT_PSR_MODE_USR,
  449. .fn = cp15barrier_handler,
  450. },
  451. {
  452. .instr_mask = 0x0fff0fff,
  453. .instr_val = 0x0e070f95,
  454. .pstate_mask = COMPAT_PSR_MODE_MASK,
  455. .pstate_val = COMPAT_PSR_MODE_USR,
  456. .fn = cp15barrier_handler,
  457. },
  458. { }
  459. };
  460. static struct insn_emulation_ops cp15_barrier_ops = {
  461. .name = "cp15_barrier",
  462. .status = INSN_DEPRECATED,
  463. .hooks = cp15_barrier_hooks,
  464. .set_hw_mode = cp15_barrier_set_hw_mode,
  465. };
  466. static int setend_set_hw_mode(bool enable)
  467. {
  468. if (!cpu_supports_mixed_endian_el0())
  469. return -EINVAL;
  470. if (enable)
  471. config_sctlr_el1(SCTLR_EL1_SED, 0);
  472. else
  473. config_sctlr_el1(0, SCTLR_EL1_SED);
  474. return 0;
  475. }
  476. static int compat_setend_handler(struct pt_regs *regs, u32 big_endian)
  477. {
  478. char *insn;
  479. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  480. if (big_endian) {
  481. insn = "setend be";
  482. regs->pstate |= COMPAT_PSR_E_BIT;
  483. } else {
  484. insn = "setend le";
  485. regs->pstate &= ~COMPAT_PSR_E_BIT;
  486. }
  487. trace_instruction_emulation(insn, regs->pc);
  488. pr_warn_ratelimited("\"%s\" (%ld) uses deprecated setend instruction at 0x%llx\n",
  489. current->comm, (unsigned long)current->pid, regs->pc);
  490. return 0;
  491. }
  492. static int a32_setend_handler(struct pt_regs *regs, u32 instr)
  493. {
  494. int rc = compat_setend_handler(regs, (instr >> 9) & 1);
  495. regs->pc += 4;
  496. return rc;
  497. }
  498. static int t16_setend_handler(struct pt_regs *regs, u32 instr)
  499. {
  500. int rc = compat_setend_handler(regs, (instr >> 3) & 1);
  501. regs->pc += 2;
  502. return rc;
  503. }
  504. static struct undef_hook setend_hooks[] = {
  505. {
  506. .instr_mask = 0xfffffdff,
  507. .instr_val = 0xf1010000,
  508. .pstate_mask = COMPAT_PSR_MODE_MASK,
  509. .pstate_val = COMPAT_PSR_MODE_USR,
  510. .fn = a32_setend_handler,
  511. },
  512. {
  513. /* Thumb mode */
  514. .instr_mask = 0x0000fff7,
  515. .instr_val = 0x0000b650,
  516. .pstate_mask = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_MASK),
  517. .pstate_val = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_USR),
  518. .fn = t16_setend_handler,
  519. },
  520. {}
  521. };
  522. static struct insn_emulation_ops setend_ops = {
  523. .name = "setend",
  524. .status = INSN_DEPRECATED,
  525. .hooks = setend_hooks,
  526. .set_hw_mode = setend_set_hw_mode,
  527. };
  528. static int insn_cpu_hotplug_notify(struct notifier_block *b,
  529. unsigned long action, void *hcpu)
  530. {
  531. int rc = 0;
  532. if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING)
  533. rc = run_all_insn_set_hw_mode((unsigned long)hcpu);
  534. return notifier_from_errno(rc);
  535. }
  536. static struct notifier_block insn_cpu_hotplug_notifier = {
  537. .notifier_call = insn_cpu_hotplug_notify,
  538. };
  539. /*
  540. * Invoked as late_initcall, since not needed before init spawned.
  541. */
  542. static int __init armv8_deprecated_init(void)
  543. {
  544. if (IS_ENABLED(CONFIG_SWP_EMULATION))
  545. register_insn_emulation(&swp_ops);
  546. if (IS_ENABLED(CONFIG_CP15_BARRIER_EMULATION))
  547. register_insn_emulation(&cp15_barrier_ops);
  548. if (IS_ENABLED(CONFIG_SETEND_EMULATION)) {
  549. if(system_supports_mixed_endian_el0())
  550. register_insn_emulation(&setend_ops);
  551. else
  552. pr_info("setend instruction emulation is not supported on the system");
  553. }
  554. register_cpu_notifier(&insn_cpu_hotplug_notifier);
  555. register_insn_emulation_sysctl(ctl_abi);
  556. return 0;
  557. }
  558. late_initcall(armv8_deprecated_init);