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

Jason Gunthorpe
2026-04-22T16:03:19Z

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.

Jason