[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/26] target/arm: Fix stlxp for aarch64_be
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 08/26] target/arm: Fix stlxp for aarch64_be |
Date: |
Thu, 11 Jan 2018 13:38:04 +0000 |
From: Michael Weiser <address@hidden>
ldxp loads two consecutive doublewords from memory regardless of CPU
endianness. On store, stlxp currently assumes to work with a 128bit
value and consequently switches order in big-endian mode. With this
change it packs the doublewords in reverse order in anticipation of the
128bit big-endian store operation interposing them so they end up in
memory in the right order. This makes it work for both MTTCG and !MTTCG.
It effectively implements the ARM ARM STLXP operation pseudo-code:
data = if BigEndian() then el1:el2 else el2:el1;
With this change an aarch64_be Linux 4.14.4 kernel succeeds to boot up
in system emulation mode.
Signed-off-by: Michael Weiser <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
target/arm/helper-a64.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c
index b84ebca..3e00a9e 100644
--- a/target/arm/helper-a64.c
+++ b/target/arm/helper-a64.c
@@ -506,8 +506,11 @@ static uint64_t do_paired_cmpxchg64_be(CPUARMState *env,
uint64_t addr,
Int128 oldv, cmpv, newv;
bool success;
- cmpv = int128_make128(env->exclusive_val, env->exclusive_high);
- newv = int128_make128(new_lo, new_hi);
+ /* high and low need to be switched here because this is not actually a
+ * 128bit store but two doublewords stored consecutively
+ */
+ cmpv = int128_make128(env->exclusive_high, env->exclusive_val);
+ newv = int128_make128(new_hi, new_lo);
if (parallel) {
#ifndef CONFIG_ATOMIC128
--
2.7.4
- [Qemu-devel] [PULL 00/26] target-arm queue, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 08/26] target/arm: Fix stlxp for aarch64_be,
Peter Maydell <=
- [Qemu-devel] [PULL 11/26] imx_fec: Refactor imx_eth_enable_rx(), Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 09/26] Virt: ACPI: fix qemu assert due to re-assigned table data address, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 05/26] linux-user: Add aarch64_be magic numbers to qemu-binfmt-conf.sh, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 13/26] imx_fec: Move Tx frame buffer away from the stack, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 04/26] configure: Add aarch64_be-linux-user target, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 01/26] linux-user: Add support for big-endian aarch64, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 18/26] imx_fec: Use correct length for packet size, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 10/26] imx_fec: Do not link to netdev, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 03/26] linux-user: Fix endianess of aarch64 signal trampoline, Peter Maydell, 2018/01/11
- [Qemu-devel] [PULL 12/26] imx_fec: Change queue flushing heuristics, Peter Maydell, 2018/01/11