From: David Woodhouse <dwmw2@infradead.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Anthony Perard" <anthony.perard@citrix.com>,
xen-devel@lists.xenproject.org,
"Stefano Stabellini" <sstabellini@kernel.org>,
qemu-block@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
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 12:36:03 -0500 [thread overview]
Message-ID: <6e69e337e87a16f1774b54e60392ec986d70aaff.camel@infradead.org> (raw)
In-Reply-To: <20231113152114.47916-5-philmd@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé 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>
I prefer commits like this to explicitly state 'No function change
intended', and on that basis:
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
But...
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -699,6 +699,14 @@ void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section,
> }
> }
>
> +void xen_arch_align_ioreq_data(ioreq_t *req)
> +{
> + if (!req->data_is_ptr && (req->dir == IOREQ_WRITE)
> + && (req->size < sizeof(target_ulong))) {
> + req->data &= ((target_ulong) 1 << (8 * req->size)) - 1;
> + }
> +}
> +
If a 64-bit Xen host is running a 32-bit guest, what is target_ulong,
and what is the actual alignment? I think we are actually communicating
with the 64-bit Xen and it's 64 bits, although the *guest* is 32?
I guess the only time when this would matter is when using
qemu-system-i386 as the device model on 64-bit Xen? And that's not
going to work for various reasons including this?
(I should clarify that I'm not objecting to your patch series, but I
just to understand just what the situation is, before you make it
*look* saner than it is... :)
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2023-11-13 17:37 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
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 01/10] sysemu/xen: Forbid using Xen headers in user emulation Philippe Mathieu-Daudé
2023-11-13 18:10 ` Richard Henderson
2023-11-13 20:13 ` David Woodhouse
2023-11-13 15:21 ` [PATCH-for-9.0 02/10] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix Philippe Mathieu-Daudé
2023-11-13 17:29 ` David Woodhouse
2023-11-13 18:12 ` Richard Henderson
2023-11-13 15:21 ` [PATCH-for-9.0 03/10] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h' Philippe Mathieu-Daudé
2023-11-13 17:30 ` David Woodhouse
2023-11-13 18:13 ` Richard Henderson
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 [this message]
2023-11-13 18:16 ` Richard Henderson
2023-11-14 7:42 ` Philippe Mathieu-Daudé
2023-11-13 15:21 ` [PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits() Philippe Mathieu-Daudé
2023-11-13 18:18 ` Richard Henderson
2023-11-13 19:39 ` David Woodhouse
2023-11-13 15:21 ` [PATCH-for-9.0 06/10] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources Philippe Mathieu-Daudé
2023-11-13 18:19 ` Richard Henderson
2023-11-13 19:40 ` David Woodhouse
2023-11-13 15:21 ` [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Philippe Mathieu-Daudé
2023-11-13 19:52 ` David Woodhouse
2023-11-14 12:25 ` Philippe Mathieu-Daudé
2023-11-14 13:18 ` David Woodhouse
2023-11-14 13:55 ` Philippe Mathieu-Daudé
2023-11-13 15:21 ` [PATCH-for-9.0 08/10] system/physmem: Only include 'hw/xen/xen.h' when Xen is available Philippe Mathieu-Daudé
2023-11-13 20:03 ` David Woodhouse
2023-11-14 7:43 ` Philippe Mathieu-Daudé
2023-11-13 15:21 ` [PATCH-for-9.0 09/10] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Philippe Mathieu-Daudé
2023-11-13 20:09 ` David Woodhouse
2023-11-13 15:21 ` [PATCH-for-9.0 10/10] hw/xen: Have most of Xen files become target-agnostic Philippe Mathieu-Daudé
2023-11-13 20:12 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
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é
2023-11-13 17:11 ` David Woodhouse
2023-11-14 7:58 ` Philippe Mathieu-Daudé
2023-11-14 13:49 ` David Woodhouse
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=6e69e337e87a16f1774b54e60392ec986d70aaff.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=alex.bennee@linaro.org \
--cc=anthony.perard@citrix.com \
--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=philmd@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).