diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2019-11-05 16:33:20 +0200 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2019-11-26 11:33:39 -0800 |
commit | f5ee2567921dec4f489c16d4fe22c3a7222d0ce6 (patch) | |
tree | 54a6a21fad933163b9b486439d852c33b9438a1a /arch/xtensa/mm/fault.c | |
parent | f0d1eab8c2e1f9240cf4ae4753d7947c65e60bd7 (diff) | |
download | linux-f5ee2567921dec4f489c16d4fe22c3a7222d0ce6.tar.gz linux-f5ee2567921dec4f489c16d4fe22c3a7222d0ce6.tar.bz2 linux-f5ee2567921dec4f489c16d4fe22c3a7222d0ce6.zip |
xtensa: get rid of __ARCH_USE_5LEVEL_HACK
xtensa has 2-level page tables and already uses pgtable-nopmd for page
table folding.
Add walks of p4d level where appropriate and drop usage of
__ARCH_USE_5LEVEL_HACK.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Message-Id: <1572964400-16542-3-git-send-email-rppt@kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> [fix up
arch/xtensa/include/asm/fixmap.h and
arch/xtensa/mm/tlb.c]
Diffstat (limited to 'arch/xtensa/mm/fault.c')
-rw-r--r-- | arch/xtensa/mm/fault.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 68a041402025..bee30a77cd70 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -197,6 +197,7 @@ vmalloc_fault: struct mm_struct *act_mm = current->active_mm; int index = pgd_index(address); pgd_t *pgd, *pgd_k; + p4d_t *p4d, *p4d_k; pud_t *pud, *pud_k; pmd_t *pmd, *pmd_k; pte_t *pte_k; @@ -212,8 +213,13 @@ vmalloc_fault: pgd_val(*pgd) = pgd_val(*pgd_k); - pud = pud_offset(pgd, address); - pud_k = pud_offset(pgd_k, address); + p4d = p4d_offset(pgd, address); + p4d_k = p4d_offset(pgd_k, address); + if (!p4d_present(*p4d) || !p4d_present(*p4d_k)) + goto bad_page_fault; + + pud = pud_offset(p4d, address); + pud_k = pud_offset(p4d_k, address); if (!pud_present(*pud) || !pud_present(*pud_k)) goto bad_page_fault; |