Re: [PATCH v6 2/8] iommu/amd: Add debugfs support to dump IOMMU MMIO registers
From: Vasant Hegde
Date: Sun Jun 29 2025 - 01:46:44 EST
On 6/4/2025 10:06 PM, Dheeraj Kumar Srivastava wrote:
> Analyzing IOMMU MMIO registers gives a view of what IOMMU is
> configured with on the system and is helpful to debug issues
> with IOMMU.
>
> eg.
> -> To get mmio registers value at offset 0x18 for iommu<x> (say, iommu00)
> # echo "0x18" > /sys/kernel/debug/iommu/amd/iommu00/mmio
> # cat /sys/kernel/debug/iommu/amd/iommu00/mmio
>
> Signed-off-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@xxxxxxx>
> ---
> drivers/iommu/amd/amd_iommu_types.h | 1 +
> drivers/iommu/amd/debugfs.c | 47 +++++++++++++++++++++++++++++
> 2 files changed, 48 insertions(+)
>
> diff --git a/drivers/iommu/amd/amd_iommu_types.h b/drivers/iommu/amd/amd_iommu_types.h
> index 5089b58e528a..38eca75f6ef1 100644
> --- a/drivers/iommu/amd/amd_iommu_types.h
> +++ b/drivers/iommu/amd/amd_iommu_types.h
> @@ -796,6 +796,7 @@ struct amd_iommu {
> #ifdef CONFIG_AMD_IOMMU_DEBUGFS
> /* DebugFS Info */
> struct dentry *debugfs;
> + int mmio_offset;
This is covered under DEBUGFS config. So this is fine.. but its nice if you
rename the variable such that it indicates its usage.
-Vasant