mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mm: convert generic code to 5-level paging
Convert all non-architecture-specific code to 5-level paging. It's mostly mechanical adding handling one more page table level in places where we deal with pud_t. Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
048456dcf2
commit
c2febafc67
23 changed files with 595 additions and 120 deletions
|
|
@ -193,14 +193,14 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
|
|||
}
|
||||
|
||||
static inline unsigned long change_pud_range(struct vm_area_struct *vma,
|
||||
pgd_t *pgd, unsigned long addr, unsigned long end,
|
||||
p4d_t *p4d, unsigned long addr, unsigned long end,
|
||||
pgprot_t newprot, int dirty_accountable, int prot_numa)
|
||||
{
|
||||
pud_t *pud;
|
||||
unsigned long next;
|
||||
unsigned long pages = 0;
|
||||
|
||||
pud = pud_offset(pgd, addr);
|
||||
pud = pud_offset(p4d, addr);
|
||||
do {
|
||||
next = pud_addr_end(addr, end);
|
||||
if (pud_none_or_clear_bad(pud))
|
||||
|
|
@ -212,6 +212,26 @@ static inline unsigned long change_pud_range(struct vm_area_struct *vma,
|
|||
return pages;
|
||||
}
|
||||
|
||||
static inline unsigned long change_p4d_range(struct vm_area_struct *vma,
|
||||
pgd_t *pgd, unsigned long addr, unsigned long end,
|
||||
pgprot_t newprot, int dirty_accountable, int prot_numa)
|
||||
{
|
||||
p4d_t *p4d;
|
||||
unsigned long next;
|
||||
unsigned long pages = 0;
|
||||
|
||||
p4d = p4d_offset(pgd, addr);
|
||||
do {
|
||||
next = p4d_addr_end(addr, end);
|
||||
if (p4d_none_or_clear_bad(p4d))
|
||||
continue;
|
||||
pages += change_pud_range(vma, p4d, addr, next, newprot,
|
||||
dirty_accountable, prot_numa);
|
||||
} while (p4d++, addr = next, addr != end);
|
||||
|
||||
return pages;
|
||||
}
|
||||
|
||||
static unsigned long change_protection_range(struct vm_area_struct *vma,
|
||||
unsigned long addr, unsigned long end, pgprot_t newprot,
|
||||
int dirty_accountable, int prot_numa)
|
||||
|
|
@ -230,7 +250,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma,
|
|||
next = pgd_addr_end(addr, end);
|
||||
if (pgd_none_or_clear_bad(pgd))
|
||||
continue;
|
||||
pages += change_pud_range(vma, pgd, addr, next, newprot,
|
||||
pages += change_p4d_range(vma, pgd, addr, next, newprot,
|
||||
dirty_accountable, prot_numa);
|
||||
} while (pgd++, addr = next, addr != end);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue