Skip to content

Commit 18ba064

Browse files
Peter Zijlstratorvalds
authored andcommitted
mmu_gather: Let there be one tlb_{start,end}_vma() implementation
Now that architectures are no longer allowed to override tlb_{start,end}_vma() re-arrange code so that there is only one implementation for each of these functions. This much simplifies trying to figure out what they actually do. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Will Deacon <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1d7708e commit 18ba064

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

include/asm-generic/tlb.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ static inline void __tlb_reset_range(struct mmu_gather *tlb)
349349

350350
#ifdef CONFIG_MMU_GATHER_NO_RANGE
351351

352-
#if defined(tlb_flush) || defined(tlb_start_vma) || defined(tlb_end_vma)
353-
#error MMU_GATHER_NO_RANGE relies on default tlb_flush(), tlb_start_vma() and tlb_end_vma()
352+
#if defined(tlb_flush)
353+
#error MMU_GATHER_NO_RANGE relies on default tlb_flush()
354354
#endif
355355

356356
/*
@@ -370,17 +370,10 @@ static inline void tlb_flush(struct mmu_gather *tlb)
370370
static inline void
371371
tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma) { }
372372

373-
#define tlb_end_vma tlb_end_vma
374-
static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) { }
375-
376373
#else /* CONFIG_MMU_GATHER_NO_RANGE */
377374

378375
#ifndef tlb_flush
379376

380-
#if defined(tlb_start_vma) || defined(tlb_end_vma)
381-
#error Default tlb_flush() relies on default tlb_start_vma() and tlb_end_vma()
382-
#endif
383-
384377
/*
385378
* When an architecture does not provide its own tlb_flush() implementation
386379
* but does have a reasonably efficient flush_vma_range() implementation
@@ -501,7 +494,6 @@ static inline unsigned long tlb_get_unmap_size(struct mmu_gather *tlb)
501494
* case where we're doing a full MM flush. When we're doing a munmap,
502495
* the vmas are adjusted to only cover the region to be torn down.
503496
*/
504-
#ifndef tlb_start_vma
505497
static inline void tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
506498
{
507499
if (tlb->fullmm)
@@ -512,9 +504,7 @@ static inline void tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *
512504
flush_cache_range(vma, vma->vm_start, vma->vm_end);
513505
#endif
514506
}
515-
#endif
516507

517-
#ifndef tlb_end_vma
518508
static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
519509
{
520510
if (tlb->fullmm || IS_ENABLED(CONFIG_MMU_GATHER_MERGE_VMAS))
@@ -528,7 +518,6 @@ static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vm
528518
*/
529519
tlb_flush_mmu_tlbonly(tlb);
530520
}
531-
#endif
532521

533522
/*
534523
* tlb_flush_{pte|pmd|pud|p4d}_range() adjust the tlb->start and tlb->end,

0 commit comments

Comments
 (0)