]> git.ipfire.org Git - thirdparty/qemu.git/commit
translate.c: Fix usermode big-endian AArch32 LDREXD and STREXD
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 7 Nov 2017 13:03:51 +0000 (13:03 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 6 Dec 2017 15:41:14 +0000 (09:41 -0600)
commitb637b865ed54d15de620b25f23d937845ebf91e5
tree0ac1c71cc5098be22a77d5e755105df16f382401
parent3342fd02863fac6a05db7f956abfc43341b190ab
translate.c: Fix usermode big-endian AArch32 LDREXD and STREXD

For AArch32 LDREXD and STREXD, architecturally the 32-bit word at the
lowest address is always Rt and the one at addr+4 is Rt2, even if the
CPU is big-endian. Our implementation does these with a single
64-bit store, so if we're big-endian then we need to put the two
32-bit halves together in the opposite order to little-endian,
so that they end up in the right places. We were trying to do
this with the gen_aa32_frob64() function, but that is not correct
for the usermode emulator, because there there is a distinction
between "load a 64 bit value" (which does a BE 64-bit access
and doesn't need swapping) and "load two 32 bit values as one
64 bit access" (where we still need to do the swapping, like
system mode BE32).

Fixes: https://bugs.launchpad.net/qemu/+bug/1725267
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 1509622400-13351-1-git-send-email-peter.maydell@linaro.org
(cherry picked from commit 3448d47b3172015006b79197eb5a69826c6a7b6d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target/arm/translate.c