From: Helge Deller
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects words to be stored
From: Helge Deller
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects words to be stored
From: Helge Deller
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects words to be stored
On 28/7/23 21:23, Helge Deller wrote:
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects
31.07.2023 12:26, Philippe Mathieu-Daudé wrote:
On 27/7/23 23:19, Helge Deller wrote:
Words are stored in big endian in the guest memory for armeb.
..
Reviewed-by: Philippe Mathieu-Daudé
There was a v3 of this patch already, fwiw.
/mjt
On 27/7/23 23:19, Helge Deller wrote:
Words are stored in big endian in the guest memory for armeb.
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with
host atomics") switched to use qatomic_cmpxchg() to swap a word with the
memory content, but missed to endianess-swap the oldv
On 7/28/23 22:57, Richard Henderson wrote:
On 7/28/23 13:51, Richard Henderson wrote:
On 7/28/23 12:23, Helge Deller wrote:
+ /* endianess-swap if emulating armeb */
+ oldval = tswap64(oldval);
+ newval = tswap64(newval);
Oh btw, it's not about arm vs armeb, but guest vs host.
This a
On 7/28/23 12:23, Helge Deller wrote:
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects
On 7/28/23 13:51, Richard Henderson wrote:
On 7/28/23 12:23, Helge Deller wrote:
+ /* endianess-swap if emulating armeb */
+ oldval = tswap64(oldval);
+ newval = tswap64(newval);
Oh btw, it's not about arm vs armeb, but guest vs host.
This also fixes armel on big-endian hosts.
Anywa
On 7/28/23 12:23, Helge Deller wrote:
+/* endianess-swap if emulating armeb */
+oldval = tswap64(oldval);
+newval = tswap64(newval);
Oh btw, it's not about arm vs armeb, but guest vs host.
This also fixes armel on big-endian hosts.
r~
On 7/28/23 17:35, Richard Henderson wrote:
On 7/27/23 21:54, Helge Deller wrote:
@@ -174,6 +175,10 @@ static void arm_kernel_cmpxchg64_helper(CPUARMState *env)
return;
}
+ /* endianess-swap if emulating armeb */
+ oldval = tswap32(oldval);
+ newval = tswap32(newval);
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects words to be stored in big endian in
the
On 7/27/23 21:54, Helge Deller wrote:
@@ -174,6 +175,10 @@ static void arm_kernel_cmpxchg64_helper(CPUARMState *env)
return;
}
+/* endianess-swap if emulating armeb */
+oldval = tswap32(oldval);
+newval = tswap32(newval);
Must be tswap64.
r~
Nitpick: the bug was introduced between 6.2.0 and 7.0.0, so "qemu >= v7.0.0"
~Markus
On 2023-07-28 06:54, Helge Deller wrote:
> Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
> atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
> content, but mi
The fix in arm_kernel_cmpxchg64_helper probably should use tswap64() instead
of tswap32().
~Markus
On 2023-07-28 06:54, Helge Deller wrote:
> Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
> atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
> c
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host
atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
content, but missed to endianess-swap the oldval and newval values when
emulating an armeb CPU, which expects words to be stored in big endian in
the
On 7/27/23 14:19, Helge Deller wrote:
Words are stored in big endian in the guest memory for armeb.
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with
host atomics") switched to use qatomic_cmpxchg() to swap a word with the
memory content, but missed to endianess-swap the oldv
Words are stored in big endian in the guest memory for armeb.
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with
host atomics") switched to use qatomic_cmpxchg() to swap a word with the
memory content, but missed to endianess-swap the oldval and newval
values when emulating an a
18 matches
Mail list logo