diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2015-01-12 09:44:44 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2019-09-01 13:11:57 -0700 |
commit | 09f8a6db20e6ed8eab1b2b23d09d2458f6e15062 (patch) | |
tree | 1c3b6baee5c51968f10d2af9c97e35208542ed53 /arch/xtensa/kernel/traps.c | |
parent | 9e1e41c44782741c727688a19e5624d039b0de7e (diff) | |
download | linux-09f8a6db20e6ed8eab1b2b23d09d2458f6e15062.tar.gz linux-09f8a6db20e6ed8eab1b2b23d09d2458f6e15062.tar.bz2 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/traps.c')
-rw-r--r-- | arch/xtensa/kernel/traps.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index f060348c1b23..4a6c495ce9b6 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -51,6 +51,7 @@ extern void kernel_exception(void); extern void user_exception(void); +extern void fast_illegal_instruction_user(void); extern void fast_syscall_user(void); extern void fast_alloca(void); extern void fast_unaligned(void); @@ -87,6 +88,9 @@ typedef struct { static dispatch_init_table_t __initdata dispatch_init_table[] = { +#ifdef CONFIG_USER_ABI_CALL0_PROBE +{ EXCCAUSE_ILLEGAL_INSTRUCTION, USER, fast_illegal_instruction_user }, +#endif { EXCCAUSE_ILLEGAL_INSTRUCTION, 0, do_illegal_instruction}, { EXCCAUSE_SYSTEM_CALL, USER, fast_syscall_user }, { EXCCAUSE_SYSTEM_CALL, 0, system_call }, |