qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Support message-based DMA in vfio-user server
@ 2023-08-23  9:29 Mattias Nissler
  2023-08-23  9:29 ` [PATCH v2 1/4] softmmu: Support concurrent bounce buffers Mattias Nissler
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Mattias Nissler @ 2023-08-23  9:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: john.levon, stefanha, Jagannathan Raman,
	Philippe Mathieu-Daudé, Peter Xu, David Hildenbrand,
	Paolo Bonzini, Elena Ufimtseva, Mattias Nissler

This series adds basic support for message-based DMA in qemu's vfio-user
server. This is useful for cases where the client does not provide file
descriptors for accessing system memory via memory mappings. My motivating use
case is to hook up device models as PCIe endpoints to a hardware design. This
works by bridging the PCIe transaction layer to vfio-user, and the endpoint
does not access memory directly, but sends memory requests TLPs to the hardware
design in order to perform DMA.

Note that there is some more work required on top of this series to get
message-based DMA to really work well:

* libvfio-user has a long-standing issue where socket communication gets messed
  up when messages are sent from both ends at the same time. See
  https://github.com/nutanix/libvfio-user/issues/279 for more details. I've
  been engaging there and a fix is in review.

* qemu currently breaks down DMA accesses into chunks of size 8 bytes at
  maximum, each of which will be handled in a separate vfio-user DMA request
  message. This is quite terrible for large DMA accesses, such as when nvme
  reads and writes page-sized blocks for example. Thus, I would like to improve
  qemu to be able to perform larger accesses, at least for indirect memory
  regions. I have something working locally, but since this will likely result
  in more involved surgery and discussion, I am leaving this to be addressed in
  a separate patch.

Changes from v1:

* Address Stefan's review comments. In particular, enforce an allocation limit
  and don't drop the map client callbacks given that map requests can fail when
  hitting size limits.

* libvfio-user version bump now included in the series.

* Tested as well on big-endian s390x. This uncovered another byte order issue
  in vfio-user server code that I've included a fix for.

Mattias Nissler (4):
  softmmu: Support concurrent bounce buffers
  Update subprojects/libvfio-user
  vfio-user: Message-based DMA support
  vfio-user: Fix config space access byte order

 hw/remote/trace-events        |  2 +
 hw/remote/vfio-user-obj.c     | 88 +++++++++++++++++++++++++++++++----
 include/sysemu/sysemu.h       |  2 +
 qemu-options.hx               | 27 +++++++++++
 softmmu/globals.c             |  1 +
 softmmu/physmem.c             | 84 ++++++++++++++++++---------------
 softmmu/vl.c                  |  6 +++
 subprojects/libvfio-user.wrap |  2 +-
 8 files changed, 165 insertions(+), 47 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2023-09-07 12:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23  9:29 [PATCH v2 0/4] Support message-based DMA in vfio-user server Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 1/4] softmmu: Support concurrent bounce buffers Mattias Nissler
2023-08-23 17:34   ` Peter Xu
2023-08-23 20:08     ` Mattias Nissler
2023-08-23 20:54       ` Peter Xu
2023-08-24  6:58         ` Mattias Nissler
2023-08-24 13:32         ` Stefan Hajnoczi
2023-09-01 13:41           ` Markus Armbruster
2023-09-05  7:38             ` Mattias Nissler
2023-09-05 13:45               ` Peter Xu
2023-09-07 12:37                 ` Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 2/4] Update subprojects/libvfio-user Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 3/4] vfio-user: Message-based DMA support Mattias Nissler
2023-08-23  9:29 ` [PATCH v2 4/4] vfio-user: Fix config space access byte order Mattias Nissler

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