linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] vfio iommu: Add dma available capability
@ 2020-09-15 19:05 Matthew Rosato
  2020-09-15 19:05 ` Matthew Rosato
  2020-09-15 19:18 ` Matthew Rosato
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Rosato @ 2020-09-15 19:05 UTC (permalink / raw)
  To: alex.williamson, cohuck; +Cc: pmorel, schnelle, kvm, linux-kernel

Commit 492855939bdb ("vfio/type1: Limit DMA mappings per container") added
a limit to the number of concurrent DMA requests for a vfio container.
However, lazy unmapping in s390 can in fact cause 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 patch proposes to provide the remaining number of allowable DMA 
requests via the VFIO_IOMMU_GET_INFO ioctl as a new capability.  A 
subsequent patchset to QEMU would collect this information and use it in 
s390 PCI support to tap the guest on the shoulder before overrunning the 
vfio limit.

Changes from v2:
- Typos / fixed stale comment block

Matthew Rosato (1):
  vfio iommu: Add dma available capability

 drivers/vfio/vfio_iommu_type1.c | 17 +++++++++++++++++
 include/uapi/linux/vfio.h       | 15 +++++++++++++++
 2 files changed, 32 insertions(+)

-- 
1.8.3.1


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

end of thread, other threads:[~2020-09-16  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 19:05 [PATCH v3] vfio iommu: Add dma available capability Matthew Rosato
2020-09-15 19:05 ` Matthew Rosato
2020-09-16  9:41   ` Cornelia Huck
2020-09-15 19:18 ` Matthew Rosato

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