From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <iommu@lists.linux.dev>, Jonathan Hunter <jonathanh@nvidia.com>,
"Joerg Roedel" <joro@8bytes.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-tegra@vger.kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"Thierry Reding" <thierry.reding@kernel.org>,
Krishna Reddy <vdumpa@nvidia.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>,
Mostafa Saleh <smostafa@google.com>
Subject: Re: [PATCH v2 7/9] iommu/arm-smmu-v3: Directly encode CMDQ_OP_ATC_INV
Date: Sun, 17 May 2026 20:27:40 -0700 [thread overview]
Message-ID: <agqHLMyWkWRlx0pU@Asurada-Nvidia> (raw)
In-Reply-To: <7-v2-47b2bf710ad5+716ac-smmu_no_cmdq_ent_jgg@nvidia.com>
On Wed, May 13, 2026 at 08:57:46PM -0300, Jason Gunthorpe wrote:
> Add a new command make function and convert all the places using
> ATC_INV.
>
> Split out full invalidation to directly make the cmd instead of
> overloading size=0 to mean full invalidation.
>
> In section "3.9.1 ATS Interface" of F.b the specification says:
>
> When the SMMU returns an ATS Translation Completion for a request that
> had a PASID, the Global bit of the Translation Completion Data Entry
> must be zero.
>
> Even though it faithfully forwards the G bit through to the ATS
> invalidation command there is no way to create G mappings so there is
> never any need to send a G invalidation. Thus don't expose global in the
> new helpers and leave CMDQ_ATC_0_GLOBAL unused.
>
> Reviewed-by: Mostafa Saleh <smostafa@google.com>
> Reviewed-by: Pranjal Shrivastava <praan@google.com>
> Tested-by: Pranjal Shrivastava <praan@google.com>
> Tested-by: Mostafa Saleh <smostafa@google.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
With a nit ..
> -static void
> -arm_smmu_atc_inv_to_cmd(int ssid, unsigned long iova, size_t size,
> - struct arm_smmu_cmdq_ent *cmd)
> +static struct arm_smmu_cmd
> +arm_smmu_atc_inv_to_cmd(u32 sid, int ssid, unsigned long iova, size_t size)
> {
> size_t log2_span;
> size_t span_mask;
> @@ -2395,17 +2386,6 @@ arm_smmu_atc_inv_to_cmd(int ssid, unsigned long iova, size_t size,
> * This has the unpleasant side-effect of invalidating all PASID-tagged
> * ATC entries within the address range.
> */
> - *cmd = (struct arm_smmu_cmdq_ent) {
> - .opcode = CMDQ_OP_ATC_INV,
> - .substream_valid = (ssid != IOMMU_NO_PASID),
> - .atc.ssid = ssid,
> - };
> -
> - if (!size) {
> - cmd->atc.size = ATC_INV_SIZE_ALL;
> - return;
> - }
.. should !size jump to arm_smmu_make_cmd_atc_inv_all()?
Or maybe add a note to disallow this function being used with !size
and WARN_ON? The function name itself doesn't sound very restricted
though.
Nicolin
next prev parent reply other threads:[~2026-05-18 3:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 23:57 [PATCH v2 0/9] Remove SMMUv3 struct arm_smmu_cmdq_ent Jason Gunthorpe
2026-05-13 23:57 ` [PATCH v2 1/9] iommu/arm-smmu-v3: Add struct arm_smmu_cmd to represent the HW format command Jason Gunthorpe
2026-05-13 23:57 ` [PATCH v2 2/9] iommu/arm-smmu-v3: Use the HW arm_smmu_cmd in cmdq selection functions Jason Gunthorpe
2026-05-15 20:31 ` Nicolin Chen
2026-05-13 23:57 ` [PATCH v2 3/9] iommu/arm-smmu-v3: Use the HW arm_smmu_cmd in cmdq submission functions Jason Gunthorpe
2026-05-15 21:02 ` Nicolin Chen
2026-05-15 22:00 ` Jason Gunthorpe
2026-05-13 23:57 ` [PATCH v2 4/9] iommu/arm-smmu-v3: Convert arm_smmu_cmdq_batch cmds to struct arm_smmu_cmd Jason Gunthorpe
2026-05-15 23:29 ` Nicolin Chen
2026-05-13 23:57 ` [PATCH v2 5/9] iommu/arm-smmu-v3: Remove CMDQ_OP_CFGI_CD_ALL from arm_smmu_cmdq_build_cmd() Jason Gunthorpe
2026-05-15 23:51 ` Nicolin Chen
2026-05-13 23:57 ` [PATCH v2 6/9] iommu/arm-smmu-v3: Directly encode simple commands Jason Gunthorpe
2026-05-18 3:15 ` Nicolin Chen
2026-05-18 13:23 ` Jason Gunthorpe
2026-05-13 23:57 ` [PATCH v2 7/9] iommu/arm-smmu-v3: Directly encode CMDQ_OP_ATC_INV Jason Gunthorpe
2026-05-18 3:27 ` Nicolin Chen [this message]
2026-05-18 14:40 ` Jason Gunthorpe
2026-05-13 23:57 ` [PATCH v2 8/9] iommu/arm-smmu-v3: Directly encode CMDQ_OP_SYNC Jason Gunthorpe
2026-05-18 3:30 ` Nicolin Chen
2026-05-13 23:57 ` [PATCH v2 9/9] iommu/arm-smmu-v3: Directly encode TLBI commands Jason Gunthorpe
2026-05-18 3:52 ` Nicolin Chen
2026-05-15 3:35 ` [PATCH v2 0/9] Remove SMMUv3 struct arm_smmu_cmdq_ent Nicolin Chen
2026-05-16 0:46 ` Samiullah Khawaja
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=agqHLMyWkWRlx0pU@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=dmatlack@google.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-tegra@vger.kernel.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=thierry.reding@kernel.org \
--cc=vdumpa@nvidia.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