aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/hugetlbpage.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-06-11 01:37:10 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 08:30:53 -0400
commit41743a4e34f0777f51c1cf0675b91508ba143050 (patch)
tree9e63c8c8d70169e6c8be699167234db33b102a1f /arch/powerpc/mm/hugetlbpage.c
parentff1f4ee94c3c4480b9cee95da2d19668262636c6 (diff)
powerpc: Free a PTE bit on ppc64 with 64K pages
This frees a PTE bit when using 64K pages on ppc64. This is done by getting rid of the separate _PAGE_HASHPTE bit. Instead, we just test if any of the 16 sub-page bits is set. For non-combo pages (ie. real 64K pages), we set SUB0 and the location encoding in that field. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/hugetlbpage.c')
-rw-r--r--arch/powerpc/mm/hugetlbpage.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index a02266dad215..8fa07f3f6c2b 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -458,8 +458,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
458 old_pte = pte_val(*ptep); 458 old_pte = pte_val(*ptep);
459 if (old_pte & _PAGE_BUSY) 459 if (old_pte & _PAGE_BUSY)
460 goto out; 460 goto out;
461 new_pte = old_pte | _PAGE_BUSY | 461 new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED;
462 _PAGE_ACCESSED | _PAGE_HASHPTE;
463 } while(old_pte != __cmpxchg_u64((unsigned long *)ptep, 462 } while(old_pte != __cmpxchg_u64((unsigned long *)ptep,
464 old_pte, new_pte)); 463 old_pte, new_pte));
465 464
@@ -499,8 +498,11 @@ repeat:
499 HPTES_PER_GROUP) & ~0x7UL; 498 HPTES_PER_GROUP) & ~0x7UL;
500 499
501 /* clear HPTE slot informations in new PTE */ 500 /* clear HPTE slot informations in new PTE */
501#ifdef CONFIG_PPC_64K_PAGES
502 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | _PAGE_HPTE_SUB0;
503#else
502 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | _PAGE_HASHPTE; 504 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | _PAGE_HASHPTE;
503 505#endif
504 /* Add in WIMG bits */ 506 /* Add in WIMG bits */
505 /* XXX We should store these in the pte */ 507 /* XXX We should store these in the pte */
506 /* --BenH: I think they are ... */ 508 /* --BenH: I think they are ... */