sparc64: Flush TLB before releasing pages.
authorDavid S. Miller <davem@davemloft.net>
Thu, 26 Mar 2009 08:28:53 +0000 (01:28 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Jun 2009 03:01:12 +0000 (20:01 -0700)
[ Upstream commit 86ee79c3dbd48d7430fd81edc1da3516c9f6dabc ]

tlb_flush_mmu() needs to flush pending TLB entries before
processing the mmu_gather ->pages list.

Noticed by Benjamin Herrenschmidt.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc/include/asm/tlb_64.h

index ec81cde..0aaa086 100644 (file)
@@ -58,6 +58,8 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i
 static inline void tlb_flush_mmu(struct mmu_gather *mp)
 {
        if (mp->need_flush) {
+               if (!mp->fullmm)
+                       flush_tlb_pending();
                free_pages_and_swap_cache(mp->pages, mp->pages_nr);
                mp->pages_nr = 0;
                mp->need_flush = 0;
@@ -78,8 +80,6 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un
 
        if (mp->fullmm)
                mp->fullmm = 0;
-       else
-               flush_tlb_pending();
 
        /* keep the page table cache within bounds */
        check_pgt_cache();