summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-09-05 11:44:47 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-09-05 11:44:47 +0000
commitd89b9762bad2ed640923b056d6fcddd0a0e33fd3 (patch)
treef07325c6469083fef2162b03a5fa500773c4c2b7 /sys/arch/i386
parent46ba0b771aca771d6a1475dc52f213536036fb15 (diff)
Introduce dummy pagers for 'special' subsystems using UVM objects.
Some pmaps (x86, hppa) and the buffer cache rely on UVM objects to allocate and manipulate pages. These objects should not be manipulated by uvm_fault() and do not currently require the same locking enforcement. Use the dummy pagers to explicitly document which UVM functions are meant to manipulate UVM objects (uobj) that do not need the upcoming `vmobjlock' and instead still rely on the KERNEL_LOCK(). Tested by many as part of a larger diff. ok kettenis@, beck@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/pmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c
index a11178c8b63..b5521e15775 100644
--- a/sys/arch/i386/i386/pmap.c
+++ b/sys/arch/i386/i386/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.214 2021/06/16 09:02:21 mpi Exp $ */
+/* $OpenBSD: pmap.c,v 1.215 2021/09/05 11:44:46 mpi Exp $ */
/* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */
/*
@@ -963,7 +963,7 @@ pmap_bootstrap(vaddr_t kva_start)
kpm = pmap_kernel();
mtx_init(&kpm->pm_mtx, -1); /* must not be used */
mtx_init(&kpm->pm_apte_mtx, IPL_VM);
- uvm_obj_init(&kpm->pm_obj, NULL, 1);
+ uvm_obj_init(&kpm->pm_obj, &pmap_pager, 1);
bzero(&kpm->pm_list, sizeof(kpm->pm_list)); /* pm_list not used */
kpm->pm_pdir = (vaddr_t)(proc0.p_addr->u_pcb.pcb_cr3 + KERNBASE);
kpm->pm_pdirpa = proc0.p_addr->u_pcb.pcb_cr3;
@@ -1348,7 +1348,7 @@ pmap_create(void)
mtx_init(&pmap->pm_apte_mtx, IPL_VM);
/* init uvm_object */
- uvm_obj_init(&pmap->pm_obj, NULL, 1);
+ uvm_obj_init(&pmap->pm_obj, &pmap_pager, 1);
pmap->pm_stats.wired_count = 0;
pmap->pm_stats.resident_count = 1; /* count the PDP allocd below */
pmap->pm_ptphint = NULL;