summaryrefslogtreecommitdiff
path: root/arch/xtensa/kernel/entry.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2022-05-13 18:11:14 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2022-05-17 13:35:43 +0300
commit5cc5f19f884a75f0bf96b95b4292fcc81effd755 (patch)
treea751a2cec798c43780f333a1bd2d4d2583833c07 /arch/xtensa/kernel/entry.S
parentd74862007e0849fad8ba86447e6f05928f920640 (diff)
downloadlinux-5cc5f19f884a75f0bf96b95b4292fcc81effd755.tar.xz
xtensa: improve call0 ABI probing
When call0 userspace ABI support by probing is enabled instructions that cause illegal instruction exception when PS.WOE is clear are retried with PS.WOE set before calling c-level exception handler. Record user pc at which PS.WOE was set in the fast exception handler and clear PS.WOE in the c-level exception handler if we get there from the same address. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/entry.S')
-rw-r--r--arch/xtensa/kernel/entry.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index 3224b4ceca34..e3eae648ba2e 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -1056,6 +1056,11 @@ ENTRY(fast_illegal_instruction_user)
movi a3, PS_WOE_MASK
or a0, a0, a3
wsr a0, ps
+#ifdef CONFIG_USER_ABI_CALL0_PROBE
+ GET_THREAD_INFO(a3, a2)
+ rsr a0, epc1
+ s32i a0, a3, TI_PS_WOE_FIX_ADDR
+#endif
l32i a3, a2, PT_AREG3
l32i a0, a2, PT_AREG0
rsr a2, depc