[PATCH 31/48] MIPS: Correct MIPS16 BREAK code interpretation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Correct the interpretation of the immediate MIPS16 BREAK instruction 
code embedded in the instruction word across bits 10:5 rather than 11:6 
as current code implies, fixing the interpretation of integer overflow 
and divide by zero traps.

Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
---
linux-mips-do-bp16.diff
Index: linux/arch/mips/kernel/traps.c
===================================================================
--- linux.orig/arch/mips/kernel/traps.c	2015-04-02 20:27:54.637186000 +0100
+++ linux/arch/mips/kernel/traps.c	2015-04-02 20:27:56.610207000 +0100
@@ -925,7 +925,7 @@ asmlinkage void do_bp(struct pt_regs *re
 			if (__get_user(instr[0],
 				       (u16 __user *)msk_isa16_mode(epc)))
 				goto out_sigsegv;
-			bcode = (instr[0] >> 6) & 0x3f;
+			bcode = (instr[0] >> 5) & 0x3f;
 			do_trap_or_bp(regs, bcode, "Break");
 			goto out;
 		}





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux