Re: [PATCH v3 0/8] Introduce debugfs support in IOMMU

From: Suthikulpanit, Suravee
Date: Thu Feb 06 2025 - 03:56:36 EST



On 2/6/2025 12:59 PM, Dheeraj Kumar Srivastava wrote:
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

Correction: Based on the documentation in patch 8/8, the output would be

Offset:0x18 Value: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

Correction: Based on the documentation in patch 8/8, the output would be

Offset:0x10 Value:0x00203040

Suravee