Re: [PATCH 09/22] iommu/amd: Introduce domain for IOMMU Private Address (IPA) region
From: Jason Gunthorpe
Date: Mon Apr 06 2026 - 07:47:52 EST
On Mon, Apr 06, 2026 at 10:48:51AM +0700, Suthikulpanit, Suravee wrote:
>
>
> On 3/30/2026 7:20 PM, Jason Gunthorpe wrote:
> > On Mon, Mar 30, 2026 at 08:41:53AM +0000, Suravee Suthikulpanit wrote:
> > > AMD vIOMMU introduces the IOMMU Private Address (IPA) region, which is
> > > used to manage data structures necessary for IOMMU virtualization within
> > > the guest.
> > >
> > > Introduce a new domain specifically for IPA region for each IOMMU, which
> > > is stored in struct amd_iommu.viommu_pdom. This domain uses AMD IOMMU v1
> > > page table.
> >
> > Why can't you use a normal v1 domain with all the normal existing code?
> >
> > Afaict it is not special at all other than it has a specific dte index?
> >
> > Jason
>
> Actually, this is quite different from the normal GPA->SPA, but rather
> IPA->SPA (for case GstBufferTRPMode=1). It is used specifically for vIOMMU.
>
> The current mapping is:
>
> IOMMU General Backing Storatge: IPA = 0x0 - 0x80_0000 (8MB)
> Domain ID Mapping Table: IPA = 0x10_0000_0000 - 0x1F_FFFF_FFFF (64GB)
> Device ID Mapping Table: IPA = 0x20_0000_0000 - 0x27_FFFF_FFFF (32GB)
>
> The v1 table containing this mapping is programmed onto the Device Table
> Entry index of the IOMMU device ID.
I understand what it is, I'm asking why so much code is duplicated
when this is just a normal domain with a straightforward mapping put
in it?
Jason