[PATCH 0/3] s390x/pci: Accomodate vfio DMA limiting

Matthew Rosato posted 3 patches 5 years, 2 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1599842947-4051-1-git-send-email-mjrosato@linux.ibm.com
Maintainers: Thomas Huth <thuth@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, David Hildenbrand <david@redhat.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Richard Henderson <rth@twiddle.net>, Christian Borntraeger <borntraeger@de.ibm.com>, Cornelia Huck <cohuck@redhat.com>, Halil Pasic <pasic@linux.ibm.com>
There is a newer version of this series
hw/s390x/s390-pci-bus.c       | 56 ++++++++++++++++++++++++---
hw/s390x/s390-pci-bus.h       |  9 +++++
hw/s390x/s390-pci-inst.c      | 29 +++++++++++---
hw/s390x/s390-pci-inst.h      |  3 ++
hw/vfio/common.c              | 89 ++++++++++++++++++++++++++++++++++---------
include/hw/vfio/vfio-common.h |  1 +
6 files changed, 159 insertions(+), 28 deletions(-)
[PATCH 0/3] s390x/pci: Accomodate vfio DMA limiting
Posted by Matthew Rosato 5 years, 2 months ago
Kernel commit 492855939bdb added a limit to the number of outstanding DMA
requests for a type1 vfio container.  However, lazy unmapping in s390 can in
quite a large number of outstanding DMA requests to build up prior to being
purged, potentially the entire guest DMA space.  This results in unexpected
'VFIO_MAP_DMA failed: No space left on device' conditions seen in QEMU.

This patchset adds support to qemu to retrieve the DMA limit information
added to VFIO_IOMMU_GET_INFO.  The patches are separated into vfio hits
which add support for reading in VFIO_IOMU_GET_INFO capability chains and
getting the per-container dma_limit, and s390 hits to track DMA usage on
a per-container basis.

Associated kernel patch:
https://marc.info/?l=kvm&m=159984267812181&w=2

Matthew Rosato (3):
  vfio: Get DMA limit information
  s390x/pci: Honor DMA limits set by vfio
  vfio: Create shared routine for scanning info capabilities

 hw/s390x/s390-pci-bus.c       | 56 ++++++++++++++++++++++++---
 hw/s390x/s390-pci-bus.h       |  9 +++++
 hw/s390x/s390-pci-inst.c      | 29 +++++++++++---
 hw/s390x/s390-pci-inst.h      |  3 ++
 hw/vfio/common.c              | 89 ++++++++++++++++++++++++++++++++++---------
 include/hw/vfio/vfio-common.h |  1 +
 6 files changed, 159 insertions(+), 28 deletions(-)

-- 
1.8.3.1