Commit 3522bcfe authored by Max Filippov's avatar Max Filippov

xtensa: always install slow handler for unaligned access exception

Currently slow handler for unaligned access exception is not installed
when CPU has hardware support for unaligned access. However some opcodes
(e.g. l32ai, s32ri, s32c1i) would still raise unaligned access exception
even on such CPUs. In that case instead of SIGBUS and a diagnostic entry
in the kernel log the faulting process would receive SIGILL.
Always install slow handler for unaligned access exception to fix that.
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent 67e88622
...@@ -54,9 +54,7 @@ static void do_interrupt(struct pt_regs *regs); ...@@ -54,9 +54,7 @@ static void do_interrupt(struct pt_regs *regs);
#if XTENSA_FAKE_NMI #if XTENSA_FAKE_NMI
static void do_nmi(struct pt_regs *regs); static void do_nmi(struct pt_regs *regs);
#endif #endif
#if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
static void do_unaligned_user(struct pt_regs *regs); static void do_unaligned_user(struct pt_regs *regs);
#endif
static void do_multihit(struct pt_regs *regs); static void do_multihit(struct pt_regs *regs);
#if XTENSA_HAVE_COPROCESSORS #if XTENSA_HAVE_COPROCESSORS
static void do_coprocessor(struct pt_regs *regs); static void do_coprocessor(struct pt_regs *regs);
...@@ -102,9 +100,9 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = { ...@@ -102,9 +100,9 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = {
#ifdef CONFIG_XTENSA_UNALIGNED_USER #ifdef CONFIG_XTENSA_UNALIGNED_USER
{ EXCCAUSE_UNALIGNED, USER, fast_unaligned }, { EXCCAUSE_UNALIGNED, USER, fast_unaligned },
#endif #endif
{ EXCCAUSE_UNALIGNED, 0, do_unaligned_user },
{ EXCCAUSE_UNALIGNED, KRNL, fast_unaligned }, { EXCCAUSE_UNALIGNED, KRNL, fast_unaligned },
#endif #endif
{ EXCCAUSE_UNALIGNED, 0, do_unaligned_user },
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
{ EXCCAUSE_ITLB_MISS, 0, do_page_fault }, { EXCCAUSE_ITLB_MISS, 0, do_page_fault },
{ EXCCAUSE_ITLB_MISS, USER|KRNL, fast_second_level_miss}, { EXCCAUSE_ITLB_MISS, USER|KRNL, fast_second_level_miss},
...@@ -356,7 +354,6 @@ static void do_div0(struct pt_regs *regs) ...@@ -356,7 +354,6 @@ static void do_div0(struct pt_regs *regs)
* accesses causes from user space. * accesses causes from user space.
*/ */
#if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
static void do_unaligned_user(struct pt_regs *regs) static void do_unaligned_user(struct pt_regs *regs)
{ {
__die_if_kernel("Unhandled unaligned exception in kernel", __die_if_kernel("Unhandled unaligned exception in kernel",
...@@ -368,7 +365,6 @@ static void do_unaligned_user(struct pt_regs *regs) ...@@ -368,7 +365,6 @@ static void do_unaligned_user(struct pt_regs *regs)
task_pid_nr(current), regs->pc); task_pid_nr(current), regs->pc);
force_sig_fault(SIGBUS, BUS_ADRALN, (void *) regs->excvaddr); force_sig_fault(SIGBUS, BUS_ADRALN, (void *) regs->excvaddr);
} }
#endif
#if XTENSA_HAVE_COPROCESSORS #if XTENSA_HAVE_COPROCESSORS
static void do_coprocessor(struct pt_regs *regs) static void do_coprocessor(struct pt_regs *regs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment