]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: Fix build errors when THP is enabled
authorNitin Gupta <nitin.m.gupta@oracle.com>
Tue, 13 Jun 2017 22:27:17 +0000 (15:27 -0700)
committerAllen Pais <allen.pais@oracle.com>
Fri, 16 Jun 2017 12:38:37 +0000 (18:08 +0530)
Build errors were due to a new page table level
(p4d) introduced by 5-level page table patches.

Orabug: 25858371

Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
mm/huge_memory.c

index cb6d0f1efd43016dc59053f63f32113e6e3b2dad..d7d33e7125a8893e04a931d400ceae4511206397 100644 (file)
@@ -1627,6 +1627,7 @@ pmd_t *page_check_address_pmd(struct page *page,
                              spinlock_t **ptl)
 {
        pgd_t *pgd;
+       p4d_t *p4d;
        pud_t *pud;
        pmd_t *pmd;
 
@@ -1636,7 +1637,10 @@ pmd_t *page_check_address_pmd(struct page *page,
        pgd = pgd_offset(mm, address);
        if (!pgd_present(*pgd))
                return NULL;
-       pud = pud_offset(pgd, address);
+       p4d = p4d_offset(pgd, address);
+       if (!p4d_present(*p4d))
+               return NULL;
+       pud = pud_offset(p4d, address);
        if (!pud_present(*pud))
                return NULL;
        pmd = pmd_offset(pud, address);
@@ -3011,6 +3015,7 @@ static void split_huge_page_address(struct mm_struct *mm,
                                    unsigned long address)
 {
        pgd_t *pgd;
+       p4d_t *p4d;
        pud_t *pud;
        pmd_t *pmd;
 
@@ -3020,7 +3025,11 @@ static void split_huge_page_address(struct mm_struct *mm,
        if (!pgd_present(*pgd))
                return;
 
-       pud = pud_offset(pgd, address);
+       p4d = p4d_offset(pgd, address);
+       if (!p4d_present(*p4d))
+               return;
+
+       pud = pud_offset(p4d, address);
        if (!pud_present(*pud))
                return;