From 34dcf8975d103d034d7e8b6788c0645cc93af254 Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 17 Mar 2002 00:56:41 +0000 Subject: Convert all pmap_kenter/pmap_kremove pairs in MI code to use pmap_qenter/ pmap_qremove. pmap_kenter is not safe to use in MI code because it is not guaranteed to flush the mapping from the tlb on all cpus. If the process in question is preempted and migrates cpus between the call to pmap_kenter and pmap_kremove, the original cpu will be left with stale mappings in its tlb. This is currently not a problem for i386 because we do not use PG_G on SMP, and thus all mappings are flushed from the tlb on context switches, not just user mappings. This is not the case on all architectures, and if PG_G is to be used with SMP on i386 it will be a problem. This was committed by peter earlier as part of his fine grained tlb shootdown work for i386, which was backed out for other reasons. Reviewed by: peter --- sys/kern/sys_process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/sys_process.c') diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 39ff515..a6780d4 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -278,14 +278,14 @@ proc_rwmem(struct proc *p, struct uio *uio) vm_object_reference(object); vm_map_lookup_done(tmap, out_entry); - pmap_kenter(kva, VM_PAGE_TO_PHYS(m)); + pmap_qenter(kva, &m, 1); /* * Now do the i/o move. */ error = uiomove((caddr_t)(kva + page_offset), len, uio); - pmap_kremove(kva); + pmap_qremove(kva, 1); /* * release the page and the object -- cgit v1.1