| .. | .. |
|---|
| 19 | 19 | #include <linux/init.h> |
|---|
| 20 | 20 | #include <linux/sched/signal.h> |
|---|
| 21 | 21 | #include <linux/uaccess.h> |
|---|
| 22 | +#include <linux/dovetail.h> |
|---|
| 22 | 23 | |
|---|
| 23 | 24 | #include <asm/cp15.h> |
|---|
| 24 | 25 | #include <asm/system_info.h> |
|---|
| .. | .. |
|---|
| 807 | 808 | u16 tinstr = 0; |
|---|
| 808 | 809 | int isize = 4; |
|---|
| 809 | 810 | int thumb2_32b = 0; |
|---|
| 810 | | - int fault; |
|---|
| 811 | + int fault, ret = 0; |
|---|
| 811 | 812 | |
|---|
| 812 | 813 | if (interrupts_enabled(regs)) |
|---|
| 813 | | - local_irq_enable(); |
|---|
| 814 | + hard_local_irq_enable(); |
|---|
| 815 | + |
|---|
| 816 | + mark_trap_entry(ARM_TRAP_ALIGNMENT, regs); |
|---|
| 814 | 817 | |
|---|
| 815 | 818 | instrptr = instruction_pointer(regs); |
|---|
| 816 | 819 | |
|---|
| .. | .. |
|---|
| 938 | 941 | if (thumb_mode(regs)) |
|---|
| 939 | 942 | regs->ARM_cpsr = it_advance(regs->ARM_cpsr); |
|---|
| 940 | 943 | |
|---|
| 941 | | - return 0; |
|---|
| 944 | + goto out; |
|---|
| 942 | 945 | |
|---|
| 943 | 946 | bad_or_fault: |
|---|
| 944 | 947 | if (type == TYPE_ERROR) |
|---|
| .. | .. |
|---|
| 947 | 950 | * We got a fault - fix it up, or die. |
|---|
| 948 | 951 | */ |
|---|
| 949 | 952 | do_bad_area(addr, fsr, regs); |
|---|
| 950 | | - return 0; |
|---|
| 953 | + goto out; |
|---|
| 951 | 954 | |
|---|
| 952 | 955 | swp: |
|---|
| 953 | 956 | pr_err("Alignment trap: not handling swp instruction\n"); |
|---|
| .. | .. |
|---|
| 961 | 964 | isize << 1, |
|---|
| 962 | 965 | isize == 2 ? tinstr : instr, instrptr); |
|---|
| 963 | 966 | ai_skipped += 1; |
|---|
| 964 | | - return 1; |
|---|
| 967 | + ret = 1; |
|---|
| 968 | + goto out; |
|---|
| 965 | 969 | |
|---|
| 966 | 970 | user: |
|---|
| 967 | 971 | ai_user += 1; |
|---|
| .. | .. |
|---|
| 992 | 996 | * entry-common.S) and disable the alignment trap only if |
|---|
| 993 | 997 | * there is no work pending for this thread. |
|---|
| 994 | 998 | */ |
|---|
| 995 | | - raw_local_irq_disable(); |
|---|
| 999 | + hard_local_irq_disable(); |
|---|
| 996 | 1000 | if (!(current_thread_info()->flags & _TIF_WORK_MASK)) |
|---|
| 997 | 1001 | set_cr(cr_no_alignment); |
|---|
| 998 | 1002 | } |
|---|
| 999 | 1003 | |
|---|
| 1000 | | - return 0; |
|---|
| 1004 | +out: |
|---|
| 1005 | + mark_trap_exit(ARM_TRAP_ALIGNMENT, regs); |
|---|
| 1006 | + |
|---|
| 1007 | + return ret; |
|---|
| 1001 | 1008 | } |
|---|
| 1002 | 1009 | |
|---|
| 1003 | 1010 | static int __init noalign_setup(char *__unused) |
|---|