From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Woodhouse, David" <dwmw@amazon.co.uk>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Anthony Perard" <anthony.perard@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"Thomas Huth" <thuth@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"Paul Durrant" <paul@xen.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq()
Date: Mon, 13 Nov 2023 17:09:37 +0100 [thread overview]
Message-ID: <7a66c289-19e1-4690-8c6e-31a9f6344b6f@linaro.org> (raw)
In-Reply-To: <f791a822-f6f5-44fa-904b-f67d3f193763@email.android.com>
On 13/11/23 16:58, Woodhouse, David wrote:
> On 13 Nov 2023 10:22, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Per commit f17068c1c7 ("xen-hvm: reorganize xen-hvm and move common
> function to xen-hvm-common"), handle_ioreq() is expected to be
> target-agnostic. However it uses 'target_ulong', which is a target
> specific definition.
>
> In order to compile this file once for all targets, factor the
> target-specific code out of handle_ioreq() as a per-target handler
> called xen_arch_align_ioreq_data().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> Should we have a 'unsigned qemu_target_long_bits();' helper
> such qemu_target_page_foo() API and target_words_bigendian()?
>
>
> It can be more fun than that though. What about
> qemu_target_alignof_uint64() for example, which differs between i386 and
> x86_64 and causes even structs with *explicitly* sized fields to differ
> because of padding.
>
> I'd *love* to see this series as a step towards my fantasy of being able
> to support Xen under TCG. After all, without that what's the point in
> being target-agnostic?
Another win is we are building all these files once instead of one for
each i386/x86_64/aarch64 targets, so we save CI time and Amazon trees.
> However, I am mildly concerned that some of these files are accidentally
> using the host ELF ABI, perhaps with explicit management of 32-bit
> compatibility, and the target-agnosticity is purely an illusion?
>
> See the "protocol" handling and the three ABIs for the ring in
> xen-block, for example.
If so I'd expect build failures or violent runtime assertions.
Reviewing quickly hw/block/dataplane/xen-block.c, this code doesn't
seem target specific at all IMHO. Otherwise I'd really expect it to
fail compiling. But I don't know much about Xen, so I'll let block &
xen experts to have a look.
> Can we be explicit about what's expected to work here and what's not in
> scope?
What do you mean? Everything is expected to work like without this
series applied :)
Regards,
Phil.
next prev parent reply other threads:[~2023-11-13 16:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 15:58 [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq() Woodhouse, David
2023-11-13 16:09 ` Philippe Mathieu-Daudé [this message]
2023-11-13 17:11 ` David Woodhouse
2023-11-14 7:58 ` Philippe Mathieu-Daudé
2023-11-14 13:49 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2023-11-13 15:21 [PATCH-for-9.0 00/10] hw/xen: Have most of Xen files become target-agnostic Philippe Mathieu-Daudé
2023-11-13 15:21 ` [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq() Philippe Mathieu-Daudé
2023-11-13 17:36 ` David Woodhouse
2023-11-13 18:16 ` Richard Henderson
2023-11-14 7: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=7a66c289-19e1-4690-8c6e-31a9f6344b6f@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=anthony.perard@citrix.com \
--cc=dwmw@amazon.co.uk \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sstabellini@kernel.org \
--cc=thuth@redhat.com \
--cc=xen-devel@lists.xenproject.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).