summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/mm.h
diff options
context:
space:
mode:
authorRussell King2011-07-02 16:20:44 +0200
committerRussell King2012-01-26 21:06:28 +0100
commit67ece1443174d852e71c42facb3e2d7dd338c88a (patch)
tree418359d432acfcb2ecc4c58c8afa5f73de4fa01e /arch/arm/mm/mm.h
parentARM: pgtable: use mk_pte rather than pfn_pte(page_to_pfn()) (diff)
downloadkernel-qcow2-linux-67ece1443174d852e71c42facb3e2d7dd338c88a.tar.gz
kernel-qcow2-linux-67ece1443174d852e71c42facb3e2d7dd338c88a.tar.xz
kernel-qcow2-linux-67ece1443174d852e71c42facb3e2d7dd338c88a.zip
ARM: pgtable: consolidate set_pte_ext(TOP_PTE,...) + tlb flush
A number of places establish a PTE in our top page table and immediately flush the TLB. Rather than having this at every callsite, provide an inline function for this purpose. This changes some global tlb flushes to be local; each time we setup one of these mappings, we always do it with preemption disabled which would prevent us migrating to another CPU. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mm.h')
-rw-r--r--arch/arm/mm/mm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 6ee1ff2c1da6..a4e7febeb6a1 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -18,6 +18,12 @@ extern pmd_t *top_pmd;
/* PFN alias flushing, for VIPT caches */
#define FLUSH_ALIAS_START 0xffff4000
+static inline void set_top_pte(unsigned long va, pte_t pte)
+{
+ set_pte_ext(TOP_PTE(va), pte, 0);
+ local_flush_tlb_kernel_page(va);
+}
+
static inline pmd_t *pmd_off_k(unsigned long virt)
{
return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);