Linux IOMMU Development
 help / color / mirror / Atom feed
From: "Liu, Jingqi" <jingqi.liu@intel.com>
To: Tian Kevin <kevin.tian@intel.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/5] iommu/vt-d: debugfs: Enhancements to IOMMU debugfs
Date: Mon, 3 Jul 2023 22:37:03 +0800	[thread overview]
Message-ID: <4f18a7ca-3a57-0097-51f0-490f876831dc@intel.com> (raw)
In-Reply-To: <BN9PR11MB5276885D6A142BC94D80C2618C29A@BN9PR11MB5276.namprd11.prod.outlook.com>

On 7/3/2023 3:15 PM, Tian, Kevin wrote:
>> From: Liu, Jingqi <jingqi.liu@intel.com>
>> Sent: Sunday, June 25, 2023 11:05 PM
>>
>> The original debugfs only dumps all IOMMU page tables without pasid
>> supported. It traverses all devices on the pci bus, then dumps all page
>> tables based on device domains. This traversal is from software
>> perspective.
>>
>> This series dumps page tables by traversing root tables, context tables,
>> pasid directories and pasid tables from hardware perspective. By
>> specifying source identifier and PASID, it supports dumping specified
>> page table or all page tables in legacy mode or scalable mode.
>>
>> For a device that only supports legacy mode, specify the source
>> identifier, and search the root table and context table to dump its
>> page table. It does not support to specify PASID.
>>
>> For a device that supports scalable mode, specify a
>> {source identifier, PASID} pair and search the root table, context table
>> and pasid table to dump its page table.  If the pasid is not specified,
>> it is set to RID_PASID.
>>
>> Switch to dump all page tables by specifying "auto".
>>
>> Examples are as follows:
>> 1) Dump the page table of device "00:1f.0" that only supports legacy
>> mode.
>>
>> $ sudo echo 00:1f.0 >
>> /sys/kernel/debug/iommu/intel/domain_translation_struct
>> $ sudo cat /sys/kernel/debug/iommu/intel/domain_translation_struct
>> Device 0000:00:1f.0 @0x105407000
>> IOVA_PFN                PML5E                   PML4E
>> 0x0000000000000 |       0x0000000000000000      0x0000000105408003
>> 0x0000000000001 |       0x0000000000000000      0x0000000105408003
>> 0x0000000000002 |       0x0000000000000000      0x0000000105408003
>> 0x0000000000003 |       0x0000000000000000      0x0000000105408003
>>
>> PDPE                    PDE                     PTE
>> 0x0000000105409003      0x000000010540a003      0x0000000000000003
>> 0x0000000105409003      0x000000010540a003      0x0000000000001003
>> 0x0000000105409003      0x000000010540a003      0x0000000000002003
>> 0x0000000105409003      0x000000010540a003      0x0000000000003003
>>
>> [...]
>>
>> 2) Dump the page table of device "00:0a.0" with pasid "2".
>>
>> $ sudo echo 00:0a.0,2 >
>> /sys/kernel/debug/iommu/intel/domain_translation_struct
>> $ sudo cat /sys/kernel/debug/iommu/intel/domain_translation_struct
> What about creating a directory layout per {dev, pasid} so the user can
> easily figure out and dump?
>
> e.g.
>
> /sys/kernel/debug/iommu/intel/00:0a.0/0/domain_translation_struct
> /sys/kernel/debug/iommu/intel/00:0a.0/2/domain_translation_struct
Thanks.

Do you mean create a directory for each device, whether it supports 
PASID or not ?
Seems the PASID can be assigned at runtime.
So it needs to support creating debugfs file at runtime in IOMMU driver.
Looks like this requires modifying IOMMU driver.

BR,
Jingqi

  reply	other threads:[~2023-07-03 14:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25 15:04 [PATCH 0/5] iommu/vt-d: debugfs: Enhancements to IOMMU debugfs Jingqi Liu
2023-06-25 15:04 ` [PATCH 1/5] iommu/vt-d: debugfs: Define domain_translation_struct file ops Jingqi Liu
2023-06-25 15:04 ` [PATCH 2/5] iommu/vt-d: debugfs: Support specifying source identifier and PASID Jingqi Liu
2023-06-25 15:04 ` [PATCH 3/5] iommu/vt-d: debugfs: Dump the corresponding page table of a pasid Jingqi Liu
2023-06-25 15:04 ` [PATCH 4/5] iommu/vt-d: debugfs: Support dumping a specified page table Jingqi Liu
2023-06-25 15:04 ` [PATCH 5/5] iommu/vt-d: debugfs: Dump entry pointing to huge page Jingqi Liu
2023-07-03  7:15 ` [PATCH 0/5] iommu/vt-d: debugfs: Enhancements to IOMMU debugfs Tian, Kevin
2023-07-03 14:37   ` Liu, Jingqi [this message]
2023-07-04  7:54     ` Tian, Kevin
2023-07-11  1:40       ` Liu, Jingqi
2023-07-11  2:52         ` Baolu Lu
2023-07-11  6:23           ` Liu, Jingqi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f18a7ca-3a57-0097-51f0-490f876831dc@intel.com \
    --to=jingqi.liu@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox