Skip to content

Commit

Permalink
vfio: Stop using iommu_present()
Browse files Browse the repository at this point in the history
IOMMU groups have been mandatory for some time now, so a device without
one is necessarily a device without any usable IOMMU, therefore the
iommu_present() check is redundant (or at best unhelpful).

Signed-off-by: Robin Murphy <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/537103bbd7246574f37f2c88704d7824a3a889f2.1649160714.git.robin.murphy@arm.com
Signed-off-by: Alex Williamson <[email protected]>
  • Loading branch information
rmurphy-arm authored and awilliam committed May 11, 2022
1 parent 5acb6cd commit a77109f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/vfio/vfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,11 @@ static struct vfio_group *vfio_group_find_or_alloc(struct device *dev)

iommu_group = iommu_group_get(dev);
#ifdef CONFIG_VFIO_NOIOMMU
if (!iommu_group && noiommu && !iommu_present(dev->bus)) {
if (!iommu_group && noiommu) {
/*
* With noiommu enabled, create an IOMMU group for devices that
* don't already have one and don't have an iommu_ops on their
* bus. Taint the kernel because we're about to give a DMA
* don't already have one, implying no IOMMU hardware/driver
* exists. Taint the kernel because we're about to give a DMA
* capable device to a user without IOMMU protection.
*/
group = vfio_noiommu_group_alloc(dev, VFIO_NO_IOMMU);
Expand Down

0 comments on commit a77109f

Please sign in to comment.