Skip to contentSkip to conversation

iommu: Restore iommu_flush_iotlb_all()

PATCH In review Joerg Roedel 3 participants 5 messages Oct 29, 2024 IOMMU

lore
Share & tools
lore

Joerg Roedel

author maintainer
#0 lore raw

PATCH 1/1 iommu: Restore iommu_flush_iotlb_all()

From: Joerg Roedel <[email protected]>

This patch restores the iommu_flush_iotlb_all() function. Commit

69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")

claims it removed the last call-site, except it did not. There is still at least one caller in

drivers/gpu/drm/msm/msm_iommu.c

so keep the function around until all call-sites are updated.

Cc Jason Gunthorpe <[email protected]>
Fixes 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
---
 include/linux/iommu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/linux/iommu.h +10 -0
index 522efdc7d815..8cce372a33f1 100644
@@ -853,6 +853,12 @@ void iommu_set_dma_strict(void);
 extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev,
 			      unsigned long iova, int flags);
 
+static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
+{
+	if (domain->ops->flush_iotlb_all)
+		domain->ops->flush_iotlb_all(domain);
+}
+
 static inline void iommu_iotlb_sync(struct iommu_domain *domain,
 				  struct iommu_iotlb_gather *iotlb_gather)
 {
@@ -1137,6 +1143,10 @@ static inline ssize_t iommu_map_sg(struct iommu_domain *domain,
 	return -ENODEV;
 }
 
+static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
+{
+}
+
 static inline void iommu_iotlb_sync(struct iommu_domain *domain,
 				  struct iommu_iotlb_gather *iotlb_gather)
 {
Signature · 1 line
2.47.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

This patch restores the iommu_flush_iotlb_all() function. Commit

69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")

claims it removed the last call-site, except it did not. There is still at least one caller in

drivers/gpu/drm/msm/msm_iommu.c

Quoted 8 lines

so keep the function around until all call-sites are updated.

Cc Jason Gunthorpe <[email protected]>
Fixes 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
---
 include/linux/iommu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Will

Reviewed-by on v1 1/1
#2 lore raw
In reply to Joerg Roedel
Quoted 11 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

This patch restores the iommu_flush_iotlb_all() function. Commit

69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")

claims it removed the last call-site, except it did not. There is still at least one caller in

drivers/gpu/drm/msm/msm_iommu.c

Yikes, that iss some scary stuff

Quoted 8 lines

so keep the function around until all call-sites are updated.

Cc Jason Gunthorpe <[email protected]>
Fixes 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
---
 include/linux/iommu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Strange that 0-day didn't flag this in my trees. We really need to get 0-day running on the iommu list too :\

Jason

author maintainer
#3 lore raw
Quoted 2 lines · Jason Gunthorpe

Strange that 0-day didn't flag this in my trees. We really need to get 0-day running on the iommu list too :\

In general I agree, but these issues where found with allnoconfig/allmodconfig builds. Or in other words, compile tests I expect patch submitters to do before sending changes my way.

Regards,

Joerg

#4 lore raw
Quoted 7 lines · Joerg Roedel
Quoted 2 lines · Jason Gunthorpe

Strange that 0-day didn't flag this in my trees. We really need to get 0-day running on the iommu list too :\

In general I agree, but these issues where found with allnoconfig/allmodconfig builds. Or in other words, compile tests I expect patch submitters to do before sending changes my way.

I don't necessarily expect that. We have 0-day robots to do this, and they are more effective..

Jason