Re: [PATCH v7 05/24] iommu/arm-smmu-v3: Move IDR parsing to common functions
From: Jason Gunthorpe
Date: Wed Aug 26 2026 - 08:45:24 EST
On Wed, Aug 26, 2026 at 09:44:20AM +0000, Mostafa Saleh wrote:
> >
> > reg = readl_relaxed(smmu->base + ARM_SMMU_IDR0);
> >
> > smmu->features |= smmu_idr0_features(reg);
> > if (!(smmu->features & (ARM_SMMU_FEAT_TT_LE | ARM_SMMU_FEAT_TT_BE))) {
> > dev_err(smmu->dev, "unknown/unsupported TT endianness!\n");
> > return -ENXIO;
> > }
> >
> > vs
> >
> > reg = readl_relaxed(smmu->base + ARM_SMMU_IDR0);
> >
> > smmu->features |= smmu_idr0_features(reg);
> > if (!(smmu->features & (ARM_SMMU_FEAT_TT_LE | ARM_SMMU_FEAT_TT_BE)))
> > return -ENXIO;
>
> I am not sure I get this, the only difference is the printk?
My point is there is alot of lines that only differ by a prinkt or
something minor like that.
> We can do more with that, but as discussed last time, I am worried that
> re-defining structs using macros just makes things harder for
> maintenance and more fragile to changes, causing build failures,
> and mismatch in types between the 2 structs.
It looks easy to build test with pkvm enabled in the build, I don't
see an issue. It signficantly simplifies things going forward if we
don't have to have these careful break ups and splits of everything
that doesn't need it.
I prefer to see pkvm use the driver code unmodified as much as
possible, that will be easier to keep together long term, I think.
Jason