History

iommu/io-pgtable: Replace ->tlb_add_flush() with ->tlb_add_page()

The ->tlb_add_flush() callback in the io-pgtable API now looks a bit silly: - It takes a size and a granule, which are always the same - It takes a 'bool leaf', which is always true - It only ever flushes a single page With that in mind, replace it with an optional ->tlb_add_page() callback that drops the useless parameters.

Will Deacon committed 7 years ago

Commit abfd6fe1 parent 10b7a7d10 files · +105 −71Browse files

Showing the changes to include/linux (1 of 10 files). Show all

Unified · Split

include/linux/io-pgtable.h+11−11
@@ -25,12 +25,11 @@ enum io_pgtable_fmt { · 24 unmodified lines
2525 * address range.
2626 * @tlb_flush_leaf: Synchronously invalidate all leaf TLB state for a virtual
2727 * address range.
28− * @tlb_add_flush: Optional callback to queue up leaf TLB invalidation for a
29− * virtual address range. This function exists purely as an
30− * optimisation for IOMMUs that cannot batch TLB invalidation
31− * operations efficiently and are therefore better suited to
32− * issuing them early rather than deferring them until
33− * iommu_tlb_sync().
28+ * @tlb_add_page: Optional callback to queue up leaf TLB invalidation for a
29+ * single page. This function exists purely as an optimisation
30+ * for IOMMUs that cannot batch TLB invalidation operations
31+ * efficiently and are therefore better suited to issuing them
32+ * early rather than deferring them until iommu_tlb_sync().
3433 * @tlb_sync: Ensure any queued TLB invalidation has taken effect, and
3534 * any corresponding page table updates are visible to the
3635 * IOMMU.
@@ -44,8 +43,7 @@ struct iommu_flush_ops { · 7 unmodified lines
4443 void *cookie);
4544 void (*tlb_flush_leaf)(unsigned long iova, size_t size, size_t granule,
4645 void *cookie);
47− void (*tlb_add_flush)(unsigned long iova, size_t size, size_t granule,
48− bool leaf, void *cookie);
46+ void (*tlb_add_page)(unsigned long iova, size_t granule, void *cookie);
4947 void (*tlb_sync)(void *cookie);
5048 };
5149
@@ -212,10 +210,12 @@ io_pgtable_tlb_flush_leaf(struct io_pgtable *iop, unsigned long iova, · 160 unmodified lines
212210 iop->cfg.tlb->tlb_flush_leaf(iova, size, granule, iop->cookie);
213211 }
214212
215−static inline void io_pgtable_tlb_add_flush(struct io_pgtable *iop,
216− unsigned long iova, size_t size, size_t granule, bool leaf)
213+static inline void
214+io_pgtable_tlb_add_page(struct io_pgtable *iop, unsigned long iova,
215+ size_t granule)
217216 {
218− iop->cfg.tlb->tlb_add_flush(iova, size, granule, leaf, iop->cookie);
217+ if (iop->cfg.tlb->tlb_add_page)
218+ iop->cfg.tlb->tlb_add_page(iova, granule, iop->cookie);
219219 }
220220
221221 static inline void io_pgtable_tlb_sync(struct io_pgtable *iop)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t