From: Jason Gunthorpe <jgg@nvidia.com>
To: Alyssa Rosenzweig <alyssa@rosenzweig.io>,
asahi@lists.linux.dev,
Christophe Leroy <christophe.leroy@csgroup.eu>,
David Woodhouse <dwmw2@infradead.org>,
iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
Kevin Tian <kevin.tian@intel.com>,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, Hector Martin <marcan@marcan.st>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Robin Murphy <robin.murphy@arm.com>,
Sven Peter <sven@svenpeter.dev>, Will Deacon <will@kernel.org>
Cc: Lu Baolu <baolu.lu@linux.intel.com>, Janne Grunau <j@jannau.net>
Subject: [PATCH v2 4/9] iommufd: Convert to alloc_domain_paging()
Date: Wed, 27 Sep 2023 20:47:34 -0300 [thread overview]
Message-ID: <4-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com> (raw)
In-Reply-To: <0-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com>
Move the global static blocked domain to the ops and convert the unmanaged
domain to domain_alloc_paging.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
drivers/iommu/iommufd/selftest.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c
index fb981ba97c4e87..ee607984709102 100644
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@ -141,16 +141,10 @@ static void *mock_domain_hw_info(struct device *dev, u32 *length, u32 *type)
return info;
}
-static struct iommu_domain *mock_domain_alloc(unsigned int iommu_domain_type)
+static struct iommu_domain *mock_domain_alloc_paging(struct device *dev)
{
struct mock_iommu_domain *mock;
- if (iommu_domain_type == IOMMU_DOMAIN_BLOCKED)
- return &mock_blocking_domain;
-
- if (iommu_domain_type != IOMMU_DOMAIN_UNMANAGED)
- return NULL;
-
mock = kzalloc(sizeof(*mock), GFP_KERNEL);
if (!mock)
return NULL;
@@ -295,10 +289,11 @@ static const struct iommu_ops mock_ops = {
* because it is zero.
*/
.default_domain = &mock_blocking_domain,
+ .blocked_domain = &mock_blocking_domain,
.owner = THIS_MODULE,
.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
.hw_info = mock_domain_hw_info,
- .domain_alloc = mock_domain_alloc,
+ .domain_alloc_paging = mock_domain_alloc_paging,
.capable = mock_domain_capable,
.device_group = generic_device_group,
.probe_device = mock_probe_device,
--
2.42.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-09-27 23:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 23:47 [PATCH v2 0/9] iommu: Convert dart & iommufd to the new domain_alloc_paging() Jason Gunthorpe
2023-09-27 23:47 ` [PATCH v2 1/9] iommu: Move IOMMU_DOMAIN_BLOCKED global statics to ops->blocked_domain Jason Gunthorpe
2023-10-09 7:47 ` Tian, Kevin
2023-09-27 23:47 ` [PATCH v2 2/9] iommu/vt-d: Update the definition of the blocking domain Jason Gunthorpe
2023-10-09 7:47 ` Tian, Kevin
2023-09-27 23:47 ` [PATCH v2 3/9] iommu/vt-d: Use ops->blocked_domain Jason Gunthorpe
2023-10-09 7:47 ` Tian, Kevin
2023-09-27 23:47 ` Jason Gunthorpe [this message]
2023-10-09 7:48 ` [PATCH v2 4/9] iommufd: Convert to alloc_domain_paging() Tian, Kevin
2023-09-27 23:47 ` [PATCH v2 5/9] iommu/dart: Use static global identity domains Jason Gunthorpe
2023-09-27 23:47 ` [PATCH v2 6/9] iommu/dart: Move the blocked domain support to a global static Jason Gunthorpe
2023-09-27 23:47 ` [PATCH v2 7/9] iommu/dart: Convert to domain_alloc_paging() Jason Gunthorpe
2023-09-27 23:47 ` [PATCH v2 8/9] iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging() Jason Gunthorpe
2023-09-27 23:47 ` [PATCH v2 9/9] iommu/dart: Remove the force_bypass variable Jason Gunthorpe
2023-10-16 11:44 ` Janne Grunau
2023-10-25 15:58 ` [PATCH v2 0/9] iommu: Convert dart & iommufd to the new domain_alloc_paging() jgg
2023-10-26 7:49 ` Joerg Roedel
2023-10-26 10:34 ` Sven Peter
2023-10-26 14:55 ` Joerg Roedel
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=4-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com \
--to=jgg@nvidia.com \
--cc=alyssa@rosenzweig.io \
--cc=asahi@lists.linux.dev \
--cc=baolu.lu@linux.intel.com \
--cc=christophe.leroy@csgroup.eu \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=j@jannau.net \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=marcan@marcan.st \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=robin.murphy@arm.com \
--cc=sven@svenpeter.dev \
--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).