[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out
From: |
David Woodhouse |
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 |
User-agent: |
Evolution 3.44.4-0ubuntu2 |
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... :)
smime.p7s
Description: S/MIME cryptographic signature
- [PATCH-for-9.0 01/10] sysemu/xen: Forbid using Xen headers in user emulation, (continued)
- [PATCH-for-9.0 01/10] sysemu/xen: Forbid using Xen headers in user emulation, Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 02/10] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix, Philippe Mathieu-Daudé, 2023/11/13
- [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
- [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq(), Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits(), Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 06/10] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources, Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE, Philippe Mathieu-Daudé, 2023/11/13