qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH-for-8.0 00/10] hw/virtio: Build most objects as target independent units
@ 2022-12-12 23:05 Philippe Mathieu-Daudé
  2022-12-12 23:05 ` [PATCH-for-8.0 01/10] hw/virtio: Add missing "hw/core/cpu.h" include Philippe Mathieu-Daudé
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-12 23:05 UTC (permalink / raw)
  To: qemu-devel, Thomas Huth
  Cc: Greg Kurz, Stefan Hajnoczi, Kevin Wolf, qemu-block, Paolo Bonzini,
	Michael S. Tsirkin, Alex Bennée, Jason Wang,
	Marc-André Lureau, Christian Schoenebeck, Hanna Reitz,
	Philippe Mathieu-Daudé

Currently the inlined virtio_access_is_big_endian() function
"hw/virtio/virtio-access.h" which is used by all I/O accesses
force any virtio device to be built as target-dependent object.

This series isolates the few VirtIO target specific bits, trying
to not impact the performance (a function is un-inlined once
not in the hot path).

At the end only 6 files remain in the target specific source set,
all other files are built once.

On a Linux/x86_64 host when building QEMU configured with
--disable-user, before this series a "make clean all" builds
7713 objects, after it only build 6831... I don't think my maths
are correct, because that would save building a few hundreds objects.

RFC because only build-tested.

Regards,

Phil.

Philippe Mathieu-Daudé (10):
  hw/virtio: Add missing "hw/core/cpu.h" include
  hw/virtio: Rename virtio_ss[] -> specific_virtio_ss[]
  hw/virtio: Constify qmp_virtio_feature_map_t[]
  hw/virtio: Extract config read/write accessors to virtio-config.c
  hw/virtio: Extract QMP related code virtio-qmp.c
  hw/virtio: Cache access_is_big_endian value in VirtIODevice state
  hw/virtio: Directly access cached VirtIODevice::access_is_big_endian
  hw/virtio: Un-inline virtio_access_is_big_endian()
  hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c
  hw/virtio: Make most of virtio devices target-independent

 hw/9pfs/meson.build               |   2 +-
 hw/block/dataplane/meson.build    |   2 +-
 hw/block/meson.build              |   4 +-
 hw/char/meson.build               |   2 +-
 hw/net/meson.build                |   2 +-
 hw/virtio/meson.build             |  45 +-
 hw/virtio/vhost-user-target.c     |  29 ++
 hw/virtio/vhost-user.c            |  26 +-
 hw/virtio/virtio-config.c         | 224 +++++++++
 hw/virtio/virtio-qmp.c            | 631 +++++++++++++++++++++++
 hw/virtio/virtio-qmp.h            |  20 +
 hw/virtio/virtio.c                | 799 +-----------------------------
 include/hw/virtio/vhost-user.h    |   7 +
 include/hw/virtio/virtio-access.h |  63 +--
 include/hw/virtio/virtio.h        |   1 +
 15 files changed, 974 insertions(+), 883 deletions(-)
 create mode 100644 hw/virtio/vhost-user-target.c
 create mode 100644 hw/virtio/virtio-config.c
 create mode 100644 hw/virtio/virtio-qmp.c
 create mode 100644 hw/virtio/virtio-qmp.h

-- 
2.38.1



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

end of thread, other threads:[~2025-04-11 10:16 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 23:05 [RFC PATCH-for-8.0 00/10] hw/virtio: Build most objects as target independent units Philippe Mathieu-Daudé
2022-12-12 23:05 ` [PATCH-for-8.0 01/10] hw/virtio: Add missing "hw/core/cpu.h" include Philippe Mathieu-Daudé
2022-12-12 23:05 ` [PATCH-for-8.0 02/10] hw/virtio: Rename virtio_ss[] -> specific_virtio_ss[] Philippe Mathieu-Daudé
2022-12-12 23:05 ` [PATCH-for-8.0 03/10] hw/virtio: Constify qmp_virtio_feature_map_t[] Philippe Mathieu-Daudé
2022-12-13  0:02   ` Richard Henderson
2022-12-13  7:35     ` Philippe Mathieu-Daudé
2022-12-12 23:05 ` [PATCH-for-8.0 04/10] hw/virtio: Extract config read/write accessors to virtio-config.c Philippe Mathieu-Daudé
2022-12-12 23:05 ` [PATCH-for-8.0 05/10] hw/virtio: Extract QMP related code virtio-qmp.c Philippe Mathieu-Daudé
2022-12-12 23:05 ` [RFC PATCH-for-8.0 06/10] hw/virtio: Cache access_is_big_endian value in VirtIODevice state Philippe Mathieu-Daudé
2022-12-13  0:14   ` Richard Henderson
2022-12-13  7:30     ` Philippe Mathieu-Daudé
2022-12-13  8:03       ` Thomas Huth
2022-12-13  8:32         ` Philippe Mathieu-Daudé
2022-12-13  8:47           ` Thomas Huth
2022-12-13  8:22       ` Philippe Mathieu-Daudé
2022-12-13 15:41       ` Richard Henderson
2022-12-12 23:05 ` [RFC PATCH-for-8.0 07/10] hw/virtio: Directly access cached VirtIODevice::access_is_big_endian Philippe Mathieu-Daudé
2022-12-13 10:50   ` Greg Kurz
2022-12-12 23:05 ` [PATCH-for-8.0 08/10] hw/virtio: Un-inline virtio_access_is_big_endian() Philippe Mathieu-Daudé
2022-12-12 23:05 ` [RFC PATCH-for-8.0 09/10] hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c Philippe Mathieu-Daudé
2025-04-10 12:14   ` Philippe Mathieu-Daudé
2025-04-10 14:36     ` Pierrick Bouvier
2025-04-10 17:21       ` Philippe Mathieu-Daudé
2025-04-10 17:29         ` Pierrick Bouvier
2025-04-11 10:15           ` Philippe Mathieu-Daudé
2022-12-12 23:05 ` [RFC PATCH-for-8.0 10/10] hw/virtio: Make most of virtio devices target-independent 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).