git: 9810fb151938 - stable/14 - amd64 pmap: convert panics to KASSERTs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Aug 2025 21:09:57 UTC
The branch stable/14 has been updated by alc:
URL: https://cgit.FreeBSD.org/src/commit/?id=9810fb151938b8ceb2e8774b85f1530f41c8241c
commit 9810fb151938b8ceb2e8774b85f1530f41c8241c
Author: Alan Cox <alc@FreeBSD.org>
AuthorDate: 2025-07-06 17:42:08 +0000
Commit: Alan Cox <alc@FreeBSD.org>
CommitDate: 2025-08-09 21:01:10 +0000
amd64 pmap: convert panics to KASSERTs
With the recent changes to pmap_demote_DMAP(), the calls to
pmap_demote_pdpe() and pmap_demote_pde_mpte() should never fail, so
we change the associated panics to KASSERTs.
(cherry picked from commit 6a7761b4d27c99b3b548f2d948b88bf1430ee636)
---
sys/amd64/amd64/pmap.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 7fc17a55d2a1..b818fc6979d3 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -9979,7 +9979,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate)
pd_entry_t *pde;
vm_offset_t va;
vm_page_t m, mpte;
- bool changed;
+ bool changed, rv __diagused;
if (len == 0)
return;
@@ -10009,8 +10009,8 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate)
if ((*pdpe & X86_PG_V) == 0)
panic("pmap_demote_DMAP: invalid PDPE");
if ((*pdpe & PG_PS) != 0) {
- if (!pmap_demote_pdpe(kernel_pmap, pdpe, va, m))
- panic("pmap_demote_DMAP: PDPE failed");
+ rv = pmap_demote_pdpe(kernel_pmap, pdpe, va, m);
+ KASSERT(rv, ("pmap_demote_DMAP: PDPE failed"));
changed = true;
m = NULL;
}
@@ -10021,9 +10021,9 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate)
if ((*pde & PG_PS) != 0) {
mpte->pindex = pmap_pde_pindex(va);
pmap_pt_page_count_adj(kernel_pmap, 1);
- if (!pmap_demote_pde_mpte(kernel_pmap, pde, va,
- NULL, mpte))
- panic("pmap_demote_DMAP: PDE failed");
+ rv = pmap_demote_pde_mpte(kernel_pmap, pde, va,
+ NULL, mpte);
+ KASSERT(rv, ("pmap_demote_DMAP: PDE failed"));
changed = true;
mpte = NULL;
}