From: root <root@xxxxxxxxxxxxxxxxxxx>
Introducing debugfs support in AMD/IOMMU driver that will allow
userspace to dump below IOMMU information
1) MMIO and Capability register per IOMMU
2) Command buffer
3) Device table entry
4) Interrupt remapping table entry
Analyzing contents of IOMMU data structures helps in understanding IOMMU
capabilities and behavior and debug issues faster.
1. MMIO and Capability registers - Add support to dump MMIO and Capability
registers per IOMMU.
Example:
a. Write MMIO register offset to dump it
$ echo 0x18 > /sys/kernel/debug/iommu/amd/iommu00/mmio
$ cat /sys/kernel/debug/iommu/amd/iommu00/mmio
Output:
$ 0x0003f48d
b. Write capability register offset to dump it
$ echo 0x10 > /sys/kernel/debug/iommu/amd/iommu00/capability
$ cat /sys/kernel/debug/iommu/amd/iommu00/capability
Output:
$ 0x00203040