Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1492151
| From | Eric Auger <eric.auger@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC 08/11] vfio/type1: Sets the IOVA window in case MSI IOVA need to be allocated |
| Date | 2016-09-27 22:50 +0200 |
| Message-ID | <sm7u9-5Nm-17@gated-at.bofh.it> (permalink) |
| References | <sm7u9-5Nm-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
In case the IOMMU translates MSI, MSI IOVA will need to be transparently allocated by the kernel in unused GPA space. Let's initialize a DMA domain where some slots will be reserved "unmanaged" slots and rest is left available for IOVA allocation. Signed-off-by: Eric Auger <eric.auger@redhat.com> --- drivers/vfio/vfio_iommu_type1.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 2ba1942..ad08fd0 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -36,6 +36,7 @@ #include <linux/uaccess.h> #include <linux/vfio.h> #include <linux/workqueue.h> +#include <linux/dma-iommu.h> #define DRIVER_VERSION "0.2" #define DRIVER_AUTHOR "Alex Williamson <alex.williamson@redhat.com>" @@ -829,6 +830,11 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, vfio_test_domain_fgsp(domain); + /* sets the IOVA window */ + if (iommu_capable(bus, IOMMU_CAP_TRANSLATE_MSI) && + iommu_get_dma_msi_region_cookie(domain->domain, 0, ULONG_MAX)) + goto out_detach; + /* replay mappings on new domains */ ret = vfio_iommu_replay(iommu, domain); if (ret) -- 1.9.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[RFC 08/11] vfio/type1: Sets the IOVA window in case MSI IOVA need to be allocated Eric Auger <eric.auger@redhat.com> - 2016-09-27 22:50 +0200
csiph-web