armv8_deprecated.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  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;
  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 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 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. " .pushsection __ex_table,\"a\"\n" \
  258. " .align 3\n" \
  259. " .quad 0b, 4b\n" \
  260. " .quad 1b, 4b\n" \
  261. " .popsection\n" \
  262. ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN, \
  263. CONFIG_ARM64_PAN) \
  264. : "=&r" (res), "+r" (data), "=&r" (temp) \
  265. : "r" (addr), "i" (-EAGAIN), "i" (-EFAULT) \
  266. : "memory")
  267. #define __user_swp_asm(data, addr, res, temp) \
  268. __user_swpX_asm(data, addr, res, temp, "")
  269. #define __user_swpb_asm(data, addr, res, temp) \
  270. __user_swpX_asm(data, addr, res, temp, "b")
  271. /*
  272. * Bit 22 of the instruction encoding distinguishes between
  273. * the SWP and SWPB variants (bit set means SWPB).
  274. */
  275. #define TYPE_SWPB (1 << 22)
  276. /*
  277. * Set up process info to signal segmentation fault - called on access error.
  278. */
  279. static void set_segfault(struct pt_regs *regs, unsigned long addr)
  280. {
  281. siginfo_t info;
  282. down_read(&current->mm->mmap_sem);
  283. if (find_vma(current->mm, addr) == NULL)
  284. info.si_code = SEGV_MAPERR;
  285. else
  286. info.si_code = SEGV_ACCERR;
  287. up_read(&current->mm->mmap_sem);
  288. info.si_signo = SIGSEGV;
  289. info.si_errno = 0;
  290. info.si_addr = (void *) instruction_pointer(regs);
  291. pr_debug("SWP{B} emulation: access caused memory abort!\n");
  292. arm64_notify_die("Illegal memory access", regs, &info, 0);
  293. }
  294. static int emulate_swpX(unsigned int address, unsigned int *data,
  295. unsigned int type)
  296. {
  297. unsigned int res = 0;
  298. if ((type != TYPE_SWPB) && (address & 0x3)) {
  299. /* SWP to unaligned address not permitted */
  300. pr_debug("SWP instruction on unaligned pointer!\n");
  301. return -EFAULT;
  302. }
  303. while (1) {
  304. unsigned long temp;
  305. if (type == TYPE_SWPB)
  306. __user_swpb_asm(*data, address, res, temp);
  307. else
  308. __user_swp_asm(*data, address, res, temp);
  309. if (likely(res != -EAGAIN) || signal_pending(current))
  310. break;
  311. cond_resched();
  312. }
  313. return res;
  314. }
  315. /*
  316. * swp_handler logs the id of calling process, dissects the instruction, sanity
  317. * checks the memory location, calls emulate_swpX for the actual operation and
  318. * deals with fixup/error handling before returning
  319. */
  320. static int swp_handler(struct pt_regs *regs, u32 instr)
  321. {
  322. u32 destreg, data, type, address = 0;
  323. int rn, rt2, res = 0;
  324. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  325. type = instr & TYPE_SWPB;
  326. switch (arm_check_condition(instr, regs->pstate)) {
  327. case ARM_OPCODE_CONDTEST_PASS:
  328. break;
  329. case ARM_OPCODE_CONDTEST_FAIL:
  330. /* Condition failed - return to next instruction */
  331. goto ret;
  332. case ARM_OPCODE_CONDTEST_UNCOND:
  333. /* If unconditional encoding - not a SWP, undef */
  334. return -EFAULT;
  335. default:
  336. return -EINVAL;
  337. }
  338. rn = aarch32_insn_extract_reg_num(instr, A32_RN_OFFSET);
  339. rt2 = aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET);
  340. address = (u32)regs->user_regs.regs[rn];
  341. data = (u32)regs->user_regs.regs[rt2];
  342. destreg = aarch32_insn_extract_reg_num(instr, A32_RT_OFFSET);
  343. pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n",
  344. rn, address, destreg,
  345. aarch32_insn_extract_reg_num(instr, A32_RT2_OFFSET), data);
  346. /* Check access in reasonable access range for both SWP and SWPB */
  347. if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) {
  348. pr_debug("SWP{B} emulation: access to 0x%08x not allowed!\n",
  349. address);
  350. goto fault;
  351. }
  352. res = emulate_swpX(address, &data, type);
  353. if (res == -EFAULT)
  354. goto fault;
  355. else if (res == 0)
  356. regs->user_regs.regs[destreg] = data;
  357. ret:
  358. if (type == TYPE_SWPB)
  359. trace_instruction_emulation("swpb", regs->pc);
  360. else
  361. trace_instruction_emulation("swp", regs->pc);
  362. pr_warn_ratelimited("\"%s\" (%ld) uses obsolete SWP{B} instruction at 0x%llx\n",
  363. current->comm, (unsigned long)current->pid, regs->pc);
  364. regs->pc += 4;
  365. return 0;
  366. fault:
  367. set_segfault(regs, address);
  368. return 0;
  369. }
  370. /*
  371. * Only emulate SWP/SWPB executed in ARM state/User mode.
  372. * The kernel must be SWP free and SWP{B} does not exist in Thumb.
  373. */
  374. static struct undef_hook swp_hooks[] = {
  375. {
  376. .instr_mask = 0x0fb00ff0,
  377. .instr_val = 0x01000090,
  378. .pstate_mask = COMPAT_PSR_MODE_MASK,
  379. .pstate_val = COMPAT_PSR_MODE_USR,
  380. .fn = swp_handler
  381. },
  382. { }
  383. };
  384. static struct insn_emulation_ops swp_ops = {
  385. .name = "swp",
  386. .status = INSN_OBSOLETE,
  387. .hooks = swp_hooks,
  388. .set_hw_mode = NULL,
  389. };
  390. static int cp15barrier_handler(struct pt_regs *regs, u32 instr)
  391. {
  392. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  393. switch (arm_check_condition(instr, regs->pstate)) {
  394. case ARM_OPCODE_CONDTEST_PASS:
  395. break;
  396. case ARM_OPCODE_CONDTEST_FAIL:
  397. /* Condition failed - return to next instruction */
  398. goto ret;
  399. case ARM_OPCODE_CONDTEST_UNCOND:
  400. /* If unconditional encoding - not a barrier instruction */
  401. return -EFAULT;
  402. default:
  403. return -EINVAL;
  404. }
  405. switch (aarch32_insn_mcr_extract_crm(instr)) {
  406. case 10:
  407. /*
  408. * dmb - mcr p15, 0, Rt, c7, c10, 5
  409. * dsb - mcr p15, 0, Rt, c7, c10, 4
  410. */
  411. if (aarch32_insn_mcr_extract_opc2(instr) == 5) {
  412. dmb(sy);
  413. trace_instruction_emulation(
  414. "mcr p15, 0, Rt, c7, c10, 5 ; dmb", regs->pc);
  415. } else {
  416. dsb(sy);
  417. trace_instruction_emulation(
  418. "mcr p15, 0, Rt, c7, c10, 4 ; dsb", regs->pc);
  419. }
  420. break;
  421. case 5:
  422. /*
  423. * isb - mcr p15, 0, Rt, c7, c5, 4
  424. *
  425. * Taking an exception or returning from one acts as an
  426. * instruction barrier. So no explicit barrier needed here.
  427. */
  428. trace_instruction_emulation(
  429. "mcr p15, 0, Rt, c7, c5, 4 ; isb", regs->pc);
  430. break;
  431. }
  432. ret:
  433. pr_warn_ratelimited("\"%s\" (%ld) uses deprecated CP15 Barrier instruction at 0x%llx\n",
  434. current->comm, (unsigned long)current->pid, regs->pc);
  435. regs->pc += 4;
  436. return 0;
  437. }
  438. static int cp15_barrier_set_hw_mode(bool enable)
  439. {
  440. if (enable)
  441. config_sctlr_el1(0, SCTLR_EL1_CP15BEN);
  442. else
  443. config_sctlr_el1(SCTLR_EL1_CP15BEN, 0);
  444. return 0;
  445. }
  446. static struct undef_hook cp15_barrier_hooks[] = {
  447. {
  448. .instr_mask = 0x0fff0fdf,
  449. .instr_val = 0x0e070f9a,
  450. .pstate_mask = COMPAT_PSR_MODE_MASK,
  451. .pstate_val = COMPAT_PSR_MODE_USR,
  452. .fn = cp15barrier_handler,
  453. },
  454. {
  455. .instr_mask = 0x0fff0fff,
  456. .instr_val = 0x0e070f95,
  457. .pstate_mask = COMPAT_PSR_MODE_MASK,
  458. .pstate_val = COMPAT_PSR_MODE_USR,
  459. .fn = cp15barrier_handler,
  460. },
  461. { }
  462. };
  463. static struct insn_emulation_ops cp15_barrier_ops = {
  464. .name = "cp15_barrier",
  465. .status = INSN_DEPRECATED,
  466. .hooks = cp15_barrier_hooks,
  467. .set_hw_mode = cp15_barrier_set_hw_mode,
  468. };
  469. static int setend_set_hw_mode(bool enable)
  470. {
  471. if (!cpu_supports_mixed_endian_el0())
  472. return -EINVAL;
  473. if (enable)
  474. config_sctlr_el1(SCTLR_EL1_SED, 0);
  475. else
  476. config_sctlr_el1(0, SCTLR_EL1_SED);
  477. return 0;
  478. }
  479. static int compat_setend_handler(struct pt_regs *regs, u32 big_endian)
  480. {
  481. char *insn;
  482. perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->pc);
  483. if (big_endian) {
  484. insn = "setend be";
  485. regs->pstate |= COMPAT_PSR_E_BIT;
  486. } else {
  487. insn = "setend le";
  488. regs->pstate &= ~COMPAT_PSR_E_BIT;
  489. }
  490. trace_instruction_emulation(insn, regs->pc);
  491. pr_warn_ratelimited("\"%s\" (%ld) uses deprecated setend instruction at 0x%llx\n",
  492. current->comm, (unsigned long)current->pid, regs->pc);
  493. return 0;
  494. }
  495. static int a32_setend_handler(struct pt_regs *regs, u32 instr)
  496. {
  497. int rc = compat_setend_handler(regs, (instr >> 9) & 1);
  498. regs->pc += 4;
  499. return rc;
  500. }
  501. static int t16_setend_handler(struct pt_regs *regs, u32 instr)
  502. {
  503. int rc = compat_setend_handler(regs, (instr >> 3) & 1);
  504. regs->pc += 2;
  505. return rc;
  506. }
  507. static struct undef_hook setend_hooks[] = {
  508. {
  509. .instr_mask = 0xfffffdff,
  510. .instr_val = 0xf1010000,
  511. .pstate_mask = COMPAT_PSR_MODE_MASK,
  512. .pstate_val = COMPAT_PSR_MODE_USR,
  513. .fn = a32_setend_handler,
  514. },
  515. {
  516. /* Thumb mode */
  517. .instr_mask = 0x0000fff7,
  518. .instr_val = 0x0000b650,
  519. .pstate_mask = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_MASK),
  520. .pstate_val = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_USR),
  521. .fn = t16_setend_handler,
  522. },
  523. {}
  524. };
  525. static struct insn_emulation_ops setend_ops = {
  526. .name = "setend",
  527. .status = INSN_DEPRECATED,
  528. .hooks = setend_hooks,
  529. .set_hw_mode = setend_set_hw_mode,
  530. };
  531. static int insn_cpu_hotplug_notify(struct notifier_block *b,
  532. unsigned long action, void *hcpu)
  533. {
  534. int rc = 0;
  535. if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING)
  536. rc = run_all_insn_set_hw_mode((unsigned long)hcpu);
  537. return notifier_from_errno(rc);
  538. }
  539. static struct notifier_block insn_cpu_hotplug_notifier = {
  540. .notifier_call = insn_cpu_hotplug_notify,
  541. };
  542. /*
  543. * Invoked as late_initcall, since not needed before init spawned.
  544. */
  545. static int __init armv8_deprecated_init(void)
  546. {
  547. if (IS_ENABLED(CONFIG_SWP_EMULATION))
  548. register_insn_emulation(&swp_ops);
  549. if (IS_ENABLED(CONFIG_CP15_BARRIER_EMULATION))
  550. register_insn_emulation(&cp15_barrier_ops);
  551. if (IS_ENABLED(CONFIG_SETEND_EMULATION)) {
  552. if(system_supports_mixed_endian_el0())
  553. register_insn_emulation(&setend_ops);
  554. else
  555. pr_info("setend instruction emulation is not supported on the system");
  556. }
  557. register_cpu_notifier(&insn_cpu_hotplug_notifier);
  558. register_insn_emulation_sysctl(ctl_abi);
  559. return 0;
  560. }
  561. late_initcall(armv8_deprecated_init);