Skip to content

Add debugfs support to show scalable mode DMAR table

Sai Praneeth Prakhya linux-iommu 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review
  2. v23 patches 0 repliesSuperseded
  3. v13 patches 7 repliesSuperseded

Changes in v3 from the cover letter

----------------------
Presently, for V2 patches if kernel command line argument "iommu=pt" is passed, dumping DMAR table seg faults. This happens because in pass through mode (for non-scalable DMAR's) 3rd bit of context entry is set and it is misinterpreted as PASID enabled by debugfs code and hence tries to dereference PASID directory pointer which leads to seg fault (PASID directory pointer is undefined for non-scalable DMAR's). To fix this, dereference PASID directory pointer only when
1. PASID is supported and
2. PASID is enabled.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iommu/vt-d: Modify the format of intel DMAR tables dumpdrivers/iommu/intel-iommu-debugfs.c+41 -240 replies
2/3iommu/vt-d: Introduce macros useful for dumping DMAR tabledrivers/iommu/intel-iommu.c drivers/iommu/intel-pasid.c drivers/iommu/intel-pasid.h +1 more+33 -220 replies
3/3iommu/vt-d: Add debugfs support to show scalable mode DMAR table internalsdrivers/iommu/intel-iommu-debugfs.c+75 -30 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLu BaoluAndy Shevchenko
SeriesR-b R-b
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH V3 0/3] Add debugfs support to show scalable mode DMAR table

Presently, "/sys/kernel/debug/iommu/intel/dmar_translation_struct" file dumps only legacy DMAR table which consists of root table and context table. Scalable mode DMAR table adds PASID directory and PASID table. Hence, add support to dump these tables as well.

Directly extending the present dumping format for PASID tables will make the output look clumsy. Hence, the first patch modifies the present format to a tabular format. The second patch introduces macros that are used during PASID table walk and the third patch actually adds support to dump scalable mode DMAR table.

Changes from V1 to V2:
----------------------
1. Make my name consistent in "From" and "Signed-off-by"
2. Fix comment regarding scalable mode context entries
3. Add reviewed by tags

Changes from V2 to V3:
----------------------
Presently, for V2 patches if kernel command line argument "iommu=pt" is passed, dumping DMAR table seg faults. This happens because in pass through mode (for non-scalable DMAR's) 3rd bit of context entry is set and it is misinterpreted as PASID enabled by debugfs code and hence tries to dereference PASID directory pointer which leads to seg fault (PASID directory pointer is undefined for non-scalable DMAR's). To fix this, dereference PASID directory pointer only when
1. PASID is supported and
2. PASID is enabled.

This patch is tested on
1. Non-scalable DMAR with and without iommu=pt
2. Scalable DMAR with and without iommu=pt

Sai Praneeth Prakhya (3):
iommu/vt-d: Modify the format of intel DMAR tables dump iommu/vt-d: Introduce macros useful for dumping DMAR table iommu/vt-d: Add debugfs support to show scalable mode DMAR table
internals

 drivers/iommu/intel-iommu-debugfs.c | 137 +++++++++++++++++++++++++++++-------
 drivers/iommu/intel-iommu.c         |   6 +-
 drivers/iommu/intel-pasid.c         |  17 -----
 drivers/iommu/intel-pasid.h         |  26 +++++++
 include/linux/intel-iommu.h         |   6 ++
 5 files changed, 146 insertions(+), 46 deletions(-)
Cc Joerg Roedel <[email protected]>
Cc Ashok Raj <[email protected]>
Cc Lu Baolu <[email protected]>
Cc Sohil Mehta <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Jacob Pan <[email protected]>
Cc Andy Shevchenko <[email protected]>
Signature · 6 lines
2.7.4

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu