Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Mostafa Saleh <smostafa@google.com>
Cc: iommu@lists.linux.dev, "Joerg Roedel (AMD)" <joro@8bytes.org>,
	Jean-Philippe Brucker <jpb@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Robin Murphy <robin.murphy@arm.com>,
	Will Deacon <will@kernel.org>,
	David Matlack <dmatlack@google.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	patches@lists.linux.dev, Pranjal Shrivastava <praan@google.com>,
	Samiullah Khawaja <skhawaja@google.com>
Subject: Re: [PATCH 4/7] iommu/arm-smmu-v3: Remove io-pgtable-arm from sva.c
Date: Wed, 12 Aug 2026 13:04:55 -0300	[thread overview]
Message-ID: <20260812160455.GA746351@nvidia.com> (raw)
In-Reply-To: <amO8UPHuxrvoiXq7@google.com>

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


  reply	other threads:[~2026-08-12 16:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 16:29 [PATCH 0/7] Use the generic iommu page table for SMMUv3 Jason Gunthorpe
2026-07-06 16:29 ` [PATCH 1/7] iommupt: Remove the sanity check for pt_num_items_lg2() at the top level Jason Gunthorpe
2026-07-24 17:49   ` Mostafa Saleh
2026-07-06 16:29 ` [PATCH 2/7] iommupt/kunit: Skip test configs without supported features Jason Gunthorpe
2026-07-06 16:29 ` [PATCH 3/7] iommupt: Add the 64 bit ARMv8 page table format Jason Gunthorpe
2026-07-24 19:24   ` Mostafa Saleh
2026-07-25  1:12     ` Jason Gunthorpe
2026-07-06 16:29 ` [PATCH 4/7] iommu/arm-smmu-v3: Remove io-pgtable-arm from sva.c Jason Gunthorpe
2026-07-24 19:26   ` Mostafa Saleh
2026-08-12 16:04     ` Jason Gunthorpe [this message]
2026-07-06 16:29 ` [PATCH 5/7] iommu/arm-smmu-v3: Move the DMA API comment to flush_iotlb_all Jason Gunthorpe
2026-07-24 19:26   ` Mostafa Saleh
2026-07-06 16:29 ` [PATCH 6/7] iommu/arm-smmu-v3: Use the generic iommu page table Jason Gunthorpe
2026-07-24 19:30   ` Mostafa Saleh
2026-07-25  0:31     ` Jason Gunthorpe
2026-07-06 16:29 ` [PATCH 7/7] iommu: Remove pgsize from iommu_iotlb_gather Jason Gunthorpe
2026-07-24 19:36 ` [PATCH 0/7] Use the generic iommu page table for SMMUv3 Mostafa Saleh
2026-07-25  0:42   ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260812160455.GA746351@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dmatlack@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=jpb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=patches@lists.linux.dev \
    --cc=praan@google.com \
    --cc=robin.murphy@arm.com \
    --cc=skhawaja@google.com \
    --cc=smostafa@google.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox