diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-08-30 18:55:05 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-08-30 18:55:05 +0000 |
commit | 22db31089800953256fad419e0573802744010cd (patch) | |
tree | 9e1e9c13434495e8fbe5250e24187292add847fa | |
parent | cb3708bc51e9dbf1ba94bd98fe55e98400a8cab2 (diff) |
Lock all kernel PTE entries into the page tables, even "managed" ones
entered by pmap_enter(9). Otherwise kernel stack pages get evicted and
that doesn't end well.
We probably only need to lock in wired pages and I will probably revisit
this at some later stage.
tested by deraadt@
-rw-r--r-- | sys/arch/powerpc64/powerpc64/pmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/powerpc64/powerpc64/pmap.c b/sys/arch/powerpc64/powerpc64/pmap.c index 9449b55645f..aaa0c4094ab 100644 --- a/sys/arch/powerpc64/powerpc64/pmap.c +++ b/sys/arch/powerpc64/powerpc64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.44 2020/08/25 17:49:58 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.45 2020/08/30 18:55:04 kettenis Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -662,6 +662,9 @@ pmap_fill_pte(pmap_t pm, vaddr_t va, paddr_t pa, struct pte_desc *pted, pte->pte_hi = (pmap_pted2avpn(pted) & PTE_AVPN) | PTE_VALID; pte->pte_lo = (pa & PTE_RPGN); + if (pm == pmap_kernel()) + pte->pte_hi |= PTE_WIRED; + if (prot & PROT_WRITE) pte->pte_lo |= PTE_RW; else |