From: Richard Henderson <richard.henderson@linaro.org>
To: Helge Deller <deller@gmx.de>, Laurent Vivier <laurent@vivier.eu>,
qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
John Reiser <jreiser@bitwagon.com>,
"Markus F.X.J. Oberhumer" <markus@oberhumer.com>
Subject: Re: [PATCH v3] linux-user/armeb: Fix __kernel_cmpxchg() for armeb
Date: Fri, 28 Jul 2023 13:49:57 -0700 [thread overview]
Message-ID: <60dba863-e6e6-f72a-a40a-4dec37b76a9d@linaro.org> (raw)
In-Reply-To: <ZMQVnqY+F+5sTNFd@p100>
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 words to be stored in big endian in
> the guest memory.
>
> The bug can be verified with qemu >= v7.0 on any little-endian host, when
> starting the armeb binary of the upx program, which just hangs without
> this patch.
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: qemu-stable@nongnu.org
> Reported-by: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
> Reported-by: John Reiser <jreiser@BitWagon.com>
> Closes: https://github.com/upx/upx/issues/687
>
> --
> v3:
> - use tswap64() in arm_kernel_cmpxchg64_helper() [review from Richard]
> - mention that bug exists since qemu v7.0 [info from Markus]
> v2:
> - add tswap32() in arm_kernel_cmpxchg64_helper() [bisected by John]
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2023-07-28 20:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 19:23 [PATCH v3] linux-user/armeb: Fix __kernel_cmpxchg() for armeb Helge Deller
2023-07-28 20:49 ` Richard Henderson [this message]
2023-07-28 20:51 ` Richard Henderson
2023-07-28 20:57 ` Richard Henderson
2023-07-28 21:03 ` Helge Deller
2023-07-31 9:42 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60dba863-e6e6-f72a-a40a-4dec37b76a9d@linaro.org \
--to=richard.henderson@linaro.org \
--cc=deller@gmx.de \
--cc=jreiser@bitwagon.com \
--cc=laurent@vivier.eu \
--cc=markus@oberhumer.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).