* [PATCH] iommu: Restore iommu_flush_iotlb_all()
@ 2024-10-29 11:23 Joerg Roedel
2024-10-29 11:26 ` Will Deacon
2024-10-29 11:42 ` Jason Gunthorpe
0 siblings, 2 replies; 5+ messages in thread
From: Joerg Roedel @ 2024-10-29 11:23 UTC (permalink / raw)
To: iommu; +Cc: Will Deacon, linux-kernel, Joerg Roedel, Jason Gunthorpe
From: Joerg Roedel <jroedel@suse.de>
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 <jgg@ziepe.ca>
Fixes: 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
include/linux/iommu.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 522efdc7d815..8cce372a33f1 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -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)
{
--
2.47.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iommu: Restore iommu_flush_iotlb_all()
2024-10-29 11:23 [PATCH] iommu: Restore iommu_flush_iotlb_all() Joerg Roedel
@ 2024-10-29 11:26 ` Will Deacon
2024-10-29 11:42 ` Jason Gunthorpe
1 sibling, 0 replies; 5+ messages in thread
From: Will Deacon @ 2024-10-29 11:26 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel, Joerg Roedel, Jason Gunthorpe
On Tue, Oct 29, 2024 at 12:23:02PM +0100, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> 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 <jgg@ziepe.ca>
> Fixes: 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
> include/linux/iommu.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
Acked-by: Will Deacon <will@kernel.org>
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iommu: Restore iommu_flush_iotlb_all()
2024-10-29 11:23 [PATCH] iommu: Restore iommu_flush_iotlb_all() Joerg Roedel
2024-10-29 11:26 ` Will Deacon
@ 2024-10-29 11:42 ` Jason Gunthorpe
2024-10-29 12:03 ` Joerg Roedel
1 sibling, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2024-10-29 11:42 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, Will Deacon, linux-kernel, Joerg Roedel
On Tue, Oct 29, 2024 at 12:23:02PM +0100, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> 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
> so keep the function around until all call-sites are updated.
>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Fixes: 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
> include/linux/iommu.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iommu: Restore iommu_flush_iotlb_all()
2024-10-29 11:42 ` Jason Gunthorpe
@ 2024-10-29 12:03 ` Joerg Roedel
2024-10-29 12:07 ` Jason Gunthorpe
0 siblings, 1 reply; 5+ messages in thread
From: Joerg Roedel @ 2024-10-29 12:03 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: iommu, Will Deacon, linux-kernel, Joerg Roedel
On Tue, Oct 29, 2024 at 08:42:01AM -0300, Jason Gunthorpe wrote:
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iommu: Restore iommu_flush_iotlb_all()
2024-10-29 12:03 ` Joerg Roedel
@ 2024-10-29 12:07 ` Jason Gunthorpe
0 siblings, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2024-10-29 12:07 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, Will Deacon, linux-kernel, Joerg Roedel
On Tue, Oct 29, 2024 at 01:03:42PM +0100, Joerg Roedel wrote:
> On Tue, Oct 29, 2024 at 08:42:01AM -0300, Jason Gunthorpe wrote:
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-29 12:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 11:23 [PATCH] iommu: Restore iommu_flush_iotlb_all() Joerg Roedel
2024-10-29 11:26 ` Will Deacon
2024-10-29 11:42 ` Jason Gunthorpe
2024-10-29 12:03 ` Joerg Roedel
2024-10-29 12:07 ` Jason Gunthorpe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.