From 098b8c899e4995d0d888359cf3e377c6065ee582 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 30 Aug 2016 16:45:15 +0000 Subject: [PATCH] Because we need to use a break-before-make sequence when promoting pages there is a short period where functions that walk the kernel page table without locking them may see an invalid entry. One solution would be to add locking to these functions, however some may be called from locations where we are unable to sleep. Until a better solution can be found stop promoting pages in the kernel pmap so these functions work as expected. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/pmap.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 961c5b1e68d2..71b29c4de25a 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -2936,14 +2936,17 @@ validate: PTE_SYNC(l3); pmap_invalidate_page(pmap, va); - if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) - cpu_icache_sync_range(va, PAGE_SIZE); + if (pmap != pmap_kernel()) { + if (pmap == &curproc->p_vmspace->vm_pmap) + cpu_icache_sync_range(va, PAGE_SIZE); - if ((mpte == NULL || mpte->wire_count == NL3PG) && - pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && - vm_reserv_level_iffullpop(m) == 0) { - KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); - pmap_promote_l2(pmap, pde, va, &lock); + if ((mpte == NULL || mpte->wire_count == NL3PG) && + pmap_superpages_enabled() && + (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) { + KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); + pmap_promote_l2(pmap, pde, va, &lock); + } } if (lock != NULL)