]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ppc32: Wrong vaddr in flush_hash_one_pte()
authorBenjamin Herrenschmidt <benh@au1.ibm.com>
Tue, 22 Feb 2005 23:36:23 +0000 (15:36 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 22 Feb 2005 23:36:23 +0000 (15:36 -0800)
Reworking the ppc32 mm helps me find interesting bugs in the existing bug,
well, brown paper bag for me, I made this one a while ago.

The routine flush_hash_one_pte() used by ptep_test_and_clear_young()
wasn't properly recaclulating the vaddr from the pte pointer &
page->index.  The result is that we probably never flushed things from
the hash, so that's at least the _second_ bug affecting
ptep_test_and_clear_young(), swap on ppc32 must have been really broken
:(

This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc/mm/tlb.c

index 34605ba4ac2fa1cc3a5d0f296641d498b349ea4f..bedc1048e9a606e2e4c4fc2d8a6185f7f7098ceb 100644 (file)
@@ -62,7 +62,7 @@ void flush_hash_one_pte(pte_t *ptep)
        ptepage = virt_to_page(ptep);
        mm = (struct mm_struct *) ptepage->mapping;
        ptephys = __pa(ptep) & PAGE_MASK;
-       addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 9);
+       addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 10);
        flush_hash_pages(mm->context, addr, ptephys, 1);
 }