aboutsummaryrefslogtreecommitdiff
path: root/scripts/main.c
diff options
context:
space:
mode:
authorMatthew Rosato <mjrosato@linux.ibm.com>2022-10-28 15:47:56 -0400
committerThomas Huth <thuth@redhat.com>2022-11-06 12:27:35 +0100
commit4a8d21ba50fc8625c3bd51dab903872952f95718 (patch)
tree7217f7a5c2c6934fe603d3cf566fe06012de2a4f /scripts/main.c
parentf53b033e4cd2e7706df3cca04f3bf3c5ffc6b08c (diff)
downloadqemu-4a8d21ba50fc8625c3bd51dab903872952f95718.zip
qemu-4a8d21ba50fc8625c3bd51dab903872952f95718.tar.gz
qemu-4a8d21ba50fc8625c3bd51dab903872952f95718.tar.bz2
s390x/pci: RPCIT second pass when mappings exhausted
If we encounter a new mapping while the number of available DMA entries in vfio is 0, we are currently skipping that mapping which is a problem if we manage to free up DMA space after that within the same RPCIT -- we will return to the guest with CC0 and have not mapped everything within the specified range. This issue was uncovered while testing changes to the s390 linux kernel iommu/dma code, where a different usage pattern was employed (new mappings start at the end of the aperture and work back towards the front, making us far more likely to encounter new mappings before invalidated mappings during a global refresh). Fix this by tracking whether any mappings were skipped due to vfio DMA limit hitting 0; when this occurs, we still continue the range and unmap/map anything we can - then we must re-run the range again to pickup anything that was missed. This must occur in a loop until all requests are satisfied (success) or we detect that we are still unable to complete all mappings (return ZPCI_RPCIT_ST_INSUFF_RES). Link: https://lore.kernel.org/linux-s390/20221019144435.369902-1-schnelle@linux.ibm.com/ Fixes: 37fa32de70 ("s390x/pci: Honor DMA limits set by vfio") Reported-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Message-Id: <20221028194758.204007-2-mjrosato@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'scripts/main.c')
0 files changed, 0 insertions, 0 deletions