1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00

Allow sbld allocation to fail when PMAP_CANFAIL.

pool_get in powerpc64's pmap might fail when uvm_km_pages.free == 0.
This might cause KASSERT(slbd) to panic 'kernel diagnostic assertion
"sbld" failed'.  Remove this KASSERT and add a check for PMAP_CANFAIL.
pmap_enter calls without PMAP_CANFAIL might still panic.

ok mpi@ jca@
This commit is contained in:
gkoehler 2024-06-04 17:31:59 +00:00
parent 92119d768f
commit 9e6587aee4

View File

@ -1,4 +1,4 @@
/* $OpenBSD: pmap.c,v 1.61 2024/04/03 19:30:59 gkoehler Exp $ */
/* $OpenBSD: pmap.c,v 1.62 2024/06/04 17:31:59 gkoehler Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
@ -602,7 +602,11 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, struct pte_desc *pted, int flags)
slbd = pmap_slbd_lookup(pm, va);
if (slbd == NULL) {
slbd = pmap_slbd_alloc(pm, va);
KASSERT(slbd);
if (slbd == NULL) {
if ((flags & PMAP_CANFAIL) == 0)
panic("%s: unable to allocate slbd", __func__);
return ENOMEM;
}
}
vp1 = slbd->slbd_vp;