[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251006144319.GR3360665@nvidia.com>
Date: Mon, 6 Oct 2025 11:43:19 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
linux-kernel@...r.kernel.org, robin.murphy@....com, will@...nel.org,
joro@...tes.org, kevin.tian@...el.com, jsnitsel@...hat.com,
vasant.hegde@....com, iommu@...ts.linux.dev, santosh.shukla@....com,
sairaj.arunkodilkar@....com, jon.grimm@....com,
prashanthpra@...gle.com, wvw@...gle.com, wnliu@...gle.com,
gptran@...gle.com, kpsingh@...gle.com, joao.m.martins@...cle.com,
alejandro.j.jimenez@...cle.com
Subject: Re: [PATCH v2 09/12] iommu/amd: Add support for nest parent domain
allocation
On Thu, Oct 02, 2025 at 11:00:14AM -0700, Nicolin Chen wrote:
> > switch (flags & supported_flags) {
> > case IOMMU_HWPT_ALLOC_DIRTY_TRACKING:
> > - /* Allocate domain with v1 page table for dirty tracking */
> > - if (!amd_iommu_hd_support(iommu))
> > + case IOMMU_HWPT_ALLOC_NEST_PARENT:
> > + case IOMMU_HWPT_ALLOC_DIRTY_TRACKING | IOMMU_HWPT_ALLOC_NEST_PARENT:
> > + /*
> > + * Allocate domain with v1 page table for dirty tracking
> > + * and/or Nest parent.
> > + */
> > + if ((flags & IOMMU_HWPT_ALLOC_DIRTY_TRACKING) &&
> > + !amd_iommu_hd_support(iommu))
> > break;
>
> And add here:
> if ((flags & IOMMU_HWPT_ALLOC_NEST_PARENT)) &&
> !is_nest_parent_supported())
> break;
Yeah this looks better
On VT-D we have V1/V2 specific alloc functions and these tests were
put at the top of those functions in this form. This is close enough,
it is helpful to be consistent.
Jason
Powered by blists - more mailing lists