From: "Suthikulpanit, Suravee" <suravee.suthikulpanit@amd.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"joro@8bytes.org" <joro@8bytes.org>,
"Liu, Yi L" <yi.l.liu@intel.com>,
"nicolinc@nvidia.com" <nicolinc@nvidia.com>,
"eric.auger@redhat.com" <eric.auger@redhat.com>,
"vasant.hegde@amd.com" <vasant.hegde@amd.com>,
"jon.grimm@amd.com" <jon.grimm@amd.com>,
"santosh.shukla@amd.com" <santosh.shukla@amd.com>,
"Dhaval.Giani@amd.com" <Dhaval.Giani@amd.com>,
"pandoh@google.com" <pandoh@google.com>,
"loganodell@google.com" <loganodell@google.com>
Subject: Re: [RFC PATCH 6/6] iommu/amd: Introduce nested translation support
Date: Mon, 8 Jan 2024 13:49:25 +0700 [thread overview]
Message-ID: <1fbdeec3-58a6-44ec-ac0d-400676212f40@amd.com> (raw)
In-Reply-To: <20240105143703.GA50406@nvidia.com>
On 1/5/2024 9:37 PM, Jason Gunthorpe wrote:
> On Fri, Jan 05, 2024 at 08:39:52PM +0700, Suthikulpanit, Suravee wrote:
>> Hi Kevin,
>>
>> On 12/15/2023 2:45 PM, Tian, Kevin wrote:
>>>> From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>>>> Sent: Wednesday, December 13, 2023 12:02 AM
>>>>
>>>> To support nested translation on AMD IOMMU, the driver needs to
>>>> program DTE[GCR3 Table Root Pointer] with the address provided by
>>>> the guest via struct iommu_hwpt_amd_v2, which is passed as a parameter
>>>> of the struct iommu_ops.domain_alloc_user() with the flag
>>>> IOMMU_HWPT_ALLOC_NEST_PARENT.
>>>>
>>>> Note that current implementation only support GCR3TRPMode for
>>>> nested translation, which uses GPA to program GCR3 Table Root Pointer.
>>>>
>>>
>>> means there is a plan to support another mode in the future or
>>> actually the nested translation requires GCR3TRPMode as a
>>> functional requirement? imho the point of GPA is assumed
>>> in the nested configuration in concept...
>>
>> On (older) system, which does not support GCR3TRPMode, the IOMMU driver
>> needs to program the device's DTE[GCR3 Table Root Pointer] field w/ SPA.
>
> Meaning that on older systems the GCR3 Table Root Pointer is not
> translated by the parent v1 page table?
Correct.
>> When QEMU presents an AMD vIOMMU device to a guest, the guest programs the
>> guest DTE[GCR3 Table Root Pointer] with GPA. Then we need to :
>> 1. Traps the DTE write
>> 2. Translate the GPA->SPA
>> 3. Program DTE with SPA.
>>
>> With the GCR3TRPMode, we can skip step 2 above and directly program step 3
>> with GPA.
>
> Do you want to support this? It will be hard to do because it is not
> just those three steps (which are easy) but that you have to somehow
> maintain coherence with any changes to the parent page table, so you
> have to hook the iommu_domain unmap as well...
I'm debating this. Let me get back on this part.
Thanks,
Suravee
prev parent reply other threads:[~2024-01-08 6:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-12 16:01 [RFC PATCH 0/6] iommu/amd: Introduce hardware info reporting and " Suravee Suthikulpanit
2023-12-12 16:01 ` [RFC PATCH 1/6] iommu/amd: Update PASID, GATS, and GLX feature related macros Suravee Suthikulpanit
2023-12-12 16:01 ` [RFC PATCH 2/6] iommu/amd: Add support for hw_info for iommu capability query Suravee Suthikulpanit
2023-12-13 13:27 ` Jason Gunthorpe
2024-01-05 13:39 ` Suthikulpanit, Suravee
2023-12-15 7:32 ` Tian, Kevin
2024-01-05 13:40 ` Suthikulpanit, Suravee
2023-12-12 16:01 ` [RFC PATCH 3/6] iommu/amd: Introduce Guest-ID struct amd_iommu_vminfo Suravee Suthikulpanit
2023-12-15 7:35 ` Tian, Kevin
2024-01-05 13:39 ` Suthikulpanit, Suravee
2024-01-05 14:38 ` Jason Gunthorpe
2024-01-09 9:52 ` Suthikulpanit, Suravee
2023-12-12 16:01 ` [RFC PATCH 4/6] iommufd: Introduce data struct for AMD nested domain allocation Suravee Suthikulpanit
2023-12-13 14:03 ` Jason Gunthorpe
2023-12-15 7:38 ` Tian, Kevin
2024-01-05 13:39 ` Suthikulpanit, Suravee
2023-12-12 16:01 ` [RFC PATCH 5/6] iommu/amd: Introduce helper functions to setup GCR3TRPMode Suravee Suthikulpanit
2023-12-13 13:53 ` Jason Gunthorpe
2023-12-15 7:39 ` Tian, Kevin
2024-01-05 13:56 ` Suthikulpanit, Suravee
2023-12-12 16:01 ` [RFC PATCH 6/6] iommu/amd: Introduce nested translation support Suravee Suthikulpanit
2023-12-13 13:52 ` Jason Gunthorpe
2024-01-05 13:38 ` Suthikulpanit, Suravee
2024-01-05 14:31 ` Jason Gunthorpe
2023-12-15 7:45 ` Tian, Kevin
2024-01-05 13:39 ` Suthikulpanit, Suravee
2024-01-05 14:37 ` Jason Gunthorpe
2024-01-08 6:49 ` Suthikulpanit, Suravee [this message]
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=1fbdeec3-58a6-44ec-ac0d-400676212f40@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=Dhaval.Giani@amd.com \
--cc=eric.auger@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jon.grimm@amd.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loganodell@google.com \
--cc=nicolinc@nvidia.com \
--cc=pandoh@google.com \
--cc=santosh.shukla@amd.com \
--cc=vasant.hegde@amd.com \
--cc=yi.l.liu@intel.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
all inboxes | Powered by JetHome®