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

Tian, Kevin
2026-04-22T08:12:48Z

> From: Jacob Pan <jacob.pan@linux.microsoft.com>
> Sent: Saturday, April 18, 2026 6:00 AM
>
> Hi Kevin,
>
> On Thu, 16 Apr 2026 07:25:57 +0000
> "Tian, Kevin" <kevin.tian@intel.com> wrote:
>
> > > From: Jacob Pan <jacob.pan@linux.microsoft.com>
> > > Sent: Wednesday, April 15, 2026 5:14 AM
> > >
> > > + cfg.common.features =
> > > + (BIT(PT_FEAT_DYNAMIC_TOP) |
> > > BIT(PT_FEAT_AMDV1_ENCRYPT_TABLES) |
> > > + BIT(PT_FEAT_AMDV1_FORCE_COHERENCE));
> >
> > PT_FEAT_AMDV1_ENCRYPT_TABLES is useless here.
> 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.