History

vfio: Stop using iommu_present()

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

Robin Murphy committed 4 years ago

Commit a77109f1 parent 5acb6cd1 file · +3 −3Browse files

Unified · Split

drivers/vfio/vfio.c+3−3
@@ -745,11 +745,11 @@ static struct vfio_group *vfio_group_find_or_alloc(struct device *dev) · 744 unmodified lines
745 745
746 iommu_group = iommu_group_get(dev);746 iommu_group = iommu_group_get(dev);
747#ifdef CONFIG_VFIO_NOIOMMU747#ifdef CONFIG_VFIO_NOIOMMU
748 if (!iommu_group && noiommu && !iommu_present(dev->bus)) {748 if (!iommu_group && noiommu) {
749 /*749 /*
750 * With noiommu enabled, create an IOMMU group for devices that750 * With noiommu enabled, create an IOMMU group for devices that
751 * don't already have one and don't have an iommu_ops on their751 * don't already have one, implying no IOMMU hardware/driver
752 * bus. Taint the kernel because we're about to give a DMA752 * exists. Taint the kernel because we're about to give a DMA
753 * capable device to a user without IOMMU protection.753 * capable device to a user without IOMMU protection.
754 */754 */
755 group = vfio_noiommu_group_alloc(dev, VFIO_NO_IOMMU);755 group = vfio_noiommu_group_alloc(dev, VFIO_NO_IOMMU);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t