-
由 Alex Williamson 提交于
Using iommu_present() to determine whether an IOMMU group is real or fake has some problems. First, apparently Power systems don't register an IOMMU on the device bus, so the groups and containers get marked as noiommu and then won't bind to their actual IOMMU driver. Second, I expect we'll run into the same issue as we try to support vGPUs through vfio, since they're likely to emulate this behavior of creating an IOMMU group on a virtual device and then providing a vfio IOMMU backend tailored to the sort of isolation they provide, which won't necessarily be fully compatible with the IOMMU API. The solution here is to use the existing iommudata interface to IOMMU groups, which allows us to easily identify the fake groups we've created for noiommu purposes. The iommudata we set is purely arbitrary since we're only comparing the address, so we use the address of the noiommu switch itself. Reported-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Tested-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Tested-by: NAnatoly Burakov <anatoly.burakov@intel.com> Tested-by: NSantosh Shukla <sshukla@mvista.com> Fixes: 03a76b60 ("vfio: Include No-IOMMU mode") Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
16ab8a5c