iommu/amd: Add support for device id user input
authorDheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Wed, 2 Jul 2025 09:38:01 +0000 (15:08 +0530)
committerWill Deacon <will@kernel.org>
Tue, 15 Jul 2025 10:41:52 +0000 (11:41 +0100)
commit2e98940f123d9c69d4759078aea9a536244c98d3
treef103ad6902d0032de72c1e520b7254cb7e0e244d
parentfb3af1f4fefb78f9180446aae2834e11a6f7d134
iommu/amd: Add support for device id user input

Dumping IOMMU data structures like device table, IRT, etc., for all devices
on the system will be a lot of data dumped in a file. Also, user may want
to dump and analyze these data structures just for one or few devices. So
dumping IOMMU data structures like device table, IRT etc for all devices
is not a good approach.

Add "device id" user input to be used for dumping IOMMU data structures
like device table, IRT etc in AMD IOMMU debugfs.

eg.
1. # echo 0000:01:00.0 > /sys/kernel/debug/iommu/amd/devid
   # cat /sys/kernel/debug/iommu/amd/devid
   Output : 0000:01:00.0

2. # echo 01:00.0 > /sys/kernel/debug/iommu/amd/devid
   # cat /sys/kernel/debug/iommu/amd/devid
   Output : 0000:01:00.0

Signed-off-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20250702093804.849-6-dheerajkumar.srivastava@amd.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/amd/debugfs.c