From: David Gibson <david@gibson.dropbear.id.au>
To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Cc: Adam Litke <agl@us.ibm.com>, Paul Mackerras <paulus@samba.org>,
Anton Blanchard <anton@samba.org>,
linuxppc64-dev@lists.linuxppc.org, linux-kernel@vger.kernel.org
Subject: [PPC64] Hugepage hash flushing bugfix
Date: Fri, 25 Feb 2005 15:14:46 +1100 [thread overview]
Message-ID: <20050225041446.GC10725@localhost.localdomain> (raw)
Andrew, Linus, please apply:
Fix a potentially bad (although very rarely triggered) bug in the
ppc64 hugepage code. hpte_update() did not correctly calculate the
address for hugepages, so pte_clear() (which we use for hugepage ptes
as well as normal ones) would not correctly flush the hash page table
entry. Under the right circumstances this could potentially lead to
duplicate hash entries, which is very bad.
davem's upcoming patch to pass the virtual address directly to
set_pte() and its ilk will obsolete this, but this is bad enough it
should probably be fixed in the meantime.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Index: working-2.6/arch/ppc64/mm/tlb.c
===================================================================
--- working-2.6.orig/arch/ppc64/mm/tlb.c 2004-09-09 09:59:49.000000000 +1000
+++ working-2.6/arch/ppc64/mm/tlb.c 2005-02-25 14:56:47.000000000 +1100
@@ -85,8 +85,12 @@
ptepage = virt_to_page(ptep);
mm = (struct mm_struct *) ptepage->mapping;
- addr = ptepage->index +
- (((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE);
+ addr = ptepage->index;
+ if (pte_huge(pte))
+ addr += ((unsigned long)ptep & ~PAGE_MASK)
+ / sizeof(*ptep) * HPAGE_SIZE;
+ else
+ addr += ((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE;
if (REGION_ID(addr) == USER_REGION_ID)
context = mm->context.id;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_
| _around_!
http://www.ozlabs.org/people/dgibson
next reply other threads:[~2005-02-25 4:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-25 4:14 David Gibson [this message]
2005-02-25 4:28 ` [PPC64] Hugepage hash flushing bugfix William Lee Irwin III
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=20050225041446.GC10725@localhost.localdomain \
--to=david@gibson.dropbear.id.au \
--cc=agl@us.ibm.com \
--cc=akpm@osdl.org \
--cc=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@lists.linuxppc.org \
--cc=paulus@samba.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 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.