diff options
author | John David Anglin <dave.anglin@bell.net> | 2013-01-14 19:45:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-28 06:32:27 -0800 |
commit | ef96576ef50b8bbd4c63b9cebab372cb7cf4ba67 (patch) | |
tree | bf2a6d1637c5b3d84b4fcd71d0970f18ada28aac /arch/parisc/kernel/cache.c | |
parent | 534aaed9080ba82974e8d2a71e43a362918138f8 (diff) | |
download | kernel_samsung_smdk4412-ef96576ef50b8bbd4c63b9cebab372cb7cf4ba67.tar.gz kernel_samsung_smdk4412-ef96576ef50b8bbd4c63b9cebab372cb7cf4ba67.tar.bz2 kernel_samsung_smdk4412-ef96576ef50b8bbd4c63b9cebab372cb7cf4ba67.zip |
Purge existing TLB entries in set_pte_at and ptep_set_wrprotect
commit 7139bc1579901b53db7e898789e916ee2fb52d78 upstream.
This patch goes a long way toward fixing the minifail bug, and
it significantly improves the stability of SMP machines such as
the rp3440. When write protecting a page for COW, we need to
purge the existing translation. Otherwise, the COW break
doesn't occur as expected because the TLB may still have a stale entry
which allows writes.
[jejb: fix up checkpatch errors]
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/parisc/kernel/cache.c')
-rw-r--r-- | arch/parisc/kernel/cache.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 83335f3da5f..5241698ede6 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -421,6 +421,24 @@ void kunmap_parisc(void *addr) EXPORT_SYMBOL(kunmap_parisc); #endif +void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) +{ + unsigned long flags; + + /* Note: purge_tlb_entries can be called at startup with + no context. */ + + /* Disable preemption while we play with %sr1. */ + preempt_disable(); + mtsp(mm->context, 1); + purge_tlb_start(flags); + pdtlb(addr); + pitlb(addr); + purge_tlb_end(flags); + preempt_enable(); +} +EXPORT_SYMBOL(purge_tlb_entries); + void __flush_tlb_range(unsigned long sid, unsigned long start, unsigned long end) { |