summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2007-03-16 18:49:06 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-03-23 12:49:26 -0700
commitb5c5ded3e7922dbbb45a2f7183d500514185eab8 (patch)
tree9f2e3ea7f16306e5f35c82a58e7386ecd6216a77
parent50a9fe380636f5643ccf605767208b02cbc82254 (diff)
downloadlinux-stable-b5c5ded3e7922dbbb45a2f7183d500514185eab8.tar.gz
linux-stable-b5c5ded3e7922dbbb45a2f7183d500514185eab8.tar.bz2
linux-stable-b5c5ded3e7922dbbb45a2f7183d500514185eab8.zip
Fix sparc64 hugepage bugs
[SPARC64]: Add missing HPAGE_MASK masks on address parameters. These pte loops all assume the passed in address is HPAGE aligned, make sure that is actually true. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/sparc64/mm/hugetlbpage.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index 33fd0b265e70..00677b5e1d7d 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -248,6 +248,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
if (!pte_present(*ptep) && pte_present(entry))
mm->context.huge_pte_count++;
+ addr &= HPAGE_MASK;
for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
set_pte_at(mm, addr, ptep, entry);
ptep++;
@@ -266,6 +267,8 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
if (pte_present(entry))
mm->context.huge_pte_count--;
+ addr &= HPAGE_MASK;
+
for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
pte_clear(mm, addr, ptep);
addr += PAGE_SIZE;