All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yi Liu <yi.l.liu@intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Vasant Hegde <vasant.hegde@amd.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"will@kernel.org" <will@kernel.org>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>
Subject: Re: [PATCH] iommu/amd: Add Secure ATS support
Date: Fri, 14 Mar 2025 20:09:37 +0800	[thread overview]
Message-ID: <791efd0e-4e43-446e-b637-1f9ed49d0c32@intel.com> (raw)
In-Reply-To: <20250304142402.GB5011@ziepe.ca>

On 2025/3/4 22:24, Jason Gunthorpe wrote:
> On Tue, Mar 04, 2025 at 03:45:54PM +0530, Vasant Hegde wrote:
>>>   never
>>>   always
>>>   paging-only
>>>   secure-always
>>>   secure-paging-only
>>
>> Why not just expose supported modes (No ATS, ATS, Secure ATS) per group and
>> allow admin to select within supported modes?  We may have to add more logic in
>> sysfs store/show code path. But user will know what is supported and what they
>> can pick.
> 
> A sysfs type thing is what I'm thinking
> 
> Just trying to understand what options we should be providing to
> userspace..
> 
> I am sensitive that we'd like to disble ATS for identity modes in many
> common cases and we get that implicitly today.
> 
>> Also sysfs knob needs new domain ops to communicate changes to indivisual
>> driver. Like in store path
>>    - validate the input
>>    - make sure driver is unbond so that its safe to modify the
>>    - New ops to communicate to indivisual driver
>> 	 something like ops->set_ats_mode(dev, mode)
> 
> Yeah this needs to be considered.. I wonder if a flags input to attach
> is the right way to go.

Do we expect this flag to setup the SATS in the underlying iommu driver?
If yes, I doubt if it is proper. My reason as below:

he reason is more for the #4 case you summarized in earlier mails of this
thread. Such HWs need to map the PA in the DPT/HPT table when a given PA is
mapped to IOVA. We may just hook the DPT/HPT map/unmap to the map/unmap of
a paging domain. Hence it's better to determine if the DPT/HPT is desired
per allocation. Otherwise it may requires upper layer to replay the
mapping. e.g. iommufd replay the mappings stored in IOAS->iopt

" 4) TA is an full physical address and the IOMMU validates the full
     physical using some kind of permission structure (ARM calls this
     Device Permission Table)
"

> 
> That would be convenient for how SMMUv3 is structued now as it can just
> switch modes hitlessly with its existing logic. I think all drivers
> should have a similar design.

I think this is more like we have done for the set_dev_pasid op. Now it
supports replacing domain. But as I replied in above, add a flag in the
attach op might not be a good idea.

-- 
Regards,
Yi Liu

  parent reply	other threads:[~2025-03-14 12:04 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 10:58 [PATCH] iommu/amd: Add Secure ATS support Vasant Hegde
2025-02-25 12:30 ` Yi Liu
2025-02-25 13:18   ` Robin Murphy
2025-02-25 13:57     ` Yi Liu
2025-02-25 14:55     ` Jason Gunthorpe
2025-02-26  1:09       ` Yi Liu
2025-02-26  1:13         ` Jason Gunthorpe
2025-02-26  1:27           ` Yi Liu
2025-02-26  2:52           ` Tian, Kevin
2025-02-26  1:12       ` Tian, Kevin
2025-02-26  1:17         ` Jason Gunthorpe
2025-02-26  2:50           ` Tian, Kevin
2025-02-26 12:57             ` Jason Gunthorpe
2025-02-26  7:05           ` Tian, Kevin
2025-02-26 12:58             ` Jason Gunthorpe
2025-02-27 15:27             ` Vasant Hegde
2025-02-28  6:32               ` Tian, Kevin
2025-02-28  7:43                 ` Yi Liu
2025-02-28  8:30                   ` Vasant Hegde
2025-02-28  8:47                     ` Yi Liu
2025-02-28  8:47                       ` Vasant Hegde
2025-03-02  8:10                         ` Yi Liu
2025-03-03  3:00                           ` Tian, Kevin
2025-03-04  6:58                             ` Yi Liu
2025-03-03 11:42                           ` Vasant Hegde
2025-03-05  3:24                             ` Tian, Kevin
2025-03-10 17:07                               ` Vasant Hegde
2025-03-12  7:15                                 ` Tian, Kevin
2025-03-17  8:56                                   ` Vasant Hegde
2025-04-07  5:28                                     ` Tian, Kevin
2025-03-03 18:38                           ` Jason Gunthorpe
2025-03-04  2:16                             ` Baolu Lu
2025-03-04 14:18                               ` Jason Gunthorpe
2025-03-05  2:45                                 ` Baolu Lu
2025-03-05  2:46                                 ` Tian, Kevin
2025-03-04  6:50                             ` Yi Liu
2025-03-04 10:46                               ` Vasant Hegde
2025-03-04 14:20                               ` Jason Gunthorpe
2025-03-05  2:50                                 ` Tian, Kevin
2025-03-05 17:22                                   ` Jason Gunthorpe
2025-03-06  2:41                                     ` Tian, Kevin
2025-03-14 12:54                                 ` Yi Liu
2025-03-04 10:15                             ` Vasant Hegde
2025-03-04 14:24                               ` Jason Gunthorpe
2025-03-10 16:35                                 ` Vasant Hegde
2025-03-14 12:09                                 ` Yi Liu [this message]
2025-03-19 19:52                                   ` Jason Gunthorpe
2025-03-14 12:22                               ` Yi Liu
2025-02-28  8:26                 ` Vasant Hegde
2025-02-28 14:56               ` Jason Gunthorpe
2025-03-03  2:55                 ` Tian, Kevin
2025-03-10 14:13                   ` Vasant Hegde
2025-03-12  6:55                     ` Tian, Kevin
2025-03-03 11:56                 ` Vasant Hegde
2025-02-26  4:47       ` Vasant Hegde
2025-02-26  7:10         ` Tian, Kevin
2025-02-26 13:01           ` Jason Gunthorpe
2025-02-26 22:42           ` Jerry Snitselaar
2025-02-27 16:04           ` Vasant Hegde
2025-02-28  0:04             ` Jason Gunthorpe
2025-02-28  6:18               ` Tian, Kevin
2025-02-28  1:47             ` Baolu Lu
2025-02-28  6:15               ` Tian, Kevin
2025-02-28  8:53                 ` Vasant Hegde
2025-02-28 14:53                 ` Jason Gunthorpe
2025-03-03  2:43                   ` Tian, Kevin
2025-02-28  8:38               ` Vasant Hegde
2025-02-26  4:33   ` Vasant Hegde

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=791efd0e-4e43-446e-b637-1f9ed49d0c32@intel.com \
    --to=yi.l.liu@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.