[PATCH v5 0/9] single-binary: hw/virtio

Pierrick Bouvier posted 9 patches 5 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260206221908.1451528-1-pierrick.bouvier@linaro.org
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>
include/hw/ppc/spapr.h            |  8 +---
include/hw/ppc/spapr_common.h     | 16 +++++++
include/hw/virtio/virtio-access.h | 43 +++++++++----------
include/hw/virtio/virtio.h        |  7 +++-
hw/virtio/vhost-user.c            | 11 ++---
hw/virtio/virtio-qmp.c            | 70 -------------------------------
hw/virtio/virtio.c                |  9 +++-
hw/virtio/meson.build             | 17 ++++----
8 files changed, 60 insertions(+), 121 deletions(-)
create mode 100644 include/hw/ppc/spapr_common.h
[PATCH v5 0/9] single-binary: hw/virtio
Posted by Pierrick Bouvier 5 hours ago
This series eliminates target specifics in hw/virtio and replace them with
runtime functions where needed.

Performance has been measured with this automated fio benchmark [1], with
original instructions from Stefan [2].

Download artifacts and run benchmark with:
$ wget https://github.com/pbo-linaro/qemu-linux-stack/releases/download/build/x86_64_io_benchmark-a55f2d6.tar.xz
$ tar xvf x86_64_io_benchmark-a55f2d6.tar.xz
$ ./run.sh /path/to/qemu-system-x86_64

[1] https://github.com/pbo-linaro/qemu-linux-stack/tree/x86_64_io_benchmark
[2] https://lore.kernel.org/qemu-devel/20260202185233.GC405548@fedora/

Results are on 20 runs and expressed in kIOPS:
reference: mean=239.2 std_dev=3.48
with_series: mean=238.5 std_dev=3.46

Performance is on par, and within standard deviation.

v5
--

- Fix missing vdev->access_is_big_endian when features are set
- No difference in performance since hot path is not modified
- Simplified virtio_access_is_big_endian

v4
--

- Include Philippe patches computing once device endianness to skip runtime
  checks on every access.

Philippe Mathieu-Daudé (3):
  hw/virtio: Constify virtio_is_big_endian() argument
  hw/virtio: Introduce VirtIODevice::access_is_big_endian boolean field
  hw/virtio: Use VirtIODevice::access_is_big_endian field

Pierrick Bouvier (6):
  include/hw/virtio/virtio-access.h: remove target specifics define
  include/hw/virtio/virtio-access.h: simplify
    virtio_access_is_big_endian
  include/hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header
  hw/virtio/vhost-user: make compilation unit common
  hw/virtio/virtio-qmp: make compilation unit common
  hw/virtio/: make all compilation units common

 include/hw/ppc/spapr.h            |  8 +---
 include/hw/ppc/spapr_common.h     | 16 +++++++
 include/hw/virtio/virtio-access.h | 43 +++++++++----------
 include/hw/virtio/virtio.h        |  7 +++-
 hw/virtio/vhost-user.c            | 11 ++---
 hw/virtio/virtio-qmp.c            | 70 -------------------------------
 hw/virtio/virtio.c                |  9 +++-
 hw/virtio/meson.build             | 17 ++++----
 8 files changed, 60 insertions(+), 121 deletions(-)
 create mode 100644 include/hw/ppc/spapr_common.h

-- 
2.47.3