Skip to content

Commit

Permalink
[SPARC64]: Align address in huge_pte_alloc().
Browse files Browse the repository at this point in the history
We are about to fill in all HPAGE_SIZE's worth
of PAGE_SIZE ptes, so we have to give the first
pte in that set else we scribble over random memory
when we fill in the ptes.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller authored and David S. Miller committed Apr 1, 2006
1 parent 73c50a2 commit 9df1dab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/sparc64/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
pmd_t *pmd;
pte_t *pte = NULL;

/* We must align the address, because our caller will run
* set_huge_pte_at() on whatever we return, which writes out
* all of the sub-ptes for the hugepage range. So we have
* to give it the first such sub-pte.
*/
addr &= HPAGE_MASK;

pgd = pgd_offset(mm, addr);
pud = pud_alloc(mm, pgd, addr);
if (pud) {
Expand Down

0 comments on commit 9df1dab

Please sign in to comment.