lkml.org 
[lkml]   [2022]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH RFC v3 02/12] iommu: Add a flag to indicate immutable singleton group
Date
> From: Lu Baolu <baolu.lu@linux.intel.com>
> Sent: Sunday, April 10, 2022 6:25 PM
> @@ -898,6 +941,20 @@ int iommu_group_add_device(struct iommu_group
> *group, struct device *dev)
> list_add_tail(&device->list, &group->devices);
> if (group->domain && !iommu_is_attach_deferred(dev))
> ret = __iommu_attach_device(group->domain, dev);
> +
> + /*
> + * Use standard PCI bus topology, isolation features, and DMA
> + * alias quirks to set the immutable singleton attribute. If
> + * the device came from DT, assume it is static and then
> + * singleton can know from the device count in the group.
> + */
> + if (dev_is_pci(dev))
> + group->immutable_singleton =
> + pci_immutably_isolated(to_pci_dev(dev));
> + else if (is_of_node(dev_fwnode(dev)))
> + group->immutable_singleton =
> + (iommu_group_device_count(group) == 1);
> +

btw probably we also want to check when a 2nd device is added
to a group marked as singleton, just in case some weird thing happens?

\
 
 \ /
  Last update: 2022-04-12 11:33    [W:0.192 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site