qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq()
@ 2023-11-13 15:58 Woodhouse, David
  2023-11-13 16:09 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 9+ messages in thread
From: Woodhouse, David @ 2023-11-13 15:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel@nongnu.org, Michael S. Tsirkin, Alex Bennée,
	Anthony Perard, xen-devel@lists.xenproject.org,
	Stefano Stabellini, qemu-block@nongnu.org, Thomas Huth,
	Paolo Bonzini, qemu-arm@nongnu.org, Paul Durrant, Peter Maydell,
	Richard Henderson, Eduardo Habkost, Marcel Apfelbaum

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]



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?

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.

Can we be explicit about what's expected to work here and what's not in scope?




Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.



[-- Attachment #2: Type: text/html, Size: 2480 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH-for-9.0 00/10] hw/xen: Have most of Xen files become target-agnostic
@ 2023-11-13 15:21 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é
  0 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-11-13 15:21 UTC (permalink / raw)
  To: David Woodhouse, qemu-devel
  Cc: Michael S. Tsirkin, Alex Bennée, Anthony Perard, xen-devel,
	Stefano Stabellini, qemu-block, Thomas Huth, Paolo Bonzini,
	qemu-arm, Paul Durrant, Philippe Mathieu-Daudé

Hi,

After discussing with Alex Bennée I realized most Xen code
should be target-agnostic. David Woodhouse confirmed that
last week, so I had a quick look and here is the result.

More work is required to be able to instanciate Xen HW in
an heterogeneous machine, but this doesn't make sense yet
until we can run multiple accelerators concurrently.

Only build-tested.

Regards,

Phil.

Philippe Mathieu-Daudé (10):
  sysemu/xen: Forbid using Xen headers in user emulation
  hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix
  hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h'
  hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq()
  hw/xen: Use target-agnostic qemu_target_page_bits()
  hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources
  sysemu/xen-mapcache: Check Xen availability with
    CONFIG_XEN_IS_POSSIBLE
  system/physmem: Only include 'hw/xen/xen.h' when Xen is available
  hw/xen: Extract 'xen_igd.h' from 'xen_pt.h'
  hw/xen: Have most of Xen files become target-agnostic

 hw/xen/xen_pt.h                 | 14 --------------
 include/hw/arm/xen_arch_hvm.h   |  9 ---------
 include/hw/i386/xen_arch_hvm.h  | 11 -----------
 include/hw/xen/arch_hvm.h       |  5 -----
 include/hw/xen/xen-hvm-common.h |  8 +++++++-
 include/hw/xen/xen_igd.h        | 23 +++++++++++++++++++++++
 include/sysemu/xen-mapcache.h   |  3 ++-
 include/sysemu/xen.h            |  8 ++++----
 accel/xen/xen-all.c             |  1 +
 hw/arm/xen_arm.c                | 14 +++++++++++---
 hw/i386/pc_piix.c               |  1 +
 hw/i386/xen/xen-hvm.c           | 16 ++++++++++++----
 hw/xen/xen-hvm-common.c         | 16 +++++++---------
 hw/xen/xen_pt.c                 |  3 ++-
 hw/xen/xen_pt_config_init.c     |  3 ++-
 hw/xen/xen_pt_graphics.c        |  3 ++-
 hw/xen/xen_pt_stub.c            |  2 +-
 system/physmem.c                |  5 ++++-
 accel/xen/meson.build           |  2 +-
 hw/block/dataplane/meson.build  |  2 +-
 hw/xen/meson.build              | 13 ++++---------
 21 files changed, 85 insertions(+), 77 deletions(-)
 delete mode 100644 include/hw/arm/xen_arch_hvm.h
 delete mode 100644 include/hw/i386/xen_arch_hvm.h
 delete mode 100644 include/hw/xen/arch_hvm.h
 create mode 100644 include/hw/xen/xen_igd.h

-- 
2.41.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-14 13:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- 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é

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).