[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <205328f3-8b1b-4e1d-afa8-da6a123866e2@amd.com>
Date: Mon, 17 Mar 2025 16:56:39 +0530
From: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@....com>
To: Vasant Hegde <vasant.hegde@....com>, joro@...tes.org,
suravee.suthikulpanit@....com, will@...nel.org, robin.murphy@....com,
linux-kernel@...r.kernel.org, iommu@...ts.linux.dev
Subject: Re: [PATCH v3 7/8] iommu/amd: Add debugfs support to dump IRT Table
Hi Vasant,
On 3/13/2025 4:33 PM, Vasant Hegde wrote:
> Hi,
>
>
> On 2/6/2025 11:30 AM, Dheeraj Kumar Srivastava wrote:
>> In cases where we have an issue in the device interrupt path with IOMMU
>> interrupt remapping enabled, dumping valid IRT table entries for the device
>> is very useful and good input for debugging the issue.
>>
>> eg.
>> To dump irte entries for a particular device
>> #echo "c4:00.0" > /sys/kernel/debug/iommu/amd/devid
>> #cat /sys/kernel/debug/iommu/amd/irqtbl | less
>>
>> or
>>
>> #echo "0000:c4:00.0" > /sys/kernel/debug/iommu/amd/devid
>> #cat /sys/kernel/debug/iommu/amd/irqtbl | less
>>
>> Signed-off-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@....com>
>> ---
>> drivers/iommu/amd/debugfs.c | 89 +++++++++++++++++++++++++++++++++++++
>> 1 file changed, 89 insertions(+)
>>
>> diff --git a/drivers/iommu/amd/debugfs.c b/drivers/iommu/amd/debugfs.c
>> index 1377795814d1..0aff1d616108 100644
>> --- a/drivers/iommu/amd/debugfs.c
>> +++ b/drivers/iommu/amd/debugfs.c
>> @@ -11,6 +11,7 @@
>> #include <linux/pci.h>
>>
>> #include "amd_iommu.h"
>> +#include "../irq_remapping.h"
>>
>> static struct dentry *amd_iommu_debugfs;
>>
>> @@ -250,6 +251,92 @@ static int iommu_devtbl_show(struct seq_file *m, void *unused)
>> }
>> DEFINE_SHOW_ATTRIBUTE(iommu_devtbl);
>>
>> +static void dump_128_irte(struct seq_file *m, struct irq_remap_table *table)
>> +{
>> + struct irte_ga *ptr, *irte;
>> + int index;
>> +
>> + for (index = 0; index < MAX_IRQS_PER_TABLE; index++) {
>> + ptr = (struct irte_ga *)table->table;
>> + irte = &ptr[index];
>> +
>> + if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) &&
>> + !irte->lo.fields_vapic.valid)
>> + continue;
>> + else if (!irte->lo.fields_remap.valid)
>> + continue;
>> + seq_printf(m, "IRT[%04d] %016llx%016llx\n", index, irte->hi.val, irte->lo.val);
>
> Can you please space between words so that its easy to read?
Sure. Will update in v4.
Thanks
Dheeraj
>
> -Vasant
>
>
Powered by blists - more mailing lists