diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2014-11-05 11:27:40 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2014-11-14 01:24:21 -0500 |
commit | f30c59e921f12b209852e1ddc197dc6a8fb0142b (patch) | |
tree | 392c066f3053fcf6f4683fbe6da3a0a06b091cc7 /include/linux/hugetlb.h | |
parent | 06743521d0eae1263a09bccb1a92a9fbb94660b3 (diff) |
mm: Update generic gup implementation to handle hugepage directory
Update generic gup implementation with powerpc specific details.
On powerpc at pmd level we can have hugepte, normal pmd pointer
or a pointer to the hugepage directory.
Tested-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Steve Capper <steve.capper@linaro.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6e6d338641fe..e6b62f30ab21 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -175,6 +175,52 @@ static inline void __unmap_hugepage_range(struct mmu_gather *tlb, | |||
175 | } | 175 | } |
176 | 176 | ||
177 | #endif /* !CONFIG_HUGETLB_PAGE */ | 177 | #endif /* !CONFIG_HUGETLB_PAGE */ |
178 | /* | ||
179 | * hugepages at page global directory. If arch support | ||
180 | * hugepages at pgd level, they need to define this. | ||
181 | */ | ||
182 | #ifndef pgd_huge | ||
183 | #define pgd_huge(x) 0 | ||
184 | #endif | ||
185 | |||
186 | #ifndef pgd_write | ||
187 | static inline int pgd_write(pgd_t pgd) | ||
188 | { | ||
189 | BUG(); | ||
190 | return 0; | ||
191 | } | ||
192 | #endif | ||
193 | |||
194 | #ifndef pud_write | ||
195 | static inline int pud_write(pud_t pud) | ||
196 | { | ||
197 | BUG(); | ||
198 | return 0; | ||
199 | } | ||
200 | #endif | ||
201 | |||
202 | #ifndef is_hugepd | ||
203 | /* | ||
204 | * Some architectures requires a hugepage directory format that is | ||
205 | * required to support multiple hugepage sizes. For example | ||
206 | * a4fe3ce76 "powerpc/mm: Allow more flexible layouts for hugepage pagetables" | ||
207 | * introduced the same on powerpc. This allows for a more flexible hugepage | ||
208 | * pagetable layout. | ||
209 | */ | ||
210 | typedef struct { unsigned long pd; } hugepd_t; | ||
211 | #define is_hugepd(hugepd) (0) | ||
212 | #define __hugepd(x) ((hugepd_t) { (x) }) | ||
213 | static inline int gup_huge_pd(hugepd_t hugepd, unsigned long addr, | ||
214 | unsigned pdshift, unsigned long end, | ||
215 | int write, struct page **pages, int *nr) | ||
216 | { | ||
217 | return 0; | ||
218 | } | ||
219 | #else | ||
220 | extern int gup_huge_pd(hugepd_t hugepd, unsigned long addr, | ||
221 | unsigned pdshift, unsigned long end, | ||
222 | int write, struct page **pages, int *nr); | ||
223 | #endif | ||
178 | 224 | ||
179 | #define HUGETLB_ANON_FILE "anon_hugepage" | 225 | #define HUGETLB_ANON_FILE "anon_hugepage" |
180 | 226 | ||