diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2019-11-05 16:33:19 +0200 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2019-11-26 11:33:39 -0800 |
commit | f0d1eab8c2e1f9240cf4ae4753d7947c65e60bd7 (patch) | |
tree | d7d8ecd9e6c38a6f52680888b1453a74b72a5823 /arch/xtensa/mm/tlb.c | |
parent | 8951eb1530ddf83dbb815d38e97afddc6a0d1140 (diff) |
xtensa: mm: fix PMD folding implementation
There was a definition of pmd_offset() in arch/xtensa/include/asm/pgtable.h
that shadowed the generic implementation defined in
include/asm-generic/pgtable-nopmd.h.
As the result, xtensa had shortcuts in page table traversal in several
places instead of doing level unfolding.
Remove local override for pmd_offset() and add page table unfolding where
necessary.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Message-Id: <1572964400-16542-2-git-send-email-rppt@kernel.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/mm/tlb.c')
-rw-r--r-- | arch/xtensa/mm/tlb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c index 59153d0aa890..164a2ca07a1f 100644 --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c @@ -169,6 +169,7 @@ static unsigned get_pte_for_vaddr(unsigned vaddr) struct task_struct *task = get_current(); struct mm_struct *mm = task->mm; pgd_t *pgd; + pud_t *pud; pmd_t *pmd; pte_t *pte; @@ -177,7 +178,10 @@ static unsigned get_pte_for_vaddr(unsigned vaddr) pgd = pgd_offset(mm, vaddr); if (pgd_none_or_clear_bad(pgd)) return 0; - pmd = pmd_offset(pgd, vaddr); + pud = pud_offset(pgd, vaddr); + if (pud_none_or_clear_bad(pud)) + return 0; + pmd = pmd_offset(pud, vaddr); if (pmd_none_or_clear_bad(pmd)) return 0; pte = pte_offset_map(pmd, vaddr); |