From: Nicolin Chen <nicolinc@nvidia.com>
To: <jgg@nvidia.com>, <will@kernel.org>
Cc: <joro@8bytes.org>, <robin.murphy@arm.com>,
<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>,
<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>
Subject: [PATCH v2 0/2] iommu/arm-smmu-v3: Two vsmmu impl_ops cleanups
Date: Mon, 21 Jul 2025 12:12:34 -0700 [thread overview]
Message-ID: <20250721191236.1739951-1-nicolinc@nvidia.com> (raw)
Since the vsmmu and cmdqv patches were accepeted via the iommufd tree,
this is based on Jason's for-next tree.
Per request from Will following the accepted latest vcmdq series to clean
up the impl_ops:
https://lore.kernel.org/linux-iommu/aHE4Y-fbucm-j-yi@willie-the-truck/
"
It would be nice to avoid adding data members to the ops structure, if
at all possible. The easiest thing would probably be to add a function
for getting the vsmmu size and then pushing the two checks against
'vsmmu_type' down into the impl_ops callbacks so that:
1. If the type is IOMMU_VIOMMU_TYPE_ARM_SMMUV3, we don't bother with
the impl_ops at all in arm_vsmmu_init() and arm_smmu_get_viommu_size()
2. Otherwise, we pass the type into the impl_ops and they can check it
Of course, that can be a patch on top of the series as there's no point
respinning the whole just for this.
"
Add two clean up patches with the first one doing 1 and 2 to prioritize
IOMMU_VIOMMU_TYPE_ARM_SMMUV3 always, and the second one dropping static
vsmmu_type and vsmmu_size data members.
Changelog
v2:
* Add Acked-by from Will
* Move get_viommu_size and vsmmu_init validation to arm_smmu_impl_probe()
v1:
https://lore.kernel.org/all/20250718234822.1734190-1-nicolinc@nvidia.com/
Nicolin Chen (2):
iommu/arm-smmu-v3: Do not bother impl_ops if
IOMMU_VIOMMU_TYPE_ARM_SMMUV3
iommu/arm-smmu-v3: Replace vsmmu_size/type with get_viommu_size
.../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 20 +++++++++----------
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 14 +++++++++++++
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 +--
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 14 +++++++++++--
4 files changed, 36 insertions(+), 15 deletions(-)
base-commit: ab6bc44159d8f0c4ee757e0ce041fa9033e0ead8
--
2.43.0
next reply other threads:[~2025-07-21 19:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 19:12 Nicolin Chen [this message]
2025-07-21 19:12 ` [PATCH v2 1/2] iommu/arm-smmu-v3: Do not bother impl_ops if IOMMU_VIOMMU_TYPE_ARM_SMMUV3 Nicolin Chen
2025-07-21 19:23 ` Will Deacon
2025-07-21 19:40 ` Nicolin Chen
2025-07-21 19:12 ` [PATCH v2 2/2] iommu/arm-smmu-v3: Replace vsmmu_size/type with get_viommu_size 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=20250721191236.1739951-1-nicolinc@nvidia.com \
--to=nicolinc@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--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