]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SPARC64]: Add missing HPAGE_MASK masks on address parameters.
authorDavid S. Miller <davem@sunset.davemloft.net>
Tue, 13 Mar 2007 05:55:39 +0000 (22:55 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 13 Mar 2007 05:55:39 +0000 (22:55 -0700)
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>
arch/sparc64/mm/hugetlbpage.c

index 33fd0b265e707afdee93ec63322e9bff01220882..00677b5e1d7d0c15f0e82eec83e18ac07d900400 100644 (file)
@@ -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;