aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/alignment.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/alignment.c')
-rw-r--r--arch/arm/mm/alignment.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 6f4585b89078..924036473b16 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -25,6 +25,7 @@
25#include <asm/cp15.h> 25#include <asm/cp15.h>
26#include <asm/system_info.h> 26#include <asm/system_info.h>
27#include <asm/unaligned.h> 27#include <asm/unaligned.h>
28#include <asm/opcodes.h>
28 29
29#include "fault.h" 30#include "fault.h"
30 31
@@ -762,21 +763,25 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
762 if (thumb_mode(regs)) { 763 if (thumb_mode(regs)) {
763 u16 *ptr = (u16 *)(instrptr & ~1); 764 u16 *ptr = (u16 *)(instrptr & ~1);
764 fault = probe_kernel_address(ptr, tinstr); 765 fault = probe_kernel_address(ptr, tinstr);
766 tinstr = __mem_to_opcode_thumb16(tinstr);
765 if (!fault) { 767 if (!fault) {
766 if (cpu_architecture() >= CPU_ARCH_ARMv7 && 768 if (cpu_architecture() >= CPU_ARCH_ARMv7 &&
767 IS_T32(tinstr)) { 769 IS_T32(tinstr)) {
768 /* Thumb-2 32-bit */ 770 /* Thumb-2 32-bit */
769 u16 tinst2 = 0; 771 u16 tinst2 = 0;
770 fault = probe_kernel_address(ptr + 1, tinst2); 772 fault = probe_kernel_address(ptr + 1, tinst2);
771 instr = (tinstr << 16) | tinst2; 773 tinst2 = __mem_to_opcode_thumb16(tinst2);
774 instr = __opcode_thumb32_compose(tinstr, tinst2);
772 thumb2_32b = 1; 775 thumb2_32b = 1;
773 } else { 776 } else {
774 isize = 2; 777 isize = 2;
775 instr = thumb2arm(tinstr); 778 instr = thumb2arm(tinstr);
776 } 779 }
777 } 780 }
778 } else 781 } else {
779 fault = probe_kernel_address(instrptr, instr); 782 fault = probe_kernel_address(instrptr, instr);
783 instr = __mem_to_opcode_arm(instr);
784 }
780 785
781 if (fault) { 786 if (fault) {
782 type = TYPE_FAULT; 787 type = TYPE_FAULT;