From 45a69b092c959ec815740e67960f097f4b27b5e9 Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 29 Apr 2021 15:34:22 +0000 Subject: [PATCH] Revert part of the previous uvm_km_zalloc(9) to km_alloc(9) commit. The chunk with mapping for pm_pdir_intel causes crashes for sthen@ and bluhm@. i386 pagedaemon panic: kernel diagnostic assertion "pg->wire_count == 0" failed: file "/usr/src/sys/uvm/uvm_page.c", line 1265 One of my 8 CPU 3 GB RAM machines can reproduce it when building clang with make -j 9. This commit hides the underlying bug. OK mpi@ --- sys/arch/i386/i386/pmapae.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sys/arch/i386/i386/pmapae.c b/sys/arch/i386/i386/pmapae.c index 3ed889e5dd9..3a179a6e8c6 100644 --- a/sys/arch/i386/i386/pmapae.c +++ b/sys/arch/i386/i386/pmapae.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmapae.c,v 1.61 2021/04/24 09:44:45 mpi Exp $ */ +/* $OpenBSD: pmapae.c,v 1.62 2021/04/29 15:34:22 bluhm Exp $ */ /* * Copyright (c) 2006-2008 Michael Shalayeff @@ -1938,20 +1938,7 @@ pmap_enter_special_pae(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int32_t flags) __func__, va); if (!pmap->pm_pdir_intel) { -#if notyet - /* - * XXX mapping is established via pmap_kenter() and lost - * after enabling PAE. - */ - vapd = (vaddr_t)km_alloc(4 * NBPG, &kv_any, &kp_zero, - &kd_waitok); -#else - vapd = (vaddr_t)km_alloc(4 * NBPG, &kv_any, &kp_pageable, - &kd_waitok); - if (vapd != 0) - bzero((void *)vapd, 4 * NBPG); -#endif - if (vapd == 0) + if ((vapd = uvm_km_zalloc(kernel_map, 4 * NBPG)) == 0) panic("%s: kernel_map out of virtual space!", __func__); pmap->pm_pdir_intel = vapd; if (!pmap_extract(pmap, (vaddr_t)&pmap->pm_pdidx_intel, -- 2.20.1