Re: [PATCH v8 13/15] iommufd/viommu: Allow vIOMMUs without a parent HWPT

From: Nicolin Chen

Date: Thu Nov 05 2026 - 13:43:17 EST


On Thu, Nov 05, 2026 at 02:21:06PM -0400, Jason Gunthorpe wrote:
> On Thu, Nov 05, 2026 at 09:44:42AM -0800, Nicolin Chen wrote:
> > On Thu, Nov 05, 2026 at 10:58:06AM +0530, Aneesh Kumar K.V wrote:
> > > Jason Gunthorpe <jgg@xxxxxxxx> writes:
> > > > On Wed, Nov 04, 2026 at 11:03:41AM -0800, Nicolin Chen wrote:
> > > >> By dropping the nesting parent from VIOMMU, it just simplifies the
> > > >> attachment to an S1 paging hwpt, right?
> > > >
> > > > Yes.
> > > >
> > > > The VMM must always maintain a S1 paging attachment that is the
> > > > identity map of the VM on all devices, same action as when there is no
> > > > viommu.
> > > >
> > >
> > > I am currently creating an S2 paging attachment. This results in a
> > > configuration with S1 disabled and S2 enabled, which is used by all
> > > untrusted devices.
> >
> > For validation, that would work. Yet "no viommu" should would be S1
> > paging, i.e. hwpt allocated without IOMMU_HWPT_ALLOC_NEST_PARENT.
>
> It doesn't matter, consistently using a single S2 for everything is
> probably better..

Hmm, I am confused: if we use a nesting parent, why do we need to
allow a viommu without a parent HWPT here?

Nicolin