• Maciej W. Rozycki's avatar
    MIPS: math-emu: Make microMIPS branch delay slot emulation work · 733b8bc1
    Maciej W. Rozycki authored
    Complement commit 102cedc3 ("MIPS: microMIPS: Floating point
    support.") which introduced microMIPS FPU emulation, but did not adjust
    the encoding of the BREAK instruction used to terminate the branch delay
    slot emulation frame.  Consequently the execution of any such frame is
    indeterminate and, depending on CPU configuration, will result in random
    code execution or an offending program being terminated with SIGILL.
    
    This is because the regular MIPS BREAK instruction is encoded with the 0
    major and the 0xd minor opcode, however in the microMIPS instruction set
    this major/minor opcode pair denotes an encoding reserved for the DSP
    ASE.  Instead the microMIPS BREAK instruction is encoded with the 0
    major and the 0x7 minor opcode.
    
    Use the correct BREAK encoding for microMIPS FPU emulation then.
    Signed-off-by: default avatarMaciej W. Rozycki <macro@imgtec.com>
    Cc: Aurelien Jarno <aurelien@aurel32.net>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/12174/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    733b8bc1
dsemul.c 4.93 KB