summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/stacktrace.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2015-01-12 07:44:44 +0100
committerMax Filippov <jcmvbkbc@gmail.com>2019-09-01 22:11:57 +0200
commit09f8a6db20e6ed8eab1b2b23d09d2458f6e15062 (patch)
tree1c3b6baee5c51968f10d2af9c97e35208542ed53 /arch/xtensa/kernel/stacktrace.c
parentxtensa: clean up PS_WOE_BIT usage (diff)
downloadlinux-09f8a6db20e6ed8eab1b2b23d09d2458f6e15062.tar.xz
linux-09f8a6db20e6ed8eab1b2b23d09d2458f6e15062.zip
xtensa: add support for call0 ABI in userspace
Provide a Kconfig choice to select whether only the default ABI, only call0 ABI or both are supported. The default for XEA2 is windowed, but it may change for XEA3. Call0 only runs userspace with PS.WOE disabled. Supporting both windowed and call0 ABIs is tricky, as there's no indication in the ELF binaries which ABI they use. So it is done by probing: each process is started with PS.WOE disabled, but the handler of an illegal instruction exception taken with PS.WOE retries faulting instruction after enabling PS.WOE. It must happen before any signal is delivered to the process, otherwise it may be delivered incorrectly. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/stacktrace.c')
-rw-r--r--arch/xtensa/kernel/stacktrace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/stacktrace.c b/arch/xtensa/kernel/stacktrace.c
index b9f82510c650..c822abb93d20 100644
--- a/arch/xtensa/kernel/stacktrace.c
+++ b/arch/xtensa/kernel/stacktrace.c
@@ -44,6 +44,11 @@ void xtensa_backtrace_user(struct pt_regs *regs, unsigned int depth,
if (pc == 0 || pc >= TASK_SIZE || ufn(&frame, data))
return;
+ if (IS_ENABLED(CONFIG_USER_ABI_CALL0_ONLY) ||
+ (IS_ENABLED(CONFIG_USER_ABI_CALL0_PROBE) &&
+ !(regs->ps & PS_WOE_MASK)))
+ return;
+
/* Two steps:
*
* 1. Look through the register window for the