~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/include/asm/tlbflush.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  4  */
  5 
  6 #ifndef __UM_TLBFLUSH_H
  7 #define __UM_TLBFLUSH_H
  8 
  9 #include <linux/mm.h>
 10 
 11 /*
 12  * In UML, we need to sync the TLB over by using mmap/munmap/mprotect syscalls
 13  * from the process handling the MM (which can be the kernel itself).
 14  *
 15  * To track updates, we can hook into set_ptes and flush_tlb_*. With set_ptes
 16  * we catch all PTE transitions where memory that was unusable becomes usable.
 17  * While with flush_tlb_* we can track any memory that becomes unusable and
 18  * even if a higher layer of the page table was modified.
 19  *
 20  * So, we simply track updates using both methods and mark the memory area to
 21  * be synced later on. The only special case is that flush_tlb_kern_* needs to
 22  * be executed immediately as there is no good synchronization point in that
 23  * case. In contrast, in the set_ptes case we can wait for the next kernel
 24  * segfault before we do the synchornization.
 25  *
 26  *  - flush_tlb_all() flushes all processes TLBs
 27  *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
 28  *  - flush_tlb_page(vma, vmaddr) flushes one page
 29  *  - flush_tlb_range(vma, start, end) flushes a range of pages
 30  *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
 31  */
 32 
 33 extern int um_tlb_sync(struct mm_struct *mm);
 34 
 35 extern void flush_tlb_all(void);
 36 extern void flush_tlb_mm(struct mm_struct *mm);
 37 
 38 static inline void flush_tlb_page(struct vm_area_struct *vma,
 39                                   unsigned long address)
 40 {
 41         um_tlb_mark_sync(vma->vm_mm, address, address + PAGE_SIZE);
 42 }
 43 
 44 static inline void flush_tlb_range(struct vm_area_struct *vma,
 45                                    unsigned long start, unsigned long end)
 46 {
 47         um_tlb_mark_sync(vma->vm_mm, start, end);
 48 }
 49 
 50 static inline void flush_tlb_kernel_range(unsigned long start,
 51                                           unsigned long end)
 52 {
 53         um_tlb_mark_sync(&init_mm, start, end);
 54 
 55         /* Kernel needs to be synced immediately */
 56         um_tlb_sync(&init_mm);
 57 }
 58 
 59 #endif
 60 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php