/* check for AArch32 breakpoint instructions */
if (!aarch32_break_handler(regs))
return;
- if (compat_thumb_mode(regs)) {
- if (get_user(instr, (u16 __user *)pc))
- goto die_sig;
- if (is_wide_instruction(instr)) {
- u32 instr2;
- if (get_user(instr2, (u16 __user *)pc+1))
+ if (user_mode(regs)) {
+ if (compat_thumb_mode(regs)) {
+ if (get_user(instr, (u16 __user *)pc))
goto die_sig;
- instr <<= 16;
- instr |= instr2;
+ if (is_wide_instruction(instr)) {
+ u32 instr2;
+ if (get_user(instr2, (u16 __user *)pc+1))
+ goto die_sig;
+ instr <<= 16;
+ instr |= instr2;
+ }
+ } else if (get_user(instr, (u32 __user *)pc)) {
+ goto die_sig;
}
-
- } else if ((get_user(instr, (u32 __user *)pc))) {
- goto die_sig;
+ } else {
+ /* kernel mode */
+ instr = *((u32 *)pc);
}
if (call_undef_hook(regs, instr) == 0)