From: Yi Liu <yi.l.liu@intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Robin Murphy <robin.murphy@arm.com>
Cc: Vasant Hegde <vasant.hegde@amd.com>, <iommu@lists.linux.dev>,
<joro@8bytes.org>, <will@kernel.org>,
<suravee.suthikulpanit@amd.com>
Subject: Re: [PATCH] iommu/amd: Add Secure ATS support
Date: Wed, 26 Feb 2025 09:09:29 +0800 [thread overview]
Message-ID: <baa35632-eca7-4779-8862-b032d56f82e1@intel.com> (raw)
In-Reply-To: <20250225145518.GJ545008@ziepe.ca>
On 2025/2/25 22:55, Jason Gunthorpe wrote:
> On Tue, Feb 25, 2025 at 01:18:43PM +0000, Robin Murphy wrote:
>
>>> My thought is to add a flag in iommufd_hw_capabilities to report the
>>> capability, and add a flag in iommufd_hwpt_alloc_flags to let iommu driver
>>> know if HPT is needed when allocating S2 domain. Userspace attaches the
>>> un-trusted devices to the domains with HPT. While trusted devices can be
>>> attached to 'normal' S2 domains. Will to send it out soon.:)
>>>
>>>> With Secure ATS, for ATS requests IOMMU return GPA to device instead
>>>> of SPA.
>>>
>>> I suppose AMD Secure ATS only works under nested translation configuration.
>>> is it? I guess admin may want some flexibility to opt-in it. :)
>>
>> Heh, and in SMMUv3 we have both options, with split-stage ATS for nested
>> translation, and our Device Permission Table for full ATS, so it seems like
>> there should be room for some kind of generalised capability.
>
> Yes, lets not have another driver-only command line parameter but
> somthing global managed by the core code.
>
> What are the options here?
> 1) Translated Address (TA) is a full physical address and IOMMU does
> do anything (today)
>
do you mean "do nothing"?
> 2) IOMMU converts a S1 IOVA into a TA as a S2 IOVA address and the
> IOMMU runs it through the S2 to validate it. (ARM calls this
> split-stage). Requires nesting
>
> 3) TA is an IOVA and the IOMMU runs it through the full translation
> to validate it. ATS is just used to signal non-present
>
> 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)
>
> What are the three HWs doing?
>
> I see #2 and #4 clearly in the SMM spec. Is #3 a special case of #2 (a
> STE with a S2 and S1DSS bypass)?
>
> I think AMD is doing #3 from the docs.
>
> What is Intel doing?
Intel does #4. It has a Host Permission Table which validates the
physical address.
4.2.4 Host Permission Table
The Host Permission Table (HPT) allows software to control access to the
physical address space when
one or more devices uses translated requests. System software may create
one or more domains
which permit memory accesses from only those ATS-devices that are accepted
as part of the domain’s
Trusted Computing Base (TCB). HPT is only supported when operating in
scalable mode. The HPT is a
4-level structure described in Table 11 and an example HPT Walk in Figure
4-2. Each table entry
corresponding to a valid page size can reference one or more valid pages
using the Page Permission
(PPi) fields as well as providing a pointer to the subsequent paging structure.
> A domain alloc flag to put the domain into #3 mode seems like a good
> start to me. The core code can decide to activate the flag for the
> default domain. Suggest starting from pci->untrusted.
>
> Also, #3 requires PCI topology support, the ACS flags need to be set
> to route all TA's to the host. The core code should check and validate
> this before turning it on.
yes. I think both #2 and #3 need to enforce it. The TA device got is
not really a PA in the two modes.
> I think #2 can be requested through the vSTE on ARM?
>
> Not sure how to setup #4? The core code also needs to detect coherent
> systems (ie CXL/etc) and refuse to do anything other than #1/#4..
The DPT and the HPT validates physical addresses. So such tables need to be
programmed when a physical address is mapped in I/O page table. So the
choice may be associating it with paging domain (e.g. the S2 domain that
converts GPA to PA). If so, a domain alloc flag is also a good start.
--
Regards,
Yi Liu
next prev parent reply other threads:[~2025-02-26 1: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 [this message]
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
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=baa35632-eca7-4779-8862-b032d56f82e1@intel.com \
--to=yi.l.liu@intel.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--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.