All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ppc32: Wrong vaddr in flush_hash_one_pte()
@ 2005-02-23  8:02 Benjamin Herrenschmidt
  2005-02-24  0:11 ` [PATCH] set_pte() part 1 (was Re: [PATCH] ppc32: Wrong vaddr in flush_hash_one_pte()) David S. Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2005-02-23  8:02 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: David S. Miller, linuxppc-dev list

Hi !

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. This fixes
it. 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 :(

Please, apply to 2.6.11...

(I hope by early 2.6.12, we'll have David's patch that removes the need for
those hacks though, and just pass us the vaddr (and mm or vma) to all the
PTE accessors...)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/arch/ppc/mm/tlb.c
===================================================================
--- linux-work.orig/arch/ppc/mm/tlb.c	2005-01-24 17:09:23.000000000 +1100
+++ linux-work/arch/ppc/mm/tlb.c	2005-02-23 18:53:49.000000000 +1100
@@ -62,7 +62,7 @@
 	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);
 }
 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: [PATCH] set_pte() part 1 (was Re: [PATCH] ppc32: Wrong vaddr in flush_hash_one_pte())
@ 2005-02-24  0:55 Luck, Tony
  2005-02-24  4:02 ` David S. Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Luck, Tony @ 2005-02-24  0:55 UTC (permalink / raw)
  To: David S. Miller, Benjamin Herrenschmidt; +Cc: linux-arch

>I've been over this a few times this afternoon and the patch looks
>correct.  Please test the build and boot of your platform, any build
>failures should be trivial typos and nothing major.

Builds (no new warnings) and boots on ia64.

-Tony

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-03-02  8:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-23  8:02 [PATCH] ppc32: Wrong vaddr in flush_hash_one_pte() Benjamin Herrenschmidt
2005-02-24  0:11 ` [PATCH] set_pte() part 1 (was Re: [PATCH] ppc32: Wrong vaddr in flush_hash_one_pte()) David S. Miller
2005-02-25  9:32   ` Martin Schwidefsky
2005-02-25 23:43     ` David S. Miller
2005-02-28  9:27       ` Martin Schwidefsky
2005-03-01 23:30         ` David S. Miller
2005-03-02  8:23           ` Martin Schwidefsky
2005-02-25 13:29   ` Paul Mundt
2005-02-25 23:43     ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2005-02-24  0:55 Luck, Tony
2005-02-24  4:02 ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.