Linux IOMMU Development
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: Jason Gunthorpe <jgg@ziepe.ca>,
	"Suthikulpanit, Suravee" <suravee.suthikulpanit@amd.com>
Cc: iommu@lists.linux.dev, joro@8bytes.org
Subject: Re: [PATCH 11/21] iommu/amd: Clean up and enhance protection domain flags
Date: Fri, 28 Jul 2023 11:13:33 +0530	[thread overview]
Message-ID: <41a24259-7c23-a53e-0718-9a331ee3ef5f@amd.com> (raw)
In-Reply-To: <ZLaHS5bWAu1yjqoW@ziepe.ca>

Hi Jason,


On 7/18/2023 6:06 PM, Jason Gunthorpe wrote:
> On Mon, Jul 17, 2023 at 11:38:44PM -0700, Suthikulpanit, Suravee wrote:
> 
>> Then we need a way to distinguish whether the v2 table is:
>>  * Managed by IOMMU driver for DMA-API, which supports only PASID=0.
> 
> There is not even such a thing.
> 
> The driver should have an iommu domain. It should have and indication
> if it is PAGING or BLOCKING/IDENTITY. For PAGING domains you have an
> indication of the IOPTE format.
> 
> "DMA-API" is a PAGING domain with v1 or v2 IOPTEs
> UNMANAGED is the same, a PAGING domain with v1 or v2 IOPTEs
> SVA is a "PAGING" domain with v2 IOPTEs
> "AMD IOMMUv2 API" is PAGING domain with v2 IOPTEs
> 
> The core code provides two actions for the driver, attach domain to
> RID, attach domain to PASID.
> 
> If you attach a V1 PAGING domain to a RID then you have to put it in
> the DTE
> 
> If you attach a V2 PAGING domain to a RID then you have to put it in
> PASID 0 within a shared GCR3 table. The GCR3 table is NOT part of the
> struct protection_domain.
> 
> The descision how to configure the DTE/GCR3 is based only on *how and
> what domains are attached*.
> 
> Doing this wrong is why the driver that that weird mess with trying to
> have two different versions of the identity domain.
> 

Thanks for the detailed explanation. We are working on moving GCR3 table from
protection domain structure to per device structure. We will post the patches soon.

-Vasant


  reply	other threads:[~2023-07-28  5:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 14:14 [PATCH 00/21] iommu/amd: Preparation for SVA Support (Part 1 of 2) Vasant Hegde
2023-07-12 14:14 ` [PATCH 01/21] iommu/amd: Remove unused amd_io_pgtable.pt_root variable Vasant Hegde
2023-07-12 14:14 ` [PATCH 02/21] iommu/amd: Consolidate timeout pre-define to amd_iommu_type.h Vasant Hegde
2023-07-12 14:14 ` [PATCH 03/21] iommu/amd: Consolidate logic to allocate protection domain Vasant Hegde
2023-07-12 14:14 ` [PATCH 04/21] iommu/amd: Refactor protection domain allocation code Vasant Hegde
2023-07-12 14:15 ` [PATCH 05/21] iommu/amd/iommu_v2: Use protection_domain in struct device_state Vasant Hegde
2023-07-12 14:15 ` [PATCH 06/21] iommu/amd: Introduce helper functions for managing GCR3 table Vasant Hegde
2023-07-12 14:15 ` [PATCH 07/21] iommu/amd: Use struct protection_domain in helper functions Vasant Hegde
2023-07-14 16:57   ` Jason Gunthorpe
2023-07-12 14:15 ` [PATCH 08/21] iommu/amd: Do not set amd_iommu_pgtable in pass-through mode Vasant Hegde
2023-07-12 14:15 ` [PATCH 09/21] iommu/amd: Miscellaneous clean up when free domain Vasant Hegde
2023-07-12 14:15 ` [PATCH 10/21] iommu/amd: Modify logic for checking GT and PPR features Vasant Hegde
2023-07-12 14:15 ` [PATCH 11/21] iommu/amd: Clean up and enhance protection domain flags Vasant Hegde
2023-07-14 17:25   ` Jason Gunthorpe
2023-07-17  1:22     ` Suthikulpanit, Suravee
2023-07-17 12:23       ` Jason Gunthorpe
2023-07-18  6:38         ` Suthikulpanit, Suravee
2023-07-18 12:36           ` Jason Gunthorpe
2023-07-28  5:43             ` Vasant Hegde [this message]
2023-07-12 14:15 ` [PATCH 12/21] iommu/amd: Use protection_domain.flags to check page table mode Vasant Hegde
2023-07-12 14:15 ` [PATCH 13/21] iommu/amd: Consolidate logic for setting up v2 API mode Vasant Hegde
2023-07-12 14:15 ` [PATCH 14/21] iommu/amd: Refactor domain allocation code for v2DMA mode Vasant Hegde
2023-07-12 14:15 ` [PATCH 15/21] iommu/amd: Setup v2 domain with max pasids Vasant Hegde
2023-07-12 14:15 ` [PATCH 16/21] iommu/amd: Introduce iommu_dev_data.flags to track device capabilities Vasant Hegde
2023-07-12 14:15 ` [PATCH 17/21] iommu/amd: Rename ats related variables Vasant Hegde
2023-07-12 14:15 ` [PATCH 18/21] iommu/amd: Enable device ATS/PASID/PRI capabilities independently Vasant Hegde
2023-07-12 14:15 ` [PATCH 19/21] iommu/amd: Delay enabling PRI to after initializing domain Vasant Hegde
2023-07-12 14:15 ` [PATCH 20/21] iommu/amd: Initialize iommu_device->max_pasids Vasant Hegde
2023-07-12 14:15 ` [PATCH 21/21] iommu/amd: Simplify amd_iommu_device_info() Vasant Hegde
2023-07-14 17:53 ` [PATCH 00/21] iommu/amd: Preparation for SVA Support (Part 1 of 2) Jason Gunthorpe

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=41a24259-7c23-a53e-0718-9a331ee3ef5f@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=suravee.suthikulpanit@amd.com \
    /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