aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2024-11-23 21:02:25 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2024-11-25 12:16:50 +0000
commit2d6923790b16785ac691cedb23234067672fe1cc (patch)
tree10e3ba86e0a09a9e5558e1576c26ac00614fbd90
parentaebac84982567b9f026174f545f27902ae371027 (diff)
-rw-r--r--sys/amd64/amd64/pmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 3b7220369b61..21b8555b5380 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -4082,7 +4082,19 @@ pmap_qremove(vm_offset_t sva, int count)
va = sva;
while (count-- > 0) {
+ /*
+ * pmap_enter() calls within the kernel virtual
+ * address space happen on virtual addresses from
+ * subarenas that import superpage-sized and -aligned
+ * address ranges. So, the virtual address that we
+ * allocate to use with pmap_qenter() can't be close
+ * enough to one of those pmap_enter() calls for it to
+ * be caught up in a promotion.
+ */
KASSERT(va >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", va));
+ KASSERT((*vtopde(va) & X86_PG_PS) == 0,
+ ("pmap_qremove on promoted va %#lx", va));
+
pmap_kremove(va);
va += PAGE_SIZE;
}