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
25 * address range.25 * address range.
26 * @tlb_flush_leaf: Synchronously invalidate all leaf TLB state for a virtual26 * @tlb_flush_leaf: Synchronously invalidate all leaf TLB state for a virtual
27 * address range.27 * address range.
28 * @tlb_add_flush: Optional callback to queue up leaf TLB invalidation for a28 * @tlb_add_page: Optional callback to queue up leaf TLB invalidation for a
29 * virtual address range. This function exists purely as an29 * single page. This function exists purely as an optimisation
30 * optimisation for IOMMUs that cannot batch TLB invalidation30 * for IOMMUs that cannot batch TLB invalidation operations
31 * operations efficiently and are therefore better suited to31 * efficiently and are therefore better suited to issuing them
32 * issuing them early rather than deferring them until32 * early rather than deferring them until iommu_tlb_sync().
33 * iommu_tlb_sync().
34 * @tlb_sync: Ensure any queued TLB invalidation has taken effect, and33 * @tlb_sync: Ensure any queued TLB invalidation has taken effect, and
35 * any corresponding page table updates are visible to the34 * any corresponding page table updates are visible to the
36 * IOMMU.35 * IOMMU.
@@ -44,8 +43,7 @@ struct iommu_flush_ops { · 7 unmodified lines
44 void *cookie);43 void *cookie);
45 void (*tlb_flush_leaf)(unsigned long iova, size_t size, size_t granule,44 void (*tlb_flush_leaf)(unsigned long iova, size_t size, size_t granule,
46 void *cookie);45 void *cookie);
47 void (*tlb_add_flush)(unsigned long iova, size_t size, size_t granule,46 void (*tlb_add_page)(unsigned long iova, size_t granule, void *cookie);
48 bool leaf, void *cookie);
49 void (*tlb_sync)(void *cookie);47 void (*tlb_sync)(void *cookie);
50};48};
51 49
@@ -212,10 +210,12 @@ io_pgtable_tlb_flush_leaf(struct io_pgtable *iop, unsigned long iova, · 160 unmodified lines
212 iop->cfg.tlb->tlb_flush_leaf(iova, size, granule, iop->cookie);210 iop->cfg.tlb->tlb_flush_leaf(iova, size, granule, iop->cookie);
213}211}
214 212
215static inline void io_pgtable_tlb_add_flush(struct io_pgtable *iop,213static inline void
216 unsigned long iova, size_t size, size_t granule, bool leaf)214io_pgtable_tlb_add_page(struct io_pgtable *iop, unsigned long iova,
215 size_t granule)
217{216{
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);
219}219}
220 220
221static inline void io_pgtable_tlb_sync(struct io_pgtable *iop)221static 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