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

TOMOYO Linux Cross Reference
Linux/arch/hexagon/mm/vm_tlb.c

Version: ~ [ linux-5.14-rc3 ] ~ [ linux-5.13.5 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.53 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.135 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.198 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.240 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.276 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.276 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Hexagon Virtual Machine TLB functions
  3  *
  4  * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  5  *
  6  * This program is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU General Public License version 2 and
  8  * only version 2 as published by the Free Software Foundation.
  9  *
 10  * This program is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU General Public License
 16  * along with this program; if not, write to the Free Software
 17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 18  * 02110-1301, USA.
 19  */
 20 
 21 /*
 22  * The Hexagon Virtual Machine conceals the real workings of
 23  * the TLB, but there are one or two functions that need to
 24  * be instantiated for it, differently from a native build.
 25  */
 26 #include <linux/mm.h>
 27 #include <asm/page.h>
 28 #include <asm/hexagon_vm.h>
 29 
 30 /*
 31  * Initial VM implementation has only one map active at a time, with
 32  * TLB purgings on changes.  So either we're nuking the current map,
 33  * or it's a no-op.  This operation is messy on true SMPs where other
 34  * processors must be induced to flush the copies in their local TLBs,
 35  * but Hexagon thread-based virtual processors share the same MMU.
 36  */
 37 void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
 38                         unsigned long end)
 39 {
 40         struct mm_struct *mm = vma->vm_mm;
 41 
 42         if (mm->context.ptbase == current->active_mm->context.ptbase)
 43                 __vmclrmap((void *)start, end - start);
 44 }
 45 
 46 /*
 47  * Flush a page from the kernel virtual map - used by highmem
 48  */
 49 void flush_tlb_one(unsigned long vaddr)
 50 {
 51         __vmclrmap((void *)vaddr, PAGE_SIZE);
 52 }
 53 
 54 /*
 55  * Flush all TLBs across all CPUs, virtual or real.
 56  * A single Hexagon core has 6 thread contexts but
 57  * only one TLB.
 58  */
 59 void tlb_flush_all(void)
 60 {
 61         /*  should probably use that fixaddr end or whateve label  */
 62         __vmclrmap(0, 0xffff0000);
 63 }
 64 
 65 /*
 66  * Flush TLB entries associated with a given mm_struct mapping.
 67  */
 68 void flush_tlb_mm(struct mm_struct *mm)
 69 {
 70         /* Current Virtual Machine has only one map active at a time */
 71         if (current->active_mm->context.ptbase == mm->context.ptbase)
 72                 tlb_flush_all();
 73 }
 74 
 75 /*
 76  * Flush TLB state associated with a page of a vma.
 77  */
 78 void flush_tlb_page(struct vm_area_struct *vma, unsigned long vaddr)
 79 {
 80         struct mm_struct *mm = vma->vm_mm;
 81 
 82         if (mm->context.ptbase  == current->active_mm->context.ptbase)
 83                 __vmclrmap((void *)vaddr, PAGE_SIZE);
 84 }
 85 
 86 /*
 87  * Flush TLB entries associated with a kernel address range.
 88  * Like flush range, but without the check on the vma->vm_mm.
 89  */
 90 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
 91 {
 92                 __vmclrmap((void *)start, end - start);
 93 }
 94 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp