From 22db31089800953256fad419e0573802744010cd Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 30 Aug 2020 18:55:05 +0000 Subject: 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@ --- sys/arch/powerpc64/powerpc64/pmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3