[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241209192403.107090-5-mjrosato@linux.ibm.com>
Date: Mon, 9 Dec 2024 14:24:01 -0500
From: Matthew Rosato <mjrosato@...ux.ibm.com>
To: joro@...tes.org, will@...nel.org, robin.murphy@....com,
gerald.schaefer@...ux.ibm.com, schnelle@...ux.ibm.com
Cc: hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
svens@...ux.ibm.com, borntraeger@...ux.ibm.com, farman@...ux.ibm.com,
clegoate@...hat.com, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org
Subject: [PATCH 4/6] iommu: add routine to check strict setting
Add a simple routine to return whether or not strict TLB invalidation
is in effect for the iommu. For drivers that implement the
def_domain_type op, this can be used to determine whether or not flush
queueing is allowed.
Reviewed-by: Niklas Schnelle <schnelle@...ux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@...ux.ibm.com>
---
drivers/iommu/iommu.c | 5 +++++
include/linux/iommu.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 599030e1e890..6bdede4177ff 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -715,6 +715,11 @@ void iommu_set_dma_strict(void)
iommu_def_domain_type = IOMMU_DOMAIN_DMA;
}
+bool iommu_dma_is_strict(void)
+{
+ return iommu_dma_strict;
+}
+
static ssize_t iommu_group_attr_show(struct kobject *kobj,
struct attribute *__attr, char *buf)
{
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 318d27841130..05279109c732 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -911,6 +911,7 @@ int iommu_set_pgtable_quirks(struct iommu_domain *domain,
unsigned long quirks);
void iommu_set_dma_strict(void);
+extern bool iommu_dma_is_strict(void);
extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev,
unsigned long iova, int flags);
--
2.47.0
Powered by blists - more mailing lists