diff options
author | John David Anglin <dave.anglin@bell.net> | 2013-01-15 01:45:00 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-01-19 11:54:45 +0100 |
commit | 7139bc1579901b53db7e898789e916ee2fb52d78 (patch) | |
tree | c5030cb7afe83a347de96757c2a3b5490a9782e8 /arch/parisc/include/asm/pgtable.h | |
parent | Merge tag 'usb-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/greg... (diff) | |
download | linux-7139bc1579901b53db7e898789e916ee2fb52d78.tar.xz linux-7139bc1579901b53db7e898789e916ee2fb52d78.zip |
[PARISC] Purge existing TLB entries in set_pte_at and ptep_set_wrprotect
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>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'arch/parisc/include/asm/pgtable.h')
-rw-r--r-- | arch/parisc/include/asm/pgtable.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index ee99f2339356..7df49fad29f9 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h @@ -12,11 +12,10 @@ #include <linux/bitops.h> #include <linux/spinlock.h> +#include <linux/mm_types.h> #include <asm/processor.h> #include <asm/cache.h> -struct vm_area_struct; - /* * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel * memory. For the return value to be meaningful, ADDR must be >= @@ -40,7 +39,14 @@ struct vm_area_struct; do{ \ *(pteptr) = (pteval); \ } while(0) -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) + +extern void purge_tlb_entries(struct mm_struct *, unsigned long); + +#define set_pte_at(mm, addr, ptep, pteval) \ + do { \ + set_pte(ptep, pteval); \ + purge_tlb_entries(mm, addr); \ + } while (0) #endif /* !__ASSEMBLY__ */ @@ -466,6 +472,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, old = pte_val(*ptep); new = pte_val(pte_wrprotect(__pte (old))); } while (cmpxchg((unsigned long *) ptep, old, new) != old); + purge_tlb_entries(mm, addr); #else pte_t old_pte = *ptep; set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); |