diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-10 13:15:46 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-08-30 11:57:02 -0400 |
commit | a718e10cbaa28035b7ab510d68fef68524454e1a (patch) | |
tree | 64b9283a5d94e2aa78046cc52f47757a8224d8ed /arch/tile/mm | |
parent | 35f059761c5ac313d13372fe3cdaa41bce3d0dbf (diff) |
tile: handle super huge pages in virt_to_pte
This tile-specific API had a minor bug, in that if a super huge (>4GB)
page mapped a particular address range, we wouldn't handle it correctly.
As part of fixing that bug, I also cleaned up some of the pud and pmd
accessors to make them more consistent.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/mm')
-rw-r--r-- | arch/tile/mm/pgtable.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/tile/mm/pgtable.c b/arch/tile/mm/pgtable.c index e41487e22163..300443389671 100644 --- a/arch/tile/mm/pgtable.c +++ b/arch/tile/mm/pgtable.c | |||
@@ -338,6 +338,8 @@ pte_t *virt_to_pte(struct mm_struct* mm, unsigned long addr) | |||
338 | pud = pud_offset(pgd, addr); | 338 | pud = pud_offset(pgd, addr); |
339 | if (!pud_present(*pud)) | 339 | if (!pud_present(*pud)) |
340 | return NULL; | 340 | return NULL; |
341 | if (pud_huge_page(*pud)) | ||
342 | return (pte_t *)pud; | ||
341 | pmd = pmd_offset(pud, addr); | 343 | pmd = pmd_offset(pud, addr); |
342 | if (pmd_huge_page(*pmd)) | 344 | if (pmd_huge_page(*pmd)) |
343 | return (pte_t *)pmd; | 345 | return (pte_t *)pmd; |
@@ -345,6 +347,7 @@ pte_t *virt_to_pte(struct mm_struct* mm, unsigned long addr) | |||
345 | return NULL; | 347 | return NULL; |
346 | return pte_offset_kernel(pmd, addr); | 348 | return pte_offset_kernel(pmd, addr); |
347 | } | 349 | } |
350 | EXPORT_SYMBOL(virt_to_pte); | ||
348 | 351 | ||
349 | pgprot_t set_remote_cache_cpu(pgprot_t prot, int cpu) | 352 | pgprot_t set_remote_cache_cpu(pgprot_t prot, int cpu) |
350 | { | 353 | { |