aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/pgtable_32.h
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2012-03-28 13:59:18 -0400
committerChris Metcalf <cmetcalf@tilera.com>2012-05-25 12:48:21 -0400
commit73636b1aacb1a07e6fbe0d25e560e69b024a8e25 (patch)
tree9531c202c6b3f67fba1cd7ac2b83fa32c31fe197 /arch/tile/include/asm/pgtable_32.h
parent51007004f44c9588d70ffb77e1f52479bd5b0e37 (diff)
arch/tile: allow building Linux with transparent huge pages enabled
The change adds some infrastructure for managing tile pmd's more generally, using pte_pmd() and pmd_pte() methods to translate pmd values to and from ptes, since on TILEPro a pmd is really just a nested structure holding a pgd (aka pte). Several existing pmd methods are moved into this framework, and a whole raft of additional pmd accessors are defined that are used by the transparent hugepage framework. The tile PTE now has a "client2" bit. The bit is used to indicate a transparent huge page is in the process of being split into subpages. This change also fixes a generic bug where the return value of the generic pmdp_splitting_flush() was incorrect. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/include/asm/pgtable_32.h')
-rw-r--r--arch/tile/include/asm/pgtable_32.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/arch/tile/include/asm/pgtable_32.h b/arch/tile/include/asm/pgtable_32.h
index 9f98529761fd..27e20f6844a8 100644
--- a/arch/tile/include/asm/pgtable_32.h
+++ b/arch/tile/include/asm/pgtable_32.h
@@ -111,24 +111,14 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
111 return pte; 111 return pte;
112} 112}
113 113
114static inline void __set_pmd(pmd_t *pmdp, pmd_t pmdval) 114/*
115{ 115 * pmds are wrappers around pgds, which are the same as ptes.
116 set_pte(&pmdp->pud.pgd, pmdval.pud.pgd); 116 * It's often convenient to "cast" back and forth and use the pte methods,
117} 117 * which are the methods supplied by the hypervisor.
118 118 */
119/* Create a pmd from a PTFN. */ 119#define pmd_pte(pmd) ((pmd).pud.pgd)
120static inline pmd_t ptfn_pmd(unsigned long ptfn, pgprot_t prot) 120#define pmdp_ptep(pmdp) (&(pmdp)->pud.pgd)
121{ 121#define pte_pmd(pte) ((pmd_t){ { (pte) } })
122 return (pmd_t){ { hv_pte_set_ptfn(prot, ptfn) } };
123}
124
125/* Return the page-table frame number (ptfn) that a pmd_t points at. */
126#define pmd_ptfn(pmd) hv_pte_get_ptfn((pmd).pud.pgd)
127
128static inline void pmd_clear(pmd_t *pmdp)
129{
130 __pte_clear(&pmdp->pud.pgd);
131}
132 122
133#endif /* __ASSEMBLY__ */ 123#endif /* __ASSEMBLY__ */
134 124