Skip to content

RFC iommu: Expose IOMMU information in sysfs

Alex Williamson linux-iommu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iommu: Add sysfs support for IOMMUsdrivers/iommu/Makefile drivers/iommu/iommu-sysfs.c include/linux/iommu.h+176 -00 replies
2/2iommu/intel: Make use of IOMMU sysfs supportdrivers/iommu/dmar.c drivers/iommu/intel-iommu.c include/linux/intel-iommu.h+84 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] iommu: Expose IOMMU information in sysfs

Users want to know the features of their hardware and we need a better way to get it than parsing it out of dmesg. This series adds a simple registration interface for IOMMUs and an example base implementation for intel-iommu.

One key hardware feature for device assignment is the IOMMU support for superpages. In this example, we can parse it out of the "cap" attribute exposed, but I expect we'll want to add more human readable entries for such features. I'd welcome suggestions on what features we should pull out into human friendly attributes and how to format the contents.

I have not attempted to make a common, consistent interface for attributes between various IOMMU types here. I'm not entirely sure such a thing is possible. Perhaps instead we do like I show in the intel-iommu example and provide IOMMU driver specific attribute groups, clearly labeled so that we effectively give each a namespace. We can promote consistency between drivers, but a common namespace is probably best left to userspace tools.

Appreciate any thoughts and comments. Thanks,

Alex

---

Alex Williamson (2):
iommu: Add sysfs support for IOMMUs iommu/intel: Make use of IOMMU sysfs support

 drivers/iommu/Makefile      |    1 
 drivers/iommu/dmar.c        |    8 ++
 drivers/iommu/intel-iommu.c |   75 ++++++++++++++++++++++
 drivers/iommu/iommu-sysfs.c |  147 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/intel-iommu.h |    2 +
 include/linux/iommu.h       |   28 ++++++++
 6 files changed, 260 insertions(+), 1 deletion(-)
 create mode 100644 drivers/iommu/iommu-sysfs.c