Lines Matching refs:tlb
219 extern void tlb_remove_table(struct mmu_gather *tlb, void *table);
223 static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page);
228 static inline void tlb_remove_table(struct mmu_gather *tlb, void *table) in tlb_remove_table() argument
233 tlb_remove_page(tlb, ptdesc_page(ptdesc)); in tlb_remove_table()
284 extern bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page,
286 bool __tlb_remove_folio_pages(struct mmu_gather *tlb, struct page *page,
294 #define tlb_delay_rmap(tlb) (((tlb)->delayed_rmap = 1), true) argument
295 extern void tlb_flush_rmaps(struct mmu_gather *tlb, struct vm_area_struct *vma);
308 #define tlb_delay_rmap(tlb) (false) argument
309 static inline void tlb_flush_rmaps(struct mmu_gather *tlb, struct vm_area_struct *vma) { } in tlb_flush_rmaps() argument
375 void tlb_flush_mmu(struct mmu_gather *tlb);
377 static inline void __tlb_adjust_range(struct mmu_gather *tlb, in __tlb_adjust_range() argument
381 tlb->start = min(tlb->start, address); in __tlb_adjust_range()
382 tlb->end = max(tlb->end, address + range_size); in __tlb_adjust_range()
385 static inline void __tlb_reset_range(struct mmu_gather *tlb) in __tlb_reset_range() argument
387 if (tlb->fullmm) { in __tlb_reset_range()
388 tlb->start = tlb->end = ~0; in __tlb_reset_range()
390 tlb->start = TASK_SIZE; in __tlb_reset_range()
391 tlb->end = 0; in __tlb_reset_range()
393 tlb->freed_tables = 0; in __tlb_reset_range()
394 tlb->cleared_ptes = 0; in __tlb_reset_range()
395 tlb->cleared_pmds = 0; in __tlb_reset_range()
396 tlb->cleared_puds = 0; in __tlb_reset_range()
397 tlb->cleared_p4ds = 0; in __tlb_reset_range()
419 static inline void tlb_flush(struct mmu_gather *tlb) in tlb_flush() argument
421 if (tlb->end) in tlb_flush()
422 flush_tlb_mm(tlb->mm); in tlb_flush()
433 static inline void tlb_flush(struct mmu_gather *tlb) in tlb_flush() argument
435 if (tlb->fullmm || tlb->need_flush_all) { in tlb_flush()
436 flush_tlb_mm(tlb->mm); in tlb_flush()
437 } else if (tlb->end) { in tlb_flush()
439 .vm_mm = tlb->mm, in tlb_flush()
440 .vm_flags = (tlb->vma_exec ? VM_EXEC : 0) | in tlb_flush()
441 (tlb->vma_huge ? VM_HUGETLB : 0), in tlb_flush()
444 flush_tlb_range(&vma, tlb->start, tlb->end); in tlb_flush()
452 tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma) in tlb_update_vma_flags() argument
465 tlb->vma_huge = is_vm_hugetlb_page(vma); in tlb_update_vma_flags()
466 tlb->vma_exec = !!(vma->vm_flags & VM_EXEC); in tlb_update_vma_flags()
467 tlb->vma_pfn = !!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)); in tlb_update_vma_flags()
470 static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) in tlb_flush_mmu_tlbonly() argument
476 if (!(tlb->freed_tables || tlb->cleared_ptes || tlb->cleared_pmds || in tlb_flush_mmu_tlbonly()
477 tlb->cleared_puds || tlb->cleared_p4ds)) in tlb_flush_mmu_tlbonly()
480 tlb_flush(tlb); in tlb_flush_mmu_tlbonly()
481 __tlb_reset_range(tlb); in tlb_flush_mmu_tlbonly()
484 static inline void tlb_remove_page_size(struct mmu_gather *tlb, in tlb_remove_page_size() argument
487 if (__tlb_remove_page_size(tlb, page, false, page_size)) in tlb_remove_page_size()
488 tlb_flush_mmu(tlb); in tlb_remove_page_size()
491 static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) in tlb_remove_page() argument
493 return tlb_remove_page_size(tlb, page, PAGE_SIZE); in tlb_remove_page()
496 static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt) in tlb_remove_ptdesc() argument
498 tlb_remove_table(tlb, pt); in tlb_remove_ptdesc()
501 static inline void tlb_change_page_size(struct mmu_gather *tlb, in tlb_change_page_size() argument
505 if (tlb->page_size && tlb->page_size != page_size) { in tlb_change_page_size()
506 if (!tlb->fullmm && !tlb->need_flush_all) in tlb_change_page_size()
507 tlb_flush_mmu(tlb); in tlb_change_page_size()
510 tlb->page_size = page_size; in tlb_change_page_size()
514 static inline unsigned long tlb_get_unmap_shift(struct mmu_gather *tlb) in tlb_get_unmap_shift() argument
516 if (tlb->cleared_ptes) in tlb_get_unmap_shift()
518 if (tlb->cleared_pmds) in tlb_get_unmap_shift()
520 if (tlb->cleared_puds) in tlb_get_unmap_shift()
522 if (tlb->cleared_p4ds) in tlb_get_unmap_shift()
528 static inline unsigned long tlb_get_unmap_size(struct mmu_gather *tlb) in tlb_get_unmap_size() argument
530 return 1UL << tlb_get_unmap_shift(tlb); in tlb_get_unmap_size()
538 static inline void tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) in tlb_start_vma() argument
540 if (tlb->fullmm) in tlb_start_vma()
543 tlb_update_vma_flags(tlb, vma); in tlb_start_vma()
549 static inline void tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) in tlb_end_vma() argument
551 if (tlb->fullmm) in tlb_end_vma()
560 if (tlb->vma_pfn || !IS_ENABLED(CONFIG_MMU_GATHER_MERGE_VMAS)) { in tlb_end_vma()
565 tlb_flush_mmu_tlbonly(tlb); in tlb_end_vma()
573 static inline void tlb_flush_pte_range(struct mmu_gather *tlb, in tlb_flush_pte_range() argument
576 __tlb_adjust_range(tlb, address, size); in tlb_flush_pte_range()
577 tlb->cleared_ptes = 1; in tlb_flush_pte_range()
580 static inline void tlb_flush_pmd_range(struct mmu_gather *tlb, in tlb_flush_pmd_range() argument
583 __tlb_adjust_range(tlb, address, size); in tlb_flush_pmd_range()
584 tlb->cleared_pmds = 1; in tlb_flush_pmd_range()
587 static inline void tlb_flush_pud_range(struct mmu_gather *tlb, in tlb_flush_pud_range() argument
590 __tlb_adjust_range(tlb, address, size); in tlb_flush_pud_range()
591 tlb->cleared_puds = 1; in tlb_flush_pud_range()
594 static inline void tlb_flush_p4d_range(struct mmu_gather *tlb, in tlb_flush_p4d_range() argument
597 __tlb_adjust_range(tlb, address, size); in tlb_flush_p4d_range()
598 tlb->cleared_p4ds = 1; in tlb_flush_p4d_range()
602 static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addres… in __tlb_remove_tlb_entry() argument
614 #define tlb_remove_tlb_entry(tlb, ptep, address) \ argument
616 tlb_flush_pte_range(tlb, address, PAGE_SIZE); \
617 __tlb_remove_tlb_entry(tlb, ptep, address); \
627 static inline void tlb_remove_tlb_entries(struct mmu_gather *tlb, in tlb_remove_tlb_entries() argument
630 tlb_flush_pte_range(tlb, address, PAGE_SIZE * nr); in tlb_remove_tlb_entries()
632 __tlb_remove_tlb_entry(tlb, ptep, address); in tlb_remove_tlb_entries()
640 #define tlb_remove_huge_tlb_entry(h, tlb, ptep, address) \ argument
644 tlb_flush_p4d_range(tlb, address, _sz); \
646 tlb_flush_pud_range(tlb, address, _sz); \
648 tlb_flush_pmd_range(tlb, address, _sz); \
650 tlb_flush_pte_range(tlb, address, _sz); \
651 __tlb_remove_tlb_entry(tlb, ptep, address); \
659 #define __tlb_remove_pmd_tlb_entry(tlb, pmdp, address) do {} while (0) argument
662 #define tlb_remove_pmd_tlb_entry(tlb, pmdp, address) \ argument
664 tlb_flush_pmd_range(tlb, address, HPAGE_PMD_SIZE); \
665 __tlb_remove_pmd_tlb_entry(tlb, pmdp, address); \
673 #define __tlb_remove_pud_tlb_entry(tlb, pudp, address) do {} while (0) argument
676 #define tlb_remove_pud_tlb_entry(tlb, pudp, address) \ argument
678 tlb_flush_pud_range(tlb, address, HPAGE_PUD_SIZE); \
679 __tlb_remove_pud_tlb_entry(tlb, pudp, address); \
701 #define pte_free_tlb(tlb, ptep, address) \ argument
703 tlb_flush_pmd_range(tlb, address, PAGE_SIZE); \
704 tlb->freed_tables = 1; \
705 __pte_free_tlb(tlb, ptep, address); \
710 #define pmd_free_tlb(tlb, pmdp, address) \ argument
712 tlb_flush_pud_range(tlb, address, PAGE_SIZE); \
713 tlb->freed_tables = 1; \
714 __pmd_free_tlb(tlb, pmdp, address); \
719 #define pud_free_tlb(tlb, pudp, address) \ argument
721 tlb_flush_p4d_range(tlb, address, PAGE_SIZE); \
722 tlb->freed_tables = 1; \
723 __pud_free_tlb(tlb, pudp, address); \
728 #define p4d_free_tlb(tlb, pudp, address) \ argument
730 __tlb_adjust_range(tlb, address, PAGE_SIZE); \
731 tlb->freed_tables = 1; \
732 __p4d_free_tlb(tlb, pudp, address); \