Re: [PATCH 4/7] iommu/arm-smmu-v3: Remove io-pgtable-arm from sva.c
Jason Gunthorpe <[email protected]>
| Newsgroups | dev.linux.lists.iommu,dev.linux.lists.patches,org.infradead.lists.linux-arm-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 24, 2026 at 07:26:08PM +0000, Mostafa Saleh wrote:
> > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> > index 95186cf84e9abb..99ca96db0d0401 100644
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> > @@ -203,6 +203,13 @@ struct arm_vsmmu;
> > #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + MAX_PAGE_ORDER)
> > #endif
> >
> > +/* Constants used for CD TCR and STE VTCR fields */
> > +#define ARM_SMMU_TCR_TG0_4K 0
> > +#define ARM_SMMU_TCR_TG0_64K 1
> > +#define ARM_SMMU_TCR_TG0_16K 2
> > +#define ARM_SMMU_TCR_RGN_WBWA 1
> > +#define ARM_SMMU_TCR_SH_IS 3
>
> Can the driver use the ones in generic_pt/armv.h instead of
> re-defining them?
No, it cannot include that file from here.
However there are ARM architecture header we can use instead:
+#include <asm/sysreg.h>
[..]
if (PAGE_SIZE == SZ_64K)
- return ARM_LPAE_TCR_TG0_64K;
+ return TCR_EL1_TG0_64K;
if (PAGE_SIZE == SZ_16K)
- return ARM_LPAE_TCR_TG0_16K;
- return ARM_LPAE_TCR_TG0_4K;
+ return TCR_EL1_TG0_16K;
+ return TCR_EL1_TG0_4K;
And so on
Jason