.. | .. |
---|
5 | 5 | #include <linux/mm.h> |
---|
6 | 6 | #include <linux/sched.h> |
---|
7 | 7 | #include <linux/atomic.h> |
---|
8 | | -#include <asm/pgalloc.h> |
---|
9 | | -#include <asm/pgtable.h> |
---|
| 8 | +#include <linux/spinlock.h> |
---|
10 | 9 | #include <asm-generic/mm_hooks.h> |
---|
11 | 10 | |
---|
12 | 11 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
---|
.. | .. |
---|
54 | 53 | struct mm_struct *next, struct task_struct *tsk) |
---|
55 | 54 | { |
---|
56 | 55 | if (prev != next) { |
---|
| 56 | +#ifdef CONFIG_TLB_PTLOCK |
---|
| 57 | + /* put physical address of page_table_lock in cr28 (tr4) |
---|
| 58 | + for TLB faults */ |
---|
| 59 | + spinlock_t *pgd_lock = &next->page_table_lock; |
---|
| 60 | + mtctl(__pa(__ldcw_align(&pgd_lock->rlock.raw_lock)), 28); |
---|
| 61 | +#endif |
---|
57 | 62 | mtctl(__pa(next->pgd), 25); |
---|
58 | 63 | load_context(next->context); |
---|
59 | 64 | } |
---|