qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Elena Ufimtseva <elena.ufimtseva@oracle.com>
To: qemu-devel@nongnu.org
Cc: eduardo@habkost.net, john.g.johnson@oracle.com,
	cohuck@redhat.com, jag.raman@oracle.com, john.levon@nutanix.com,
	eblake@redhat.com, david@redhat.com, armbru@redhat.com,
	peterx@redhat.com, mst@redhat.com, berrange@redhat.com,
	stefanha@redhat.com, pbonzini@redhat.com, philmd@redhat.com
Subject: [RFC 0/8] ioregionfd introduction
Date: Mon,  7 Feb 2022 23:22:14 -0800	[thread overview]
Message-ID: <cover.1644302411.git.elena.ufimtseva@oracle.com> (raw)

This patchset is an RFC version for the ioregionfd implementation
in QEMU. The kernel patches are to be posted with some fixes as a v4.

For this implementation version 3 of the posted kernel patches was user:
https://lore.kernel.org/kvm/cover.1613828726.git.eafanasova@gmail.com/

The future version will include support for vfio/libvfio-user.
Please refer to the design discussion here proposed by Stefan:
https://lore.kernel.org/all/YXpb1f3KicZxj1oj@stefanha-x1.localdomain/T/

The vfio-user version needed some bug-fixing and it was decided to send
this for multiprocess first.

The ioregionfd is configured currently trough the command line and each
ioregionfd represent an object. This allow for easy parsing and does
not require device/remote object command line option modifications.

The following command line can be used to specify ioregionfd:
<snip>
  '-object', 'x-remote-object,id=robj1,devid=lsi0,fd='+str(remote.fileno()),\
  '-object', 'ioregionfd-object,id=ioreg2,devid=lsi0,iofd='+str(iord.fileno())+',bar=1',\
  '-object', 'ioregionfd-object,id=ioreg3,devid=lsi0,iofd='+str(iord.fileno())+',bar=2',\
</snip>

Proxy side of ioregionfd in this version uses only one file descriptor:
<snip>
  '-device', 'x-pci-proxy-dev,id=lsi0,fd='+str(proxy.fileno())+',ioregfd='+str(iowr.fileno()), \
</snip>

This is done for RFC version and my though was that next version will
be for vfio-user, so I have not dedicated much effort to this command
line options.

The multiprocess messaging protocol was extended to support inquiries
by the proxy if device has any ioregionfds.
This RFC implements inquires by proxy about the type of BAR (ioregionfd
or not) and the type of it (memory/io).

Currently there are few limitations in this version of ioregionfd.
 - one ioregionfd per bar, only full bar size is supported;
 - one file descriptor per device for all of its ioregionfds;
 - each remote device runs fd handler for all its BARs in one IOThread;
 - proxy supports only one fd.

Some of these limitations will be dropped in the future version.
This RFC is to acquire the feedback/suggestions from the community
on the general approach.

The quick performance test was done for the remote lsi device with
ioregionfd and without for both mem BARs (1 and 2) with help
of the fio tool:

Random R/W:

	             read IOPS	read BW     write IOPS   write BW
no ioregionfd	 889	    3559KiB/s   890          3561KiB/s
ioregionfd	     938	    3756KiB/s   939          3757KiB/s


Sequential Read and Sequential Write:

                 Sequential read		Sequential write	
                 read IOPS	read BW	    write IOPS	 write BW

no ioregionfd    367k	    1434MiB/s	76k	         297MiB/s
ioregionfd       374k	    1459MiB/s	77.3k	     302MiB/s


Please review and send your feedback.

Thank you!
Elena

Elena Ufimtseva (8):
  ioregionfd: introduce a syscall and memory API
  multiprocess: place RemoteObject definition in a header file
  ioregionfd: introduce memory API functions
  ioregionfd: Introduce IORegionDFObject type
  multiprocess: prepare ioregionfds for remote device
  multiprocess: add MPQEMU_CMD_BAR_INFO
  multiprocess: add ioregionfd memory region in proxy
  multiprocess: handle ioregionfd commands

 meson.build                     |  15 +-
 qapi/qom.json                   |  32 ++-
 include/exec/memory.h           |  50 +++++
 include/hw/remote/ioregionfd.h  |  45 ++++
 include/hw/remote/machine.h     |   1 +
 include/hw/remote/mpqemu-link.h |   2 +
 include/hw/remote/proxy.h       |   1 +
 include/hw/remote/remote.h      |  31 +++
 include/sysemu/kvm.h            |  15 ++
 linux-headers/ioregionfd.h      |  30 +++
 linux-headers/linux/kvm.h       |  25 +++
 accel/kvm/kvm-all.c             | 132 ++++++++++++
 accel/stubs/kvm-stub.c          |   1 +
 hw/remote/ioregionfd.c          | 361 ++++++++++++++++++++++++++++++++
 hw/remote/message.c             |  38 ++++
 hw/remote/proxy.c               |  66 +++++-
 hw/remote/remote-obj.c          | 154 ++++++++++++--
 softmmu/memory.c                | 207 ++++++++++++++++++
 Kconfig.host                    |   3 +
 MAINTAINERS                     |   3 +
 hw/remote/Kconfig               |   4 +
 hw/remote/meson.build           |   1 +
 meson_options.txt               |   2 +
 scripts/meson-buildoptions.sh   |   3 +
 24 files changed, 1199 insertions(+), 23 deletions(-)
 create mode 100644 include/hw/remote/ioregionfd.h
 create mode 100644 include/hw/remote/remote.h
 create mode 100644 linux-headers/ioregionfd.h
 create mode 100644 hw/remote/ioregionfd.c

-- 
2.25.1



             reply	other threads:[~2022-02-08  8:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  7:22 Elena Ufimtseva [this message]
2022-02-08  7:22 ` [RFC 1/8] ioregionfd: introduce a syscall and memory API Elena Ufimtseva
2022-02-16 12:19   ` David Hildenbrand
2022-02-08  7:22 ` [RFC 2/8] multiprocess: place RemoteObject definition in a header file Elena Ufimtseva
2022-02-08  7:22 ` [RFC 3/8] ioregionfd: introduce memory API functions Elena Ufimtseva
2022-02-14 14:32   ` Stefan Hajnoczi
2022-02-08  7:22 ` [RFC 4/8] ioregionfd: Introduce IORegionDFObject type Elena Ufimtseva
2022-02-11 13:46   ` Markus Armbruster
2022-02-15 18:19     ` Elena
2022-02-14 14:37   ` Stefan Hajnoczi
2022-02-15 18:18     ` Elena
2022-02-16 11:08       ` Stefan Hajnoczi
2022-02-08  7:22 ` [RFC 5/8] multiprocess: prepare ioregionfds for remote device Elena Ufimtseva
2022-02-08  7:22 ` [RFC 6/8] multiprocess: add MPQEMU_CMD_BAR_INFO Elena Ufimtseva
2022-02-08  7:22 ` [RFC 7/8] multiprocess: add ioregionfd memory region in proxy Elena Ufimtseva
2022-02-08  7:22 ` [RFC 8/8] multiprocess: handle ioregionfd commands Elena Ufimtseva
2022-02-09 10:33 ` [RFC 0/8] ioregionfd introduction Stefan Hajnoczi
2022-02-14 14:52 ` Stefan Hajnoczi
2022-02-15 18:16   ` Elena
2022-02-16 11:20     ` Stefan Hajnoczi

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=cover.1644302411.git.elena.ufimtseva@oracle.com \
    --to=elena.ufimtseva@oracle.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=jag.raman@oracle.com \
    --cc=john.g.johnson@oracle.com \
    --cc=john.levon@nutanix.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).