summaryrefslogtreecommitdiff
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2011-10-21 23:56:24 +0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-11-15 15:22:31 +0400
commitbcb71abe7d4c5a0d0368c67da0a7def4fc73497a (patch)
tree3a043f872b234cb5c47cec1c01b4bbb69539fa0f /drivers/iommu/intel-iommu.c
parent8fbdce659549d93dfb257ec4eabacf63a188e506 (diff)
downloadlinux-bcb71abe7d4c5a0d0368c67da0a7def4fc73497a.tar.xz
iommu: Add option to group multi-function devices
The option iommu=group_mf indicates the that the iommu driver should expose all functions of a multi-function PCI device as the same iommu_device_group. This is useful for disallowing individual functions being exposed as independent devices to userspace as there are often hidden dependencies. Virtual functions are not affected by this option. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 39ca6bb17e13..9ef16d664a99 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4100,6 +4100,9 @@ static int intel_iommu_device_group(struct device *dev, unsigned int *groupid)
}
}
+ if (!pdev->is_virtfn && iommu_group_mf)
+ id.pci.devfn = PCI_DEVFN(PCI_SLOT(id.pci.devfn), 0);
+
*groupid = id.group;
return 0;