linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: will@kernel.org, jean-philippe@linaro.org, robin.murphy@arm.com,
	joro@8bytes.org, balbirs@nvidia.com, miko.lenczewski@arm.com,
	peterz@infradead.org, kevin.tian@intel.com, praan@google.com,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 5/7] iommu/arm-smmu-v3: Populate smmu_domain->invs when attaching masters
Date: Fri, 19 Dec 2025 11:51:51 -0400	[thread overview]
Message-ID: <20251219155151.GA373575@nvidia.com> (raw)
In-Reply-To: <79cd18a1a959ee2e54683e8c465b799d49ec48b5.1766013662.git.nicolinc@nvidia.com>

On Wed, Dec 17, 2025 at 03:24:30PM -0800, Nicolin Chen wrote:
> +	*cur = inv;
> +	switch (type) {
> +	case INV_TYPE_S1_ASID:
> +		if (master->smmu->features & ARM_SMMU_FEAT_E2H) {
> +			cur->size_opcode = CMDQ_OP_TLBI_EL2_VA;
> +			cur->nsize_opcode = CMDQ_OP_TLBI_EL2_ASID;
> +		} else {
> +			cur->size_opcode = CMDQ_OP_TLBI_NH_VA;
> +			cur->nsize_opcode = CMDQ_OP_TLBI_NH_ASID;

There is a tricky little gotcha here that probably requires a comment.

NH_VA and NH_ASID both take (VMID,ASID) as input since the ASID is
always scoped to a single VMID.

In this case the invalidation logic always wires the VMID to zero,
which is also the VMID the driver uses for S1 tables when the S2 is in
bypass.

Which is fine, we don't support an actual S1 table on top of a S2
table where we issue invalidations through the invs array.

So maybe:

 For S1 page tables the driver always uses VMID=0, and the
 invalidation logic for this type will set it as well.

Jason


  reply	other threads:[~2025-12-19 15:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-17 23:24 [PATCH v8 0/7] iommu/arm-smmu-v3: Introduce an RCU-protected invalidation array Nicolin Chen
2025-12-17 23:24 ` [PATCH v8 1/7] iommu/arm-smmu-v3: Explicitly set smmu_domain->stage for SVA Nicolin Chen
2025-12-17 23:24 ` [PATCH v8 2/7] iommu/arm-smmu-v3: Add an inline arm_smmu_domain_free() Nicolin Chen
2025-12-17 23:24 ` [PATCH v8 3/7] iommu/arm-smmu-v3: Introduce a per-domain arm_smmu_invs array Nicolin Chen
2025-12-17 23:24 ` [PATCH v8 4/7] iommu/arm-smmu-v3: Pre-allocate a per-master invalidation array Nicolin Chen
2025-12-17 23:24 ` [PATCH v8 5/7] iommu/arm-smmu-v3: Populate smmu_domain->invs when attaching masters Nicolin Chen
2025-12-19 15:51   ` Jason Gunthorpe [this message]
2025-12-19 18:54     ` Nicolin Chen
2025-12-19 18:56       ` Jason Gunthorpe
2025-12-19 19:00         ` Nicolin Chen
2025-12-19 16:30   ` Jason Gunthorpe
2025-12-17 23:24 ` [PATCH v8 6/7] iommu/arm-smmu-v3: Add arm_smmu_invs based arm_smmu_domain_inv_range() Nicolin Chen
2025-12-17 23:24 ` [PATCH v8 7/7] iommu/arm-smmu-v3: Perform per-domain invalidations using arm_smmu_invs Nicolin Chen

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=20251219155151.GA373575@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=balbirs@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=jean-philippe@linaro.org \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miko.lenczewski@arm.com \
    --cc=nicolinc@nvidia.com \
    --cc=peterz@infradead.org \
    --cc=praan@google.com \
    --cc=robin.murphy@arm.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;
as well as URLs for NNTP newsgroup(s).