entry.S 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Low-level exception handling code
  4. *
  5. * Copyright (C) 2012 ARM Ltd.
  6. * Authors: Catalin Marinas <catalin.marinas@arm.com>
  7. * Will Deacon <will.deacon@arm.com>
  8. */
  9. #include <linux/arm-smccc.h>
  10. #include <linux/init.h>
  11. #include <linux/linkage.h>
  12. #include <asm/alternative.h>
  13. #include <asm/assembler.h>
  14. #include <asm/asm-offsets.h>
  15. #include <asm/asm_pointer_auth.h>
  16. #include <asm/bug.h>
  17. #include <asm/cpufeature.h>
  18. #include <asm/errno.h>
  19. #include <asm/esr.h>
  20. #include <asm/irq.h>
  21. #include <asm/memory.h>
  22. #include <asm/mmu.h>
  23. #include <asm/processor.h>
  24. #include <asm/ptrace.h>
  25. #include <asm/scs.h>
  26. #include <asm/thread_info.h>
  27. #include <asm/asm-uaccess.h>
  28. #include <asm/unistd.h>
  29. .macro clear_gp_regs
  30. .irp n,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29
  31. mov x\n, xzr
  32. .endr
  33. .endm
  34. .macro kernel_ventry, el:req, ht:req, regsize:req, label:req
  35. .align 7
  36. .Lventry_start\@:
  37. .if \el == 0
  38. /*
  39. * This must be the first instruction of the EL0 vector entries. It is
  40. * skipped by the trampoline vectors, to trigger the cleanup.
  41. */
  42. b .Lskip_tramp_vectors_cleanup\@
  43. .if \regsize == 64
  44. mrs x30, tpidrro_el0
  45. msr tpidrro_el0, xzr
  46. .else
  47. mov x30, xzr
  48. .endif
  49. .Lskip_tramp_vectors_cleanup\@:
  50. .endif
  51. sub sp, sp, #PT_REGS_SIZE
  52. #ifdef CONFIG_VMAP_STACK
  53. /*
  54. * Test whether the SP has overflowed, without corrupting a GPR.
  55. * Task and IRQ stacks are aligned so that SP & (1 << THREAD_SHIFT)
  56. * should always be zero.
  57. */
  58. add sp, sp, x0 // sp' = sp + x0
  59. sub x0, sp, x0 // x0' = sp' - x0 = (sp + x0) - x0 = sp
  60. tbnz x0, #THREAD_SHIFT, 0f
  61. sub x0, sp, x0 // x0'' = sp' - x0' = (sp + x0) - sp = x0
  62. sub sp, sp, x0 // sp'' = sp' - x0 = (sp + x0) - x0 = sp
  63. b el\el\ht\()_\regsize\()_\label
  64. 0:
  65. /*
  66. * Either we've just detected an overflow, or we've taken an exception
  67. * while on the overflow stack. Either way, we won't return to
  68. * userspace, and can clobber EL0 registers to free up GPRs.
  69. */
  70. /* Stash the original SP (minus PT_REGS_SIZE) in tpidr_el0. */
  71. msr tpidr_el0, x0
  72. /* Recover the original x0 value and stash it in tpidrro_el0 */
  73. sub x0, sp, x0
  74. msr tpidrro_el0, x0
  75. /* Switch to the overflow stack */
  76. adr_this_cpu sp, overflow_stack + OVERFLOW_STACK_SIZE, x0
  77. /*
  78. * Check whether we were already on the overflow stack. This may happen
  79. * after panic() re-enables interrupts.
  80. */
  81. mrs x0, tpidr_el0 // sp of interrupted context
  82. sub x0, sp, x0 // delta with top of overflow stack
  83. tst x0, #~(OVERFLOW_STACK_SIZE - 1) // within range?
  84. b.ne __bad_stack // no? -> bad stack pointer
  85. /* We were already on the overflow stack. Restore sp/x0 and carry on. */
  86. sub sp, sp, x0
  87. mrs x0, tpidrro_el0
  88. #endif
  89. b el\el\ht\()_\regsize\()_\label
  90. .org .Lventry_start\@ + 128 // Did we overflow the ventry slot?
  91. .endm
  92. .macro tramp_alias, dst, sym
  93. .set .Lalias\@, TRAMP_VALIAS + \sym - .entry.tramp.text
  94. movz \dst, :abs_g2_s:.Lalias\@
  95. movk \dst, :abs_g1_nc:.Lalias\@
  96. movk \dst, :abs_g0_nc:.Lalias\@
  97. .endm
  98. /*
  99. * This macro corrupts x0-x3. It is the caller's duty to save/restore
  100. * them if required.
  101. */
  102. .macro apply_ssbd, state, tmp1, tmp2
  103. alternative_cb ARM64_ALWAYS_SYSTEM, spectre_v4_patch_fw_mitigation_enable
  104. b .L__asm_ssbd_skip\@ // Patched to NOP
  105. alternative_cb_end
  106. ldr_this_cpu \tmp2, arm64_ssbd_callback_required, \tmp1
  107. cbz \tmp2, .L__asm_ssbd_skip\@
  108. ldr \tmp2, [tsk, #TSK_TI_FLAGS]
  109. tbnz \tmp2, #TIF_SSBD, .L__asm_ssbd_skip\@
  110. mov w0, #ARM_SMCCC_ARCH_WORKAROUND_2
  111. mov w1, #\state
  112. alternative_cb ARM64_ALWAYS_SYSTEM, smccc_patch_fw_mitigation_conduit
  113. nop // Patched to SMC/HVC #0
  114. alternative_cb_end
  115. .L__asm_ssbd_skip\@:
  116. .endm
  117. /* Check for MTE asynchronous tag check faults */
  118. .macro check_mte_async_tcf, tmp, ti_flags, thread_sctlr
  119. #ifdef CONFIG_ARM64_MTE
  120. .arch_extension lse
  121. alternative_if_not ARM64_MTE
  122. b 1f
  123. alternative_else_nop_endif
  124. /*
  125. * Asynchronous tag check faults are only possible in ASYNC (2) or
  126. * ASYM (3) modes. In each of these modes bit 1 of SCTLR_EL1.TCF0 is
  127. * set, so skip the check if it is unset.
  128. */
  129. tbz \thread_sctlr, #(SCTLR_EL1_TCF0_SHIFT + 1), 1f
  130. mrs_s \tmp, SYS_TFSRE0_EL1
  131. tbz \tmp, #SYS_TFSR_EL1_TF0_SHIFT, 1f
  132. /* Asynchronous TCF occurred for TTBR0 access, set the TI flag */
  133. mov \tmp, #_TIF_MTE_ASYNC_FAULT
  134. add \ti_flags, tsk, #TSK_TI_FLAGS
  135. stset \tmp, [\ti_flags]
  136. 1:
  137. #endif
  138. .endm
  139. /* Clear the MTE asynchronous tag check faults */
  140. .macro clear_mte_async_tcf thread_sctlr
  141. #ifdef CONFIG_ARM64_MTE
  142. alternative_if ARM64_MTE
  143. /* See comment in check_mte_async_tcf above. */
  144. tbz \thread_sctlr, #(SCTLR_EL1_TCF0_SHIFT + 1), 1f
  145. dsb ish
  146. msr_s SYS_TFSRE0_EL1, xzr
  147. 1:
  148. alternative_else_nop_endif
  149. #endif
  150. .endm
  151. .macro mte_set_gcr, mte_ctrl, tmp
  152. #ifdef CONFIG_ARM64_MTE
  153. ubfx \tmp, \mte_ctrl, #MTE_CTRL_GCR_USER_EXCL_SHIFT, #16
  154. orr \tmp, \tmp, #SYS_GCR_EL1_RRND
  155. msr_s SYS_GCR_EL1, \tmp
  156. #endif
  157. .endm
  158. .macro mte_set_kernel_gcr, tmp, tmp2
  159. #ifdef CONFIG_KASAN_HW_TAGS
  160. alternative_cb ARM64_ALWAYS_SYSTEM, kasan_hw_tags_enable
  161. b 1f
  162. alternative_cb_end
  163. mov \tmp, KERNEL_GCR_EL1
  164. msr_s SYS_GCR_EL1, \tmp
  165. 1:
  166. #endif
  167. .endm
  168. .macro mte_set_user_gcr, tsk, tmp, tmp2
  169. #ifdef CONFIG_KASAN_HW_TAGS
  170. alternative_cb ARM64_ALWAYS_SYSTEM, kasan_hw_tags_enable
  171. b 1f
  172. alternative_cb_end
  173. ldr \tmp, [\tsk, #THREAD_MTE_CTRL]
  174. mte_set_gcr \tmp, \tmp2
  175. 1:
  176. #endif
  177. .endm
  178. .macro kernel_entry, el, regsize = 64
  179. .if \el == 0
  180. alternative_insn nop, SET_PSTATE_DIT(1), ARM64_HAS_DIT
  181. .endif
  182. .if \regsize == 32
  183. mov w0, w0 // zero upper 32 bits of x0
  184. .endif
  185. stp x0, x1, [sp, #16 * 0]
  186. stp x2, x3, [sp, #16 * 1]
  187. stp x4, x5, [sp, #16 * 2]
  188. stp x6, x7, [sp, #16 * 3]
  189. stp x8, x9, [sp, #16 * 4]
  190. stp x10, x11, [sp, #16 * 5]
  191. stp x12, x13, [sp, #16 * 6]
  192. stp x14, x15, [sp, #16 * 7]
  193. stp x16, x17, [sp, #16 * 8]
  194. stp x18, x19, [sp, #16 * 9]
  195. stp x20, x21, [sp, #16 * 10]
  196. stp x22, x23, [sp, #16 * 11]
  197. stp x24, x25, [sp, #16 * 12]
  198. stp x26, x27, [sp, #16 * 13]
  199. stp x28, x29, [sp, #16 * 14]
  200. .if \el == 0
  201. clear_gp_regs
  202. mrs x21, sp_el0
  203. ldr_this_cpu tsk, __entry_task, x20
  204. msr sp_el0, tsk
  205. /*
  206. * Ensure MDSCR_EL1.SS is clear, since we can unmask debug exceptions
  207. * when scheduling.
  208. */
  209. ldr x19, [tsk, #TSK_TI_FLAGS]
  210. disable_step_tsk x19, x20
  211. /* Check for asynchronous tag check faults in user space */
  212. ldr x0, [tsk, THREAD_SCTLR_USER]
  213. check_mte_async_tcf x22, x23, x0
  214. #ifdef CONFIG_ARM64_PTR_AUTH
  215. alternative_if ARM64_HAS_ADDRESS_AUTH
  216. /*
  217. * Enable IA for in-kernel PAC if the task had it disabled. Although
  218. * this could be implemented with an unconditional MRS which would avoid
  219. * a load, this was measured to be slower on Cortex-A75 and Cortex-A76.
  220. *
  221. * Install the kernel IA key only if IA was enabled in the task. If IA
  222. * was disabled on kernel exit then we would have left the kernel IA
  223. * installed so there is no need to install it again.
  224. */
  225. tbz x0, SCTLR_ELx_ENIA_SHIFT, 1f
  226. __ptrauth_keys_install_kernel_nosync tsk, x20, x22, x23
  227. b 2f
  228. 1:
  229. mrs x0, sctlr_el1
  230. orr x0, x0, SCTLR_ELx_ENIA
  231. msr sctlr_el1, x0
  232. 2:
  233. alternative_else_nop_endif
  234. #endif
  235. apply_ssbd 1, x22, x23
  236. mte_set_kernel_gcr x22, x23
  237. /*
  238. * Any non-self-synchronizing system register updates required for
  239. * kernel entry should be placed before this point.
  240. */
  241. alternative_if ARM64_MTE
  242. isb
  243. b 1f
  244. alternative_else_nop_endif
  245. alternative_if ARM64_HAS_ADDRESS_AUTH
  246. isb
  247. alternative_else_nop_endif
  248. 1:
  249. scs_load_current
  250. .else
  251. add x21, sp, #PT_REGS_SIZE
  252. get_current_task tsk
  253. .endif /* \el == 0 */
  254. mrs x22, elr_el1
  255. mrs x23, spsr_el1
  256. stp lr, x21, [sp, #S_LR]
  257. /*
  258. * For exceptions from EL0, create a final frame record.
  259. * For exceptions from EL1, create a synthetic frame record so the
  260. * interrupted code shows up in the backtrace.
  261. */
  262. .if \el == 0
  263. stp xzr, xzr, [sp, #S_STACKFRAME]
  264. .else
  265. stp x29, x22, [sp, #S_STACKFRAME]
  266. .endif
  267. add x29, sp, #S_STACKFRAME
  268. #ifdef CONFIG_ARM64_SW_TTBR0_PAN
  269. alternative_if_not ARM64_HAS_PAN
  270. bl __swpan_entry_el\el
  271. alternative_else_nop_endif
  272. #endif
  273. stp x22, x23, [sp, #S_PC]
  274. /* Not in a syscall by default (el0_svc overwrites for real syscall) */
  275. .if \el == 0
  276. mov w21, #NO_SYSCALL
  277. str w21, [sp, #S_SYSCALLNO]
  278. .endif
  279. #ifdef CONFIG_ARM64_PSEUDO_NMI
  280. alternative_if_not ARM64_HAS_GIC_PRIO_MASKING
  281. b .Lskip_pmr_save\@
  282. alternative_else_nop_endif
  283. mrs_s x20, SYS_ICC_PMR_EL1
  284. str x20, [sp, #S_PMR_SAVE]
  285. mov x20, #GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET
  286. msr_s SYS_ICC_PMR_EL1, x20
  287. .Lskip_pmr_save\@:
  288. #endif
  289. /*
  290. * Registers that may be useful after this macro is invoked:
  291. *
  292. * x20 - ICC_PMR_EL1
  293. * x21 - aborted SP
  294. * x22 - aborted PC
  295. * x23 - aborted PSTATE
  296. */
  297. .endm
  298. .macro kernel_exit, el
  299. .if \el != 0
  300. disable_daif
  301. .endif
  302. #ifdef CONFIG_ARM64_PSEUDO_NMI
  303. alternative_if_not ARM64_HAS_GIC_PRIO_MASKING
  304. b .Lskip_pmr_restore\@
  305. alternative_else_nop_endif
  306. ldr x20, [sp, #S_PMR_SAVE]
  307. msr_s SYS_ICC_PMR_EL1, x20
  308. /* Ensure priority change is seen by redistributor */
  309. alternative_if_not ARM64_HAS_GIC_PRIO_RELAXED_SYNC
  310. dsb sy
  311. alternative_else_nop_endif
  312. .Lskip_pmr_restore\@:
  313. #endif
  314. ldp x21, x22, [sp, #S_PC] // load ELR, SPSR
  315. #ifdef CONFIG_ARM64_SW_TTBR0_PAN
  316. alternative_if_not ARM64_HAS_PAN
  317. bl __swpan_exit_el\el
  318. alternative_else_nop_endif
  319. #endif
  320. .if \el == 0
  321. ldr x23, [sp, #S_SP] // load return stack pointer
  322. msr sp_el0, x23
  323. tst x22, #PSR_MODE32_BIT // native task?
  324. b.eq 3f
  325. #ifdef CONFIG_ARM64_ERRATUM_845719
  326. alternative_if ARM64_WORKAROUND_845719
  327. #ifdef CONFIG_PID_IN_CONTEXTIDR
  328. mrs x29, contextidr_el1
  329. msr contextidr_el1, x29
  330. #else
  331. msr contextidr_el1, xzr
  332. #endif
  333. alternative_else_nop_endif
  334. #endif
  335. 3:
  336. scs_save tsk
  337. /* Ignore asynchronous tag check faults in the uaccess routines */
  338. ldr x0, [tsk, THREAD_SCTLR_USER]
  339. clear_mte_async_tcf x0
  340. #ifdef CONFIG_ARM64_PTR_AUTH
  341. alternative_if ARM64_HAS_ADDRESS_AUTH
  342. /*
  343. * IA was enabled for in-kernel PAC. Disable it now if needed, or
  344. * alternatively install the user's IA. All other per-task keys and
  345. * SCTLR bits were updated on task switch.
  346. *
  347. * No kernel C function calls after this.
  348. */
  349. tbz x0, SCTLR_ELx_ENIA_SHIFT, 1f
  350. __ptrauth_keys_install_user tsk, x0, x1, x2
  351. b 2f
  352. 1:
  353. mrs x0, sctlr_el1
  354. bic x0, x0, SCTLR_ELx_ENIA
  355. msr sctlr_el1, x0
  356. 2:
  357. alternative_else_nop_endif
  358. #endif
  359. mte_set_user_gcr tsk, x0, x1
  360. apply_ssbd 0, x0, x1
  361. .endif
  362. msr elr_el1, x21 // set up the return data
  363. msr spsr_el1, x22
  364. ldp x0, x1, [sp, #16 * 0]
  365. ldp x2, x3, [sp, #16 * 1]
  366. ldp x4, x5, [sp, #16 * 2]
  367. ldp x6, x7, [sp, #16 * 3]
  368. ldp x8, x9, [sp, #16 * 4]
  369. ldp x10, x11, [sp, #16 * 5]
  370. ldp x12, x13, [sp, #16 * 6]
  371. ldp x14, x15, [sp, #16 * 7]
  372. ldp x16, x17, [sp, #16 * 8]
  373. ldp x18, x19, [sp, #16 * 9]
  374. ldp x20, x21, [sp, #16 * 10]
  375. ldp x22, x23, [sp, #16 * 11]
  376. ldp x24, x25, [sp, #16 * 12]
  377. ldp x26, x27, [sp, #16 * 13]
  378. ldp x28, x29, [sp, #16 * 14]
  379. .if \el == 0
  380. #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
  381. alternative_insn "b .L_skip_tramp_exit_\@", nop, ARM64_UNMAP_KERNEL_AT_EL0
  382. msr far_el1, x29
  383. ldr_this_cpu x30, this_cpu_vector, x29
  384. tramp_alias x29, tramp_exit
  385. msr vbar_el1, x30 // install vector table
  386. ldr lr, [sp, #S_LR] // restore x30
  387. add sp, sp, #PT_REGS_SIZE // restore sp
  388. br x29
  389. .L_skip_tramp_exit_\@:
  390. #endif
  391. .endif
  392. ldr lr, [sp, #S_LR]
  393. add sp, sp, #PT_REGS_SIZE // restore sp
  394. .if \el == 0
  395. /* This must be after the last explicit memory access */
  396. alternative_if ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
  397. tlbi vale1, xzr
  398. dsb nsh
  399. alternative_else_nop_endif
  400. .else
  401. /* Ensure any device/NC reads complete */
  402. alternative_insn nop, "dmb sy", ARM64_WORKAROUND_1508412
  403. .endif
  404. eret
  405. sb
  406. .endm
  407. #ifdef CONFIG_ARM64_SW_TTBR0_PAN
  408. /*
  409. * Set the TTBR0 PAN bit in SPSR. When the exception is taken from
  410. * EL0, there is no need to check the state of TTBR0_EL1 since
  411. * accesses are always enabled.
  412. * Note that the meaning of this bit differs from the ARMv8.1 PAN
  413. * feature as all TTBR0_EL1 accesses are disabled, not just those to
  414. * user mappings.
  415. */
  416. SYM_CODE_START_LOCAL(__swpan_entry_el1)
  417. mrs x21, ttbr0_el1
  418. tst x21, #TTBR_ASID_MASK // Check for the reserved ASID
  419. orr x23, x23, #PSR_PAN_BIT // Set the emulated PAN in the saved SPSR
  420. b.eq 1f // TTBR0 access already disabled
  421. and x23, x23, #~PSR_PAN_BIT // Clear the emulated PAN in the saved SPSR
  422. SYM_INNER_LABEL(__swpan_entry_el0, SYM_L_LOCAL)
  423. __uaccess_ttbr0_disable x21
  424. 1: ret
  425. SYM_CODE_END(__swpan_entry_el1)
  426. /*
  427. * Restore access to TTBR0_EL1. If returning to EL0, no need for SPSR
  428. * PAN bit checking.
  429. */
  430. SYM_CODE_START_LOCAL(__swpan_exit_el1)
  431. tbnz x22, #22, 1f // Skip re-enabling TTBR0 access if the PSR_PAN_BIT is set
  432. __uaccess_ttbr0_enable x0, x1
  433. 1: and x22, x22, #~PSR_PAN_BIT // ARMv8.0 CPUs do not understand this bit
  434. ret
  435. SYM_CODE_END(__swpan_exit_el1)
  436. SYM_CODE_START_LOCAL(__swpan_exit_el0)
  437. __uaccess_ttbr0_enable x0, x1
  438. /*
  439. * Enable errata workarounds only if returning to user. The only
  440. * workaround currently required for TTBR0_EL1 changes are for the
  441. * Cavium erratum 27456 (broadcast TLBI instructions may cause I-cache
  442. * corruption).
  443. */
  444. b post_ttbr_update_workaround
  445. SYM_CODE_END(__swpan_exit_el0)
  446. #endif
  447. /* GPRs used by entry code */
  448. tsk .req x28 // current thread_info
  449. .text
  450. /*
  451. * Exception vectors.
  452. */
  453. .pushsection ".entry.text", "ax"
  454. .align 11
  455. SYM_CODE_START(vectors)
  456. kernel_ventry 1, t, 64, sync // Synchronous EL1t
  457. kernel_ventry 1, t, 64, irq // IRQ EL1t
  458. kernel_ventry 1, t, 64, fiq // FIQ EL1t
  459. kernel_ventry 1, t, 64, error // Error EL1t
  460. kernel_ventry 1, h, 64, sync // Synchronous EL1h
  461. kernel_ventry 1, h, 64, irq // IRQ EL1h
  462. kernel_ventry 1, h, 64, fiq // FIQ EL1h
  463. kernel_ventry 1, h, 64, error // Error EL1h
  464. kernel_ventry 0, t, 64, sync // Synchronous 64-bit EL0
  465. kernel_ventry 0, t, 64, irq // IRQ 64-bit EL0
  466. kernel_ventry 0, t, 64, fiq // FIQ 64-bit EL0
  467. kernel_ventry 0, t, 64, error // Error 64-bit EL0
  468. kernel_ventry 0, t, 32, sync // Synchronous 32-bit EL0
  469. kernel_ventry 0, t, 32, irq // IRQ 32-bit EL0
  470. kernel_ventry 0, t, 32, fiq // FIQ 32-bit EL0
  471. kernel_ventry 0, t, 32, error // Error 32-bit EL0
  472. SYM_CODE_END(vectors)
  473. #ifdef CONFIG_VMAP_STACK
  474. SYM_CODE_START_LOCAL(__bad_stack)
  475. /*
  476. * We detected an overflow in kernel_ventry, which switched to the
  477. * overflow stack. Stash the exception regs, and head to our overflow
  478. * handler.
  479. */
  480. /* Restore the original x0 value */
  481. mrs x0, tpidrro_el0
  482. /*
  483. * Store the original GPRs to the new stack. The orginal SP (minus
  484. * PT_REGS_SIZE) was stashed in tpidr_el0 by kernel_ventry.
  485. */
  486. sub sp, sp, #PT_REGS_SIZE
  487. kernel_entry 1
  488. mrs x0, tpidr_el0
  489. add x0, x0, #PT_REGS_SIZE
  490. str x0, [sp, #S_SP]
  491. /* Stash the regs for handle_bad_stack */
  492. mov x0, sp
  493. /* Time to die */
  494. bl handle_bad_stack
  495. ASM_BUG()
  496. SYM_CODE_END(__bad_stack)
  497. #endif /* CONFIG_VMAP_STACK */
  498. .macro entry_handler el:req, ht:req, regsize:req, label:req
  499. SYM_CODE_START_LOCAL(el\el\ht\()_\regsize\()_\label)
  500. kernel_entry \el, \regsize
  501. mov x0, sp
  502. bl el\el\ht\()_\regsize\()_\label\()_handler
  503. .if \el == 0
  504. b ret_to_user
  505. .else
  506. b ret_to_kernel
  507. .endif
  508. SYM_CODE_END(el\el\ht\()_\regsize\()_\label)
  509. .endm
  510. /*
  511. * Early exception handlers
  512. */
  513. entry_handler 1, t, 64, sync
  514. entry_handler 1, t, 64, irq
  515. entry_handler 1, t, 64, fiq
  516. entry_handler 1, t, 64, error
  517. entry_handler 1, h, 64, sync
  518. entry_handler 1, h, 64, irq
  519. entry_handler 1, h, 64, fiq
  520. entry_handler 1, h, 64, error
  521. entry_handler 0, t, 64, sync
  522. entry_handler 0, t, 64, irq
  523. entry_handler 0, t, 64, fiq
  524. entry_handler 0, t, 64, error
  525. entry_handler 0, t, 32, sync
  526. entry_handler 0, t, 32, irq
  527. entry_handler 0, t, 32, fiq
  528. entry_handler 0, t, 32, error
  529. SYM_CODE_START_LOCAL(ret_to_kernel)
  530. kernel_exit 1
  531. SYM_CODE_END(ret_to_kernel)
  532. SYM_CODE_START_LOCAL(ret_to_user)
  533. ldr x19, [tsk, #TSK_TI_FLAGS] // re-check for single-step
  534. enable_step_tsk x19, x2
  535. #ifdef CONFIG_GCC_PLUGIN_STACKLEAK
  536. bl stackleak_erase_on_task_stack
  537. #endif
  538. kernel_exit 0
  539. SYM_CODE_END(ret_to_user)
  540. .popsection // .entry.text
  541. // Move from tramp_pg_dir to swapper_pg_dir
  542. .macro tramp_map_kernel, tmp
  543. mrs \tmp, ttbr1_el1
  544. add \tmp, \tmp, #TRAMP_SWAPPER_OFFSET
  545. bic \tmp, \tmp, #USER_ASID_FLAG
  546. msr ttbr1_el1, \tmp
  547. #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
  548. alternative_if ARM64_WORKAROUND_QCOM_FALKOR_E1003
  549. /* ASID already in \tmp[63:48] */
  550. movk \tmp, #:abs_g2_nc:(TRAMP_VALIAS >> 12)
  551. movk \tmp, #:abs_g1_nc:(TRAMP_VALIAS >> 12)
  552. /* 2MB boundary containing the vectors, so we nobble the walk cache */
  553. movk \tmp, #:abs_g0_nc:((TRAMP_VALIAS & ~(SZ_2M - 1)) >> 12)
  554. isb
  555. tlbi vae1, \tmp
  556. dsb nsh
  557. alternative_else_nop_endif
  558. #endif /* CONFIG_QCOM_FALKOR_ERRATUM_1003 */
  559. .endm
  560. // Move from swapper_pg_dir to tramp_pg_dir
  561. .macro tramp_unmap_kernel, tmp
  562. mrs \tmp, ttbr1_el1
  563. sub \tmp, \tmp, #TRAMP_SWAPPER_OFFSET
  564. orr \tmp, \tmp, #USER_ASID_FLAG
  565. msr ttbr1_el1, \tmp
  566. /*
  567. * We avoid running the post_ttbr_update_workaround here because
  568. * it's only needed by Cavium ThunderX, which requires KPTI to be
  569. * disabled.
  570. */
  571. .endm
  572. .macro tramp_data_read_var dst, var
  573. #ifdef CONFIG_RELOCATABLE
  574. ldr \dst, .L__tramp_data_\var
  575. .ifndef .L__tramp_data_\var
  576. .pushsection ".entry.tramp.rodata", "a", %progbits
  577. .align 3
  578. .L__tramp_data_\var:
  579. .quad \var
  580. .popsection
  581. .endif
  582. #else
  583. /*
  584. * As !RELOCATABLE implies !RANDOMIZE_BASE the address is always a
  585. * compile time constant (and hence not secret and not worth hiding).
  586. *
  587. * As statically allocated kernel code and data always live in the top
  588. * 47 bits of the address space we can sign-extend bit 47 and avoid an
  589. * instruction to load the upper 16 bits (which must be 0xFFFF).
  590. */
  591. movz \dst, :abs_g2_s:\var
  592. movk \dst, :abs_g1_nc:\var
  593. movk \dst, :abs_g0_nc:\var
  594. #endif
  595. .endm
  596. #define BHB_MITIGATION_NONE 0
  597. #define BHB_MITIGATION_LOOP 1
  598. #define BHB_MITIGATION_FW 2
  599. #define BHB_MITIGATION_INSN 3
  600. .macro tramp_ventry, vector_start, regsize, kpti, bhb
  601. .align 7
  602. 1:
  603. .if \regsize == 64
  604. msr tpidrro_el0, x30 // Restored in kernel_ventry
  605. .endif
  606. .if \bhb == BHB_MITIGATION_LOOP
  607. /*
  608. * This sequence must appear before the first indirect branch. i.e. the
  609. * ret out of tramp_ventry. It appears here because x30 is free.
  610. */
  611. __mitigate_spectre_bhb_loop x30
  612. .endif // \bhb == BHB_MITIGATION_LOOP
  613. .if \bhb == BHB_MITIGATION_INSN
  614. clearbhb
  615. isb
  616. .endif // \bhb == BHB_MITIGATION_INSN
  617. .if \kpti == 1
  618. /*
  619. * Defend against branch aliasing attacks by pushing a dummy
  620. * entry onto the return stack and using a RET instruction to
  621. * enter the full-fat kernel vectors.
  622. */
  623. bl 2f
  624. b .
  625. 2:
  626. tramp_map_kernel x30
  627. alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003
  628. tramp_data_read_var x30, vectors
  629. alternative_if_not ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM
  630. prfm plil1strm, [x30, #(1b - \vector_start)]
  631. alternative_else_nop_endif
  632. msr vbar_el1, x30
  633. isb
  634. .else
  635. adr_l x30, vectors
  636. .endif // \kpti == 1
  637. .if \bhb == BHB_MITIGATION_FW
  638. /*
  639. * The firmware sequence must appear before the first indirect branch.
  640. * i.e. the ret out of tramp_ventry. But it also needs the stack to be
  641. * mapped to save/restore the registers the SMC clobbers.
  642. */
  643. __mitigate_spectre_bhb_fw
  644. .endif // \bhb == BHB_MITIGATION_FW
  645. add x30, x30, #(1b - \vector_start + 4)
  646. ret
  647. .org 1b + 128 // Did we overflow the ventry slot?
  648. .endm
  649. .macro generate_tramp_vector, kpti, bhb
  650. .Lvector_start\@:
  651. .space 0x400
  652. .rept 4
  653. tramp_ventry .Lvector_start\@, 64, \kpti, \bhb
  654. .endr
  655. .rept 4
  656. tramp_ventry .Lvector_start\@, 32, \kpti, \bhb
  657. .endr
  658. .endm
  659. #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
  660. /*
  661. * Exception vectors trampoline.
  662. * The order must match __bp_harden_el1_vectors and the
  663. * arm64_bp_harden_el1_vectors enum.
  664. */
  665. .pushsection ".entry.tramp.text", "ax"
  666. .align 11
  667. SYM_CODE_START_LOCAL_NOALIGN(tramp_vectors)
  668. #ifdef CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY
  669. generate_tramp_vector kpti=1, bhb=BHB_MITIGATION_LOOP
  670. generate_tramp_vector kpti=1, bhb=BHB_MITIGATION_FW
  671. generate_tramp_vector kpti=1, bhb=BHB_MITIGATION_INSN
  672. #endif /* CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY */
  673. generate_tramp_vector kpti=1, bhb=BHB_MITIGATION_NONE
  674. SYM_CODE_END(tramp_vectors)
  675. SYM_CODE_START_LOCAL(tramp_exit)
  676. tramp_unmap_kernel x29
  677. mrs x29, far_el1 // restore x29
  678. eret
  679. sb
  680. SYM_CODE_END(tramp_exit)
  681. .popsection // .entry.tramp.text
  682. #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
  683. /*
  684. * Exception vectors for spectre mitigations on entry from EL1 when
  685. * kpti is not in use.
  686. */
  687. .macro generate_el1_vector, bhb
  688. .Lvector_start\@:
  689. kernel_ventry 1, t, 64, sync // Synchronous EL1t
  690. kernel_ventry 1, t, 64, irq // IRQ EL1t
  691. kernel_ventry 1, t, 64, fiq // FIQ EL1h
  692. kernel_ventry 1, t, 64, error // Error EL1t
  693. kernel_ventry 1, h, 64, sync // Synchronous EL1h
  694. kernel_ventry 1, h, 64, irq // IRQ EL1h
  695. kernel_ventry 1, h, 64, fiq // FIQ EL1h
  696. kernel_ventry 1, h, 64, error // Error EL1h
  697. .rept 4
  698. tramp_ventry .Lvector_start\@, 64, 0, \bhb
  699. .endr
  700. .rept 4
  701. tramp_ventry .Lvector_start\@, 32, 0, \bhb
  702. .endr
  703. .endm
  704. /* The order must match tramp_vecs and the arm64_bp_harden_el1_vectors enum. */
  705. .pushsection ".entry.text", "ax"
  706. .align 11
  707. SYM_CODE_START(__bp_harden_el1_vectors)
  708. #ifdef CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY
  709. generate_el1_vector bhb=BHB_MITIGATION_LOOP
  710. generate_el1_vector bhb=BHB_MITIGATION_FW
  711. generate_el1_vector bhb=BHB_MITIGATION_INSN
  712. #endif /* CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY */
  713. SYM_CODE_END(__bp_harden_el1_vectors)
  714. .popsection
  715. /*
  716. * Register switch for AArch64. The callee-saved registers need to be saved
  717. * and restored. On entry:
  718. * x0 = previous task_struct (must be preserved across the switch)
  719. * x1 = next task_struct
  720. * Previous and next are guaranteed not to be the same.
  721. *
  722. */
  723. SYM_FUNC_START(cpu_switch_to)
  724. save_and_disable_daif x11
  725. mov x10, #THREAD_CPU_CONTEXT
  726. add x8, x0, x10
  727. mov x9, sp
  728. stp x19, x20, [x8], #16 // store callee-saved registers
  729. stp x21, x22, [x8], #16
  730. stp x23, x24, [x8], #16
  731. stp x25, x26, [x8], #16
  732. stp x27, x28, [x8], #16
  733. stp x29, x9, [x8], #16
  734. str lr, [x8]
  735. add x8, x1, x10
  736. ldp x19, x20, [x8], #16 // restore callee-saved registers
  737. ldp x21, x22, [x8], #16
  738. ldp x23, x24, [x8], #16
  739. ldp x25, x26, [x8], #16
  740. ldp x27, x28, [x8], #16
  741. ldp x29, x9, [x8], #16
  742. ldr lr, [x8]
  743. mov sp, x9
  744. msr sp_el0, x1
  745. ptrauth_keys_install_kernel x1, x8, x9, x10
  746. scs_save x0
  747. scs_load_current
  748. restore_irq x11
  749. ret
  750. SYM_FUNC_END(cpu_switch_to)
  751. NOKPROBE(cpu_switch_to)
  752. /*
  753. * This is how we return from a fork.
  754. */
  755. SYM_CODE_START(ret_from_fork)
  756. bl schedule_tail
  757. cbz x19, 1f // not a kernel thread
  758. mov x0, x20
  759. blr x19
  760. 1: get_current_task tsk
  761. mov x0, sp
  762. bl asm_exit_to_user_mode
  763. b ret_to_user
  764. SYM_CODE_END(ret_from_fork)
  765. NOKPROBE(ret_from_fork)
  766. /*
  767. * void call_on_irq_stack(struct pt_regs *regs,
  768. * void (*func)(struct pt_regs *));
  769. *
  770. * Calls func(regs) using this CPU's irq stack and shadow irq stack.
  771. */
  772. SYM_FUNC_START(call_on_irq_stack)
  773. save_and_disable_daif x9
  774. #ifdef CONFIG_SHADOW_CALL_STACK
  775. get_current_task x16
  776. scs_save x16
  777. ldr_this_cpu scs_sp, irq_shadow_call_stack_ptr, x17
  778. #endif
  779. /* Create a frame record to save our LR and SP (implicit in FP) */
  780. stp x29, x30, [sp, #-16]!
  781. mov x29, sp
  782. ldr_this_cpu x16, irq_stack_ptr, x17
  783. /* Move to the new stack and call the function there */
  784. add sp, x16, #IRQ_STACK_SIZE
  785. restore_irq x9
  786. blr x1
  787. save_and_disable_daif x9
  788. /*
  789. * Restore the SP from the FP, and restore the FP and LR from the frame
  790. * record.
  791. */
  792. mov sp, x29
  793. ldp x29, x30, [sp], #16
  794. scs_load_current
  795. restore_irq x9
  796. ret
  797. SYM_FUNC_END(call_on_irq_stack)
  798. NOKPROBE(call_on_irq_stack)
  799. #ifdef CONFIG_ARM_SDE_INTERFACE
  800. #include <asm/sdei.h>
  801. #include <uapi/linux/arm_sdei.h>
  802. .macro sdei_handler_exit exit_mode
  803. /* On success, this call never returns... */
  804. cmp \exit_mode, #SDEI_EXIT_SMC
  805. b.ne 99f
  806. smc #0
  807. b .
  808. 99: hvc #0
  809. b .
  810. .endm
  811. #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
  812. /*
  813. * The regular SDEI entry point may have been unmapped along with the rest of
  814. * the kernel. This trampoline restores the kernel mapping to make the x1 memory
  815. * argument accessible.
  816. *
  817. * This clobbers x4, __sdei_handler() will restore this from firmware's
  818. * copy.
  819. */
  820. .pushsection ".entry.tramp.text", "ax"
  821. SYM_CODE_START(__sdei_asm_entry_trampoline)
  822. mrs x4, ttbr1_el1
  823. tbz x4, #USER_ASID_BIT, 1f
  824. tramp_map_kernel tmp=x4
  825. isb
  826. mov x4, xzr
  827. /*
  828. * Remember whether to unmap the kernel on exit.
  829. */
  830. 1: str x4, [x1, #(SDEI_EVENT_INTREGS + S_SDEI_TTBR1)]
  831. tramp_data_read_var x4, __sdei_asm_handler
  832. br x4
  833. SYM_CODE_END(__sdei_asm_entry_trampoline)
  834. NOKPROBE(__sdei_asm_entry_trampoline)
  835. /*
  836. * Make the exit call and restore the original ttbr1_el1
  837. *
  838. * x0 & x1: setup for the exit API call
  839. * x2: exit_mode
  840. * x4: struct sdei_registered_event argument from registration time.
  841. */
  842. SYM_CODE_START(__sdei_asm_exit_trampoline)
  843. ldr x4, [x4, #(SDEI_EVENT_INTREGS + S_SDEI_TTBR1)]
  844. cbnz x4, 1f
  845. tramp_unmap_kernel tmp=x4
  846. 1: sdei_handler_exit exit_mode=x2
  847. SYM_CODE_END(__sdei_asm_exit_trampoline)
  848. NOKPROBE(__sdei_asm_exit_trampoline)
  849. .popsection // .entry.tramp.text
  850. #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
  851. /*
  852. * Software Delegated Exception entry point.
  853. *
  854. * x0: Event number
  855. * x1: struct sdei_registered_event argument from registration time.
  856. * x2: interrupted PC
  857. * x3: interrupted PSTATE
  858. * x4: maybe clobbered by the trampoline
  859. *
  860. * Firmware has preserved x0->x17 for us, we must save/restore the rest to
  861. * follow SMC-CC. We save (or retrieve) all the registers as the handler may
  862. * want them.
  863. */
  864. SYM_CODE_START(__sdei_asm_handler)
  865. stp x2, x3, [x1, #SDEI_EVENT_INTREGS + S_PC]
  866. stp x4, x5, [x1, #SDEI_EVENT_INTREGS + 16 * 2]
  867. stp x6, x7, [x1, #SDEI_EVENT_INTREGS + 16 * 3]
  868. stp x8, x9, [x1, #SDEI_EVENT_INTREGS + 16 * 4]
  869. stp x10, x11, [x1, #SDEI_EVENT_INTREGS + 16 * 5]
  870. stp x12, x13, [x1, #SDEI_EVENT_INTREGS + 16 * 6]
  871. stp x14, x15, [x1, #SDEI_EVENT_INTREGS + 16 * 7]
  872. stp x16, x17, [x1, #SDEI_EVENT_INTREGS + 16 * 8]
  873. stp x18, x19, [x1, #SDEI_EVENT_INTREGS + 16 * 9]
  874. stp x20, x21, [x1, #SDEI_EVENT_INTREGS + 16 * 10]
  875. stp x22, x23, [x1, #SDEI_EVENT_INTREGS + 16 * 11]
  876. stp x24, x25, [x1, #SDEI_EVENT_INTREGS + 16 * 12]
  877. stp x26, x27, [x1, #SDEI_EVENT_INTREGS + 16 * 13]
  878. stp x28, x29, [x1, #SDEI_EVENT_INTREGS + 16 * 14]
  879. mov x4, sp
  880. stp lr, x4, [x1, #SDEI_EVENT_INTREGS + S_LR]
  881. mov x19, x1
  882. /* Store the registered-event for crash_smp_send_stop() */
  883. ldrb w4, [x19, #SDEI_EVENT_PRIORITY]
  884. cbnz w4, 1f
  885. adr_this_cpu dst=x5, sym=sdei_active_normal_event, tmp=x6
  886. b 2f
  887. 1: adr_this_cpu dst=x5, sym=sdei_active_critical_event, tmp=x6
  888. 2: str x19, [x5]
  889. #ifdef CONFIG_VMAP_STACK
  890. /*
  891. * entry.S may have been using sp as a scratch register, find whether
  892. * this is a normal or critical event and switch to the appropriate
  893. * stack for this CPU.
  894. */
  895. cbnz w4, 1f
  896. ldr_this_cpu dst=x5, sym=sdei_stack_normal_ptr, tmp=x6
  897. b 2f
  898. 1: ldr_this_cpu dst=x5, sym=sdei_stack_critical_ptr, tmp=x6
  899. 2: mov x6, #SDEI_STACK_SIZE
  900. add x5, x5, x6
  901. mov sp, x5
  902. #endif
  903. #ifdef CONFIG_SHADOW_CALL_STACK
  904. /* Use a separate shadow call stack for normal and critical events */
  905. cbnz w4, 3f
  906. ldr_this_cpu dst=scs_sp, sym=sdei_shadow_call_stack_normal_ptr, tmp=x6
  907. b 4f
  908. 3: ldr_this_cpu dst=scs_sp, sym=sdei_shadow_call_stack_critical_ptr, tmp=x6
  909. 4:
  910. #endif
  911. /*
  912. * We may have interrupted userspace, or a guest, or exit-from or
  913. * return-to either of these. We can't trust sp_el0, restore it.
  914. */
  915. mrs x28, sp_el0
  916. ldr_this_cpu dst=x0, sym=__entry_task, tmp=x1
  917. msr sp_el0, x0
  918. /* If we interrupted the kernel point to the previous stack/frame. */
  919. and x0, x3, #0xc
  920. mrs x1, CurrentEL
  921. cmp x0, x1
  922. csel x29, x29, xzr, eq // fp, or zero
  923. csel x4, x2, xzr, eq // elr, or zero
  924. stp x29, x4, [sp, #-16]!
  925. mov x29, sp
  926. add x0, x19, #SDEI_EVENT_INTREGS
  927. mov x1, x19
  928. bl __sdei_handler
  929. msr sp_el0, x28
  930. /* restore regs >x17 that we clobbered */
  931. mov x4, x19 // keep x4 for __sdei_asm_exit_trampoline
  932. ldp x28, x29, [x4, #SDEI_EVENT_INTREGS + 16 * 14]
  933. ldp x18, x19, [x4, #SDEI_EVENT_INTREGS + 16 * 9]
  934. ldp lr, x1, [x4, #SDEI_EVENT_INTREGS + S_LR]
  935. mov sp, x1
  936. mov x1, x0 // address to complete_and_resume
  937. /* x0 = (x0 <= SDEI_EV_FAILED) ?
  938. * EVENT_COMPLETE:EVENT_COMPLETE_AND_RESUME
  939. */
  940. cmp x0, #SDEI_EV_FAILED
  941. mov_q x2, SDEI_1_0_FN_SDEI_EVENT_COMPLETE
  942. mov_q x3, SDEI_1_0_FN_SDEI_EVENT_COMPLETE_AND_RESUME
  943. csel x0, x2, x3, ls
  944. ldr_l x2, sdei_exit_mode
  945. /* Clear the registered-event seen by crash_smp_send_stop() */
  946. ldrb w3, [x4, #SDEI_EVENT_PRIORITY]
  947. cbnz w3, 1f
  948. adr_this_cpu dst=x5, sym=sdei_active_normal_event, tmp=x6
  949. b 2f
  950. 1: adr_this_cpu dst=x5, sym=sdei_active_critical_event, tmp=x6
  951. 2: str xzr, [x5]
  952. alternative_if_not ARM64_UNMAP_KERNEL_AT_EL0
  953. sdei_handler_exit exit_mode=x2
  954. alternative_else_nop_endif
  955. #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
  956. tramp_alias dst=x5, sym=__sdei_asm_exit_trampoline
  957. br x5
  958. #endif
  959. SYM_CODE_END(__sdei_asm_handler)
  960. NOKPROBE(__sdei_asm_handler)
  961. SYM_CODE_START(__sdei_handler_abort)
  962. mov_q x0, SDEI_1_0_FN_SDEI_EVENT_COMPLETE_AND_RESUME
  963. adr x1, 1f
  964. ldr_l x2, sdei_exit_mode
  965. sdei_handler_exit exit_mode=x2
  966. // exit the handler and jump to the next instruction.
  967. // Exit will stomp x0-x17, PSTATE, ELR_ELx, and SPSR_ELx.
  968. 1: ret
  969. SYM_CODE_END(__sdei_handler_abort)
  970. NOKPROBE(__sdei_handler_abort)
  971. #endif /* CONFIG_ARM_SDE_INTERFACE */