linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@au1.ibm.com>
To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Cc: "David S. Miller" <davem@redhat.com>,
	linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: [PATCH] ppc32: Wrong vaddr in flush_hash_one_pte()
Date: Wed, 23 Feb 2005 19:02:09 +1100	[thread overview]
Message-ID: <1109145729.5412.213.camel@gaston> (raw)

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);
 }
 

                 reply	other threads:[~2005-02-23  8:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1109145729.5412.213.camel@gaston \
    --to=benh@au1.ibm.com \
    --cc=akpm@osdl.org \
    --cc=davem@redhat.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).