aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-11-19 00:53:24 -0500
committerPaul Mackerras <paulus@samba.org>2008-12-03 04:46:35 -0500
commitdf3b8611554e389e703fa753540289874fa5126c (patch)
tree19b02efa50c28fbece905bd9fe2dc6c6ae6fcfd5 /arch/powerpc/include
parentf4f3a1261ad70988ad45614ebc87e553143a332b (diff)
powerpc: Add a local_flush_tlb_page to handle kmap_atomic invalidates
The tlb invalidates in kmap_atomic/kunmap_atomic can be called from IRQ context, however they are only local invalidates (on the processor that the kmap was called on). In the future we want to use IPIs to do tlb invalidates this causes issue since flush_tlb_page() is considered a broadcast invalidate. Add local_flush_tlb_page() as a non-broadcast invalidate and use it in kmap_atomic() since we don't have enough information in the flush_tlb_page() call to determine its local. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/highmem.h4
-rw-r--r--arch/powerpc/include/asm/tlbflush.h14
2 files changed, 16 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index 91c589520c0a..7dc52eca8b67 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -85,7 +85,7 @@ static inline void *kmap_atomic_prot(struct page *page, enum km_type type, pgpro
85 BUG_ON(!pte_none(*(kmap_pte-idx))); 85 BUG_ON(!pte_none(*(kmap_pte-idx)));
86#endif 86#endif
87 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot)); 87 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
88 flush_tlb_page(NULL, vaddr); 88 local_flush_tlb_page(vaddr);
89 89
90 return (void*) vaddr; 90 return (void*) vaddr;
91} 91}
@@ -113,7 +113,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
113 * this pte without first remap it 113 * this pte without first remap it
114 */ 114 */
115 pte_clear(&init_mm, vaddr, kmap_pte-idx); 115 pte_clear(&init_mm, vaddr, kmap_pte-idx);
116 flush_tlb_page(NULL, vaddr); 116 local_flush_tlb_page(vaddr);
117#endif 117#endif
118 pagefault_enable(); 118 pagefault_enable();
119} 119}
diff --git a/arch/powerpc/include/asm/tlbflush.h b/arch/powerpc/include/asm/tlbflush.h
index a2c6bfd85fb7..93716a9f4e16 100644
--- a/arch/powerpc/include/asm/tlbflush.h
+++ b/arch/powerpc/include/asm/tlbflush.h
@@ -6,6 +6,7 @@
6 * 6 *
7 * - flush_tlb_mm(mm) flushes the specified mm context TLB's 7 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
8 * - flush_tlb_page(vma, vmaddr) flushes one page 8 * - flush_tlb_page(vma, vmaddr) flushes one page
9 * - local_flush_tlb_page(vmaddr) flushes one page on the local processor
9 * - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB 10 * - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
10 * - flush_tlb_range(vma, start, end) flushes a range of pages 11 * - flush_tlb_range(vma, start, end) flushes a range of pages
11 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages 12 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
@@ -44,6 +45,11 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
44 _tlbil_pid(mm->context.id); 45 _tlbil_pid(mm->context.id);
45} 46}
46 47
48static inline void local_flush_tlb_page(unsigned long vmaddr)
49{
50 _tlbil_va(vmaddr, 0);
51}
52
47static inline void flush_tlb_page(struct vm_area_struct *vma, 53static inline void flush_tlb_page(struct vm_area_struct *vma,
48 unsigned long vmaddr) 54 unsigned long vmaddr)
49{ 55{
@@ -81,6 +87,10 @@ extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr
81extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 87extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
82 unsigned long end); 88 unsigned long end);
83extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); 89extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
90static inline void local_flush_tlb_page(unsigned long vmaddr)
91{
92 flush_tlb_page(NULL, vmaddr);
93}
84 94
85#else 95#else
86/* 96/*
@@ -138,6 +148,10 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
138{ 148{
139} 149}
140 150
151static inline void local_flush_tlb_page(unsigned long vmaddr)
152{
153}
154
141static inline void flush_tlb_page(struct vm_area_struct *vma, 155static inline void flush_tlb_page(struct vm_area_struct *vma,
142 unsigned long vmaddr) 156 unsigned long vmaddr)
143{ 157{