Home
last modified time | relevance | path

Searched hist:c8c0da6bdf0f0d6f59fc23aab6ee373a131df82d (Results 1 – 1 of 1) sorted by relevance

/linux/arch/mips/math-emu/
H A Dcp1emu.cdiff c8c0da6bdf0f0d6f59fc23aab6ee373a131df82d Wed Sep 24 11:45:37 CEST 2014 Paul Burton <paul.burton@imgtec.com> MIPS: Fix MFC1 & MFHC1 emulation for 64-bit MIPS systems

Commit bbd426f542cb "MIPS: Simplify FP context access" modified the
SIFROMREG & SIFROMHREG macros such that they return unsigned rather
than signed 32b integers. I had believed that to be fine, but
inadvertently missed the MFC1 & MFHC1 cases which write to a struct
pt_regs regs element. On MIPS32 this is fine, but on 64 bit those
saved regs' fields are 64 bit wide. Using unsigned values caused the
32 bit value from the FP register to be zero rather than sign extended
as the architecture specifies, causing incorrect emulation of the
MFC1 & MFHc1 instructions. Fix by reintroducing the casts to signed
integers, and therefore the sign extension.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: stable@vger.kernel.org # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7848/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>