NetBSD/sys/uvm
chs 39c928de1c uvm: prevent TLB invalidation races during COW resolution
When a thread takes a page fault which results in COW resolution,
other threads in the same process can be concurrently accessing that
same mapping on other CPUs.  When the faulting thread updates the pmap
entry at the end of COW processing, the resulting TLB invalidations to
other CPUs are not done atomically, so another thread can write to the
new writable page and then a third thread might still read from the
old read-only page, resulting in inconsistent views of the page by the
latter two threads.  Fix this by removing the pmap entry entirely for
the original page before we install the new pmap entry for the new
page, so that the new page can only be modified after the old page is
no longer accessible.

This fixes PR 56535 as well as the netbsd versions of problems
described in various bug trackers:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225584
https://reviews.freebsd.org/D14347
https://github.com/golang/go/issues/34988
2023-08-13 23:06:07 +00:00
..
pmap Improve debug 2023-08-01 08:17:26 +00:00
Makefile
files.uvm
uvm.h uvm(9): One rndsource for faults -- not one per CPU. 2023-07-17 12:55:37 +00:00
uvm_amap.c s/value value/value/ in comment. No functional change. 2023-06-19 08:23:35 +00:00
uvm_amap.h
uvm_anon.c
uvm_anon.h
uvm_aobj.c uvm: Eliminate __HAVE_ATOMIC_AS_MEMBAR conditionals. 2023-02-24 11:03:13 +00:00
uvm_aobj.h
uvm_bio.c uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B) 2023-04-09 09:00:56 +00:00
uvm_coredump.c
uvm_ddb.h
uvm_device.c
uvm_device.h
uvm_extern.h nkmempages should be size_t 2023-02-26 07:27:14 +00:00
uvm_fault.c uvm: prevent TLB invalidation races during COW resolution 2023-08-13 23:06:07 +00:00
uvm_fault.h
uvm_fault_i.h
uvm_glue.c
uvm_glue.h
uvm_init.c uvm(9): One rndsource for faults -- not one per CPU. 2023-07-17 12:55:37 +00:00
uvm_io.c
uvm_km.c uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B) 2023-04-09 09:00:56 +00:00
uvm_km.h
uvm_loan.c
uvm_loan.h
uvm_map.c uvm_findspace(): For sh3, convert a KASSERTMSG(9) into printf(9) 2023-08-03 03:15:48 +00:00
uvm_map.h
uvm_meter.c
uvm_mmap.c
uvm_mremap.c
uvm_object.c
uvm_object.h
uvm_page.c uvm(9): One rndsource for faults -- not one per CPU. 2023-07-17 12:55:37 +00:00
uvm_page.h
uvm_page_array.c
uvm_page_array.h
uvm_page_status.c
uvm_pager.c
uvm_pager.h
uvm_param.h sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>. 2023-07-11 09:48:56 +00:00
uvm_pdaemon.c
uvm_pdaemon.h
uvm_pdpolicy.h
uvm_pdpolicy_clock.c
uvm_pdpolicy_clockpro.c
uvm_pdpolicy_impl.h
uvm_pgflcache.c
uvm_pgflcache.h
uvm_pglist.c
uvm_pglist.h
uvm_physseg.c uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B) 2023-04-09 09:00:56 +00:00
uvm_physseg.h
uvm_pmap.h
uvm_prot.h
uvm_readahead.c
uvm_readahead.h
uvm_rndsource.h uvm(9): One rndsource for faults -- not one per CPU. 2023-07-17 12:55:37 +00:00
uvm_stat.c
uvm_stat.h
uvm_swap.c uvm(9): KASSERT(A && B) -> KASSERT(A); KASSERT(B) 2023-04-09 09:00:56 +00:00
uvm_swap.h
uvm_swapstub.c
uvm_unix.c
uvm_user.c
uvm_vnode.c uvm: Simplify assertion in uvn_get. 2023-04-09 12:37:12 +00:00