aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2014-06-12 18:12:24 -0400
committerJoerg Roedel <jroedel@suse.de>2014-07-04 06:35:59 -0400
commitc61959ecbbc6bf9034e65c8e8ef03fa9d1066f05 (patch)
tree8c5b068f79d1a873d55d6f00e1888f559e6d1ea4 /include/linux/iommu.h
parentfd2852d5da67ca890b10468e33c68544e8da1ece (diff)
iommu: Add sysfs support for IOMMUs
IOMMUs currently have no common representation to userspace, most seem to have no representation at all aside from a few printks on bootup. There are however features of IOMMUs that are useful to know about. For instance the IOMMU might support superpages, making use of processor large/huge pages more important in a device assignment scenario. It's also useful to create cross links between devices and IOMMU hardware units, so that users might be able to load balance their devices to avoid thrashing a single hardware unit. This patch adds a device create and destroy interface as well as device linking, making it very lightweight for an IOMMU driver to add basic support. IOMMU drivers can provide additional attributes automatically by using an attribute_group. The attributes exposed are expected to be relatively device specific, the means to retrieve them certainly are, so there are currently no common attributes for the new class created here. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a2e5843b0a22..7fd16e3d1f25 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -187,6 +187,12 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
187 void *data); 187 void *data);
188extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, 188extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
189 void *data); 189 void *data);
190struct device *iommu_device_create(struct device *parent, void *drvdata,
191 const struct attribute_group **groups,
192 const char *fmt, ...);
193void iommu_device_destroy(struct device *dev);
194int iommu_device_link(struct device *dev, struct device *link);
195void iommu_device_unlink(struct device *dev, struct device *link);
190 196
191/* Window handling function prototypes */ 197/* Window handling function prototypes */
192extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, 198extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
@@ -397,6 +403,26 @@ static inline int iommu_domain_set_attr(struct iommu_domain *domain,
397 return -EINVAL; 403 return -EINVAL;
398} 404}
399 405
406struct device *iommu_device_create(struct device *parent, void *drvdata,
407 const struct attribute_group **groups,
408 const char *fmt, ...)
409{
410 return ERR_PTR(-ENODEV);
411}
412
413void iommu_device_destroy(struct device *dev)
414{
415}
416
417int iommu_device_link(struct device *dev, struct device *link)
418{
419 return -EINVAL;
420}
421
422void iommu_device_unlink(struct device *dev, struct device *link)
423{
424}
425
400#endif /* CONFIG_IOMMU_API */ 426#endif /* CONFIG_IOMMU_API */
401 427
402#endif /* __LINUX_IOMMU_H */ 428#endif /* __LINUX_IOMMU_H */