git: 374d67885afa - main - amd64/arm64 pmap: Remove KASSERTs that can never fail
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Nov 2026 18:06:21 UTC
The branch main has been updated by alc:
URL: https://cgit.FreeBSD.org/src/commit/?id=374d67885afa366694065e60c158cd456bd733b8
commit 374d67885afa366694065e60c158cd456bd733b8
Author: Alan Cox <alc@FreeBSD.org>
AuthorDate: 2026-11-22 17:49:13 +0000
Commit: Alan Cox <alc@FreeBSD.org>
CommitDate: 2026-11-22 18:04:33 +0000
amd64/arm64 pmap: Remove KASSERTs that can never fail
In pmap_enter_largepage(), arm64's L1 block case twice asserts that
pmap_l0_to_l1() didn't return NULL, and amd64's 1G case asserts that
pmap_pml4e_to_pdpe() didn't. Neither function ever returns NULL, so
these assertions can never fail.
---
sys/amd64/amd64/pmap.c | 1 -
sys/arm64/arm64/pmap.c | 2 --
2 files changed, 3 deletions(-)
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index d6c2636d5844..69898ab491e7 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -7036,7 +7036,6 @@ restart:
MPASS(origpte == 0);
} else {
pdpe = pmap_pml4e_to_pdpe(pml4e, va);
- KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va));
origpte = *pdpe;
if ((origpte & PG_V) == 0) {
mp = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME);
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index b65921d736e4..e6e53d05fefe 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5566,11 +5566,9 @@ restart:
goto restart;
}
l1p = pmap_l0_to_l1(l0p, va);
- KASSERT(l1p != NULL, ("va %#lx lost l1 entry", va));
origpte = pmap_load(l1p);
} else {
l1p = pmap_l0_to_l1(l0p, va);
- KASSERT(l1p != NULL, ("va %#lx lost l1 entry", va));
origpte = pmap_load(l1p);
if ((origpte & ATTR_DESCR_VALID) == 0) {
mp = PTE_TO_VM_PAGE(pmap_load(l0p));