RE: [PATCH V4 01/10] iommufd: Support a HWPT without an iommu driver for noiommu

Tian, Kevin
2026-04-23T07:26:53Z

> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Thursday, April 23, 2026 12:03 AM
>
> On Wed, Apr 22, 2026 at 08:12:43AM +0000, Tian, Kevin wrote:
> > > Technically yes but we need this flag to match forced features since we
> > > are sharing with the real AMDv1. Otherwise, this will fail with
> > > EOPNOTSUPP.
> > > static int pt_init_common(struct pt_common *common)
> > > {
> > > ...
> > > /* Requested features must match features compiled into this
> > > format */
> > > if ((common->features & ~(unsigned int)PT_SUPPORTED_FEATURES)
> > > ||
> > > (!IS_ENABLED(CONFIG_DEBUG_GENERIC_PT) &&
> > > (common->features & PT_FORCE_ENABLED_FEATURES) !=
> > > PT_FORCE_ENABLED_FEATURES))
> > > return -EOPNOTSUPP;
> > >
> > > where in iommu_amdv1.c:
> > > #define PT_FORCE_ENABLED_FEATURES
> > > \ (BIT(PT_FEAT_DYNAMIC_TOP) | BIT(PT_FEAT_AMDV1_ENCRYPT_TABLES)
> |
> > > \
> > > BIT(PT_FEAT_AMDV1_FORCE_COHERENCE))
> >
> > Okay, make sense.
> >
> > btw iommufd selftest just removed the amdv1 format (will be in 7.1). then
> > let's not mention it in this series.
>
> Why? The selftest was removed because it wasn't used by the userspace
> selftest, the format is still there
>
> I wanted to use amdv1 for this because it has the best multi-page size
> options of all the formats.
>

I meant to avoid mentioning selftest like below:

+ * AMDV1 is used as a dummy page table for no-IOMMU mode, similar to the
+ * iommufd selftest mock page table.

"similar to" is not helpful here, and is now not the fact any more.