diff options
Diffstat (limited to 'include/asm-parisc/tlbflush.h')
| -rw-r--r-- | include/asm-parisc/tlbflush.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index eb27b78930e8..c9ec39c6fc6c 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
| @@ -7,6 +7,20 @@ | |||
| 7 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
| 8 | #include <asm/mmu_context.h> | 8 | #include <asm/mmu_context.h> |
| 9 | 9 | ||
| 10 | |||
| 11 | /* This is for the serialisation of PxTLB broadcasts. At least on the | ||
| 12 | * N class systems, only one PxTLB inter processor broadcast can be | ||
| 13 | * active at any one time on the Merced bus. This tlb purge | ||
| 14 | * synchronisation is fairly lightweight and harmless so we activate | ||
| 15 | * it on all SMP systems not just the N class. We also need to have | ||
| 16 | * preemption disabled on uniprocessor machines, and spin_lock does that | ||
| 17 | * nicely. | ||
| 18 | */ | ||
| 19 | extern spinlock_t pa_tlb_lock; | ||
| 20 | |||
| 21 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | ||
| 22 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | ||
| 23 | |||
| 10 | extern void flush_tlb_all(void); | 24 | extern void flush_tlb_all(void); |
| 11 | 25 | ||
| 12 | /* | 26 | /* |
| @@ -64,29 +78,25 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
| 64 | { | 78 | { |
| 65 | unsigned long npages; | 79 | unsigned long npages; |
| 66 | 80 | ||
| 67 | |||
| 68 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; | 81 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; |
| 69 | if (npages >= 512) /* XXX arbitrary, should be tuned */ | 82 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ |
| 70 | flush_tlb_all(); | 83 | flush_tlb_all(); |
| 71 | else { | 84 | else { |
| 72 | |||
| 73 | mtsp(vma->vm_mm->context,1); | 85 | mtsp(vma->vm_mm->context,1); |
| 86 | purge_tlb_start(); | ||
| 74 | if (split_tlb) { | 87 | if (split_tlb) { |
| 75 | purge_tlb_start(); | ||
| 76 | while (npages--) { | 88 | while (npages--) { |
| 77 | pdtlb(start); | 89 | pdtlb(start); |
| 78 | pitlb(start); | 90 | pitlb(start); |
| 79 | start += PAGE_SIZE; | 91 | start += PAGE_SIZE; |
| 80 | } | 92 | } |
| 81 | purge_tlb_end(); | ||
| 82 | } else { | 93 | } else { |
| 83 | purge_tlb_start(); | ||
| 84 | while (npages--) { | 94 | while (npages--) { |
| 85 | pdtlb(start); | 95 | pdtlb(start); |
| 86 | start += PAGE_SIZE; | 96 | start += PAGE_SIZE; |
| 87 | } | 97 | } |
| 88 | purge_tlb_end(); | ||
| 89 | } | 98 | } |
| 99 | purge_tlb_end(); | ||
| 90 | } | 100 | } |
| 91 | } | 101 | } |
| 92 | 102 | ||
