summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/tlb.h12
-rw-r--r--include/asm-sparc64/tlb.h19
2 files changed, 22 insertions, 9 deletions
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index f6a028acdebd..8a2f3ac45b70 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -22,7 +22,7 @@
*/
#ifdef CONFIG_SMP
#define FREE_PTE_NR 507
- #define tlb_fast_mode(tlb) ((tlb)->nr == ~0UL)
+ #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U)
#else
#define FREE_PTE_NR 1
#define tlb_fast_mode(tlb) 1
@@ -35,7 +35,8 @@
*/
typedef struct free_pte_ctx {
struct mm_struct *mm;
- unsigned long nr; /* set to ~0UL means fast mode */
+ unsigned int nr; /* set to ~0U means fast mode */
+ unsigned int fullmm; /* non-zero means full mm flush */
unsigned long freed;
struct page * pages[FREE_PTE_NR];
} mmu_gather_t;
@@ -46,15 +47,18 @@ extern mmu_gather_t mmu_gathers[NR_CPUS];
/* tlb_gather_mmu
* Return a pointer to an initialized mmu_gather_t.
*/
-static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm)
+static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
{
mmu_gather_t *tlb = &mmu_gathers[smp_processor_id()];
tlb->mm = mm;
- tlb->freed = 0;
/* Use fast mode if only one CPU is online */
tlb->nr = smp_num_cpus > 1 ? 0UL : ~0UL;
+
+ tlb->fullmm = full_mm_flush;
+ tlb->freed = 0;
+
return tlb;
}
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h
index ebc228702646..cffe5312e94a 100644
--- a/include/asm-sparc64/tlb.h
+++ b/include/asm-sparc64/tlb.h
@@ -1,14 +1,23 @@
#ifndef _SPARC64_TLB_H
#define _SPARC64_TLB_H
-#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
+#define tlb_flush(tlb) \
+do { if ((tlb)->fullmm) \
+ flush_tlb_mm((tlb)->mm);\
+} while (0)
#define tlb_start_vma(tlb, vma) \
- flush_cache_range(vma, vma->vm_start, vma->vm_end)
-#define tlb_end_vma(tlb, vma) \
- flush_tlb_range(vma, vma->vm_start, vma->vm_end)
+do { if (!(tlb)->fullmm) \
+ flush_cache_range(vma, vma->vm_start, vma->vm_end); \
+} while (0)
-#define tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
+#define tlb_end_vma(tlb, vma) \
+do { if (!(tlb)->fullmm) \
+ flush_tlb_range(vma, vma->vm_start, vma->vm_end); \
+} while (0)
+
+#define tlb_remove_tlb_entry(tlb, pte, address) \
+ do { } while (0)
#include <asm-generic/tlb.h>