From 133b1f146122959e4a20f3f61efa9f90fe1aed6d Mon Sep 17 00:00:00 2001 From: Mitchell Horne Date: Wed, 24 Jun 2020 15:21:12 +0000 Subject: [PATCH] Only invalidate the early DTB mapping if it exists This temporary mapping will become optional. Booting via loader(8) means that the DTB will have already been copied into the kernel's staging area, and is therefore covered by the early KVA mappings. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D24911 --- sys/riscv/riscv/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index ada0f74e5ec3..33902bb1e85f 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -619,8 +619,8 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) * possibility of an aliased mapping in the future. */ l2p = pmap_l2(kernel_pmap, VM_EARLY_DTB_ADDRESS); - KASSERT((pmap_load(l2p) & PTE_V) != 0, ("dtpb not mapped")); - pmap_clear(l2p); + if ((pmap_load(l2p) & PTE_V) != 0) + pmap_clear(l2p); sfence_vma();