target/mips: Fix handling of LL/SC instructions after 7dd547e5
After 7dd547e5 the env->llval value is loaded as an unsigned value (instead of sign-extended as before). Therefore, the CMPXCHG in gen_st_cond() in translate.c fails if the sign bit is set in the loaded value. Fix this by sign-extending the llval value for the 32-bit case. I discovered this issue because FreeBSD MIPS64 was looping forever in an atomic helper function when trying to start /sbin/init. Signed-off-by: NAlex Richardson <Alexander.Richardson@cl.cam.ac.uk> Fixes: 7dd547e5 ("target/mips: Use cpu_*_mmuidx_ra instead of MMU_MODE*_SUFFIX") Buglink: https://bugs.launchpad.net/qemu/+bug/1861605 Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Aleksandar Markovic <amarkovic@wavecomp.com> Cc: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com> Cc: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: NJames Clarke <jrtc27@jrtc27.com> Signed-off-by: NAleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20200202153409.28534-1-jrtc27@jrtc27.com>
Showing
想要评论请 注册 或 登录