Re: [PATCH v2 5/8] iommu/amd: Add support for device id user input
From: Bjorn Helgaas
Date: Tue Nov 26 2024 - 16:02:44 EST
On Wed, Nov 06, 2024 at 01:16:36PM +0530, Dheeraj Kumar Srivastava wrote:
> Device id user input is needed 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
The corresponding Intel IOMMU debugfs support encodes the BDF in the
pathname, e.g.,
/sys/kernel/debug/iommu/intel/<bdf>/domain_translation_struct
Can you do the same? I think it would be nicer to use a similar
style, and it would also make the code simpler.
Bjorn