lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5dc3ba1-187c-4ce4-b7a9-eea95a7f043f@amd.com>
Date: Thu, 13 Mar 2025 16:33:58 +0530
From: Vasant Hegde <vasant.hegde@....com>
To: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@....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,


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?

-Vasant



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ