From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, Eric Auger <eric.auger@redhat.com>
Subject: Re: [PATCH for-8.1] hw/arm/smmu: Handle big-endian hosts correctly
Date: Mon, 17 Jul 2023 16:11:44 +0200 [thread overview]
Message-ID: <f1ec6d82-af18-b399-4ef3-7a1249e705f4@redhat.com> (raw)
In-Reply-To: <20230717132641.764660-1-peter.maydell@linaro.org>
On 17/07/2023 15.26, Peter Maydell wrote:
> The implementation of the SMMUv3 has multiple places where it reads a
> data structure from the guest and directly operates on it without
> doing a guest-to-host endianness conversion. Since all SMMU data
> structures are little-endian, this means that the SMMU doesn't work
> on a big-endian host. In particular, this causes the Avocado test
> machine_aarch64_virt.py:Aarch64VirtMachine.test_alpine_virt_tcg_gic_max
> to fail on an s390x host.
>
> Add appropriate byte-swapping on reads and writes of guest in-memory
> data structures so that the device works correctly on big-endian
> hosts.
>
> As part of this we constrain queue_read() to operate only on Cmd
> structs and queue_write() on Evt structs, because in practice these
> are the only data structures the two functions are used with, and we
> need to know what the data structure is to be able to byte-swap its
> parts correctly.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> Cc: qemu-stable@nongnu.org
> ---
> hw/arm/smmu-common.c | 3 +--
> hw/arm/smmuv3.c | 39 +++++++++++++++++++++++++++++++--------
> 2 files changed, 32 insertions(+), 10 deletions(-)
Thanks, this fixes the alpine test for me:
Tested-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2023-07-17 14:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 13:26 [PATCH for-8.1] hw/arm/smmu: Handle big-endian hosts correctly Peter Maydell
2023-07-17 14:11 ` Thomas Huth [this message]
2023-07-17 15:03 ` Philippe Mathieu-Daudé
2023-07-17 16:15 ` Eric Auger
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=f1ec6d82-af18-b399-4ef3-7a1249e705f4@redhat.com \
--to=thuth@redhat.com \
--cc=eric.auger@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).