Home | History | Annotate | Download | only in uvm
History log of /src/sys/uvm/uvm_fault.h
RevisionDateAuthorComments
 1.20  02-Feb-2011  chuck udpate license clauses on my code to match the new-style BSD licenses.
based on diff that rmind@ sent me.

no functional change with this commit.
 1.19  15-Mar-2006  drochner branches: 1.19.88; 1.19.94; 1.19.96;
-clean up the interface to uvm_fault: the "fault type" didn't serve
any purpose (done by a macro, so we don't save any cycles for now)
-kill vm_fault_t; it is not needed for real faults, and for simulated
faults (wiring) it can be replaced by UVM internal flags
-remove <uvm/uvm_fault.h> from uvm_extern.h again
 1.18  11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10;
merge ktrace-lwp.
 1.17  24-Mar-2004  junyoung branches: 1.17.16;
Nuke __P().
 1.16  31-Dec-2001  chs branches: 1.16.16;
introduce a new UVM fault type, VM_FAULT_WIREMAX. this is different
from VM_FAULT_WIRE in that when the pages being wired are faulted in,
the simulated fault is at the maximum protection allowed for the mapping
instead of the current protection. use this in uvm_map_pageable{,_all}()
to fix the problem where writing via ptrace() to shared libraries that
are also mapped with wired mappings in another process causes a
diagnostic panic when the wired mapping is removed.

this is a really obscure problem so it deserves some more explanation.
ptrace() writing to another process ends up down in uvm_map_extract(),
which for MAP_PRIVATE mappings (such as shared libraries) will cause
the amap to be copied or created. then the amap is made shared
(ie. the AMAP_SHARED flag is set) between the kernel and the ptrace()d
process so that the kernel can modify pages in the amap and have the
ptrace()d process see the changes. then when the page being modified
is actually faulted on, the object pages (from the shared library vnode)
is copied to a new anon page and inserted into the shared amap.
to make all the processes sharing the amap actually see the new anon
page instead of the vnode page that was there before, we need to
invalidate all the pmap-level mappings of the vnode page in the pmaps
of the processes sharing the amap, but we don't have a good way of
doing this. the amap doesn't keep track of the vm_maps which map it.
so all we can do at this point is to remove all the mappings of the
page with pmap_page_protect(), but this has the unfortunate side-effect
of removing wired mappings as well. removing wired mappings with
pmap_page_protect() is a legitimate operation, it can happen when a file
with a wired mapping is truncated. so the pmap has no way of knowing
whether a request to remove a wired mapping is normal or when it's due to
this weird situation. so the pmap has to remove the weird mapping.
the process being ptrace()d goes away and life continues. then,
much later when we go to unwire or remove the wired vm_map mapping,
we discover that the pmap mapping has been removed when it should
still be there, and we panic.

so where did we go wrong? the problem is that we don't have any way
to update just the pmap mappings that need to be updated in this
scenario. we could invent a mechanism to do this, but that is much
more complicated than this change and it doesn't seem like the right
way to go in the long run either.

the real underlying problem here is that wired pmap mappings just
aren't a good concept. one of the original properties of the pmap
design was supposed to be that all the information in the pmap could
be thrown away at any time and the VM system could regenerate it all
through fault processing, but wired pmap mappings don't allow that.
a better design for UVM would not require wired pmap mappings,
and Chuck C. and I are talking about this, but it won't be done
anytime soon, so this change will do for now.

this change has the effect of causing MAP_PRIVATE mappings to be
copied to anonymous memory when they are mlock()d, so that uvm_fault()
doesn't need to copy these pages later when called from ptrace(), thus
avoiding the call to pmap_page_protect() and the panic that results
from this when the mlock()d region is unlocked or freed. note that
this change doesn't help the case where the wired mapping is MAP_SHARED.

discussed at great length with Chuck Cranor.
fixes PRs 10363, 12554, 12604, 13041, 13487, 14580 and 14853.
 1.15  02-Jun-2001  chs branches: 1.15.2;
replace vm_map{,_entry}_t with struct vm_map{,_entry} *.
 1.14  26-Jun-2000  mrg branches: 1.14.2;
remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.13  21-Jun-1999  thorpej branches: 1.13.2;
Protect prototypes, certain macros, and inlines from userland.
 1.12  16-Jun-1999  thorpej * Rename uvm_fault_unwire() to uvm_fault_unwire_locked(), and require that
the map be at least read-locked to call this function. This requirement
will be taken advantage of in a future commit.
* Write a uvm_fault_unwire() wrapper which read-locks the map and calls
uvm_fault_unwire_locked().
* Update the comments describing the locking contraints of uvm_fault_wire()
and uvm_fault_unwire().
 1.11  04-Jun-1999  thorpej Keep interrupt-safe maps on an additional queue. In uvm_fault(), if we're
looking up a kernel address, check to see if the address is on this
"interrupt-safe" list. If so, return failure immediately. This prevents
a locking screw if a page fault is taken on an interrupt-safe map in or
out of interrupt context.
 1.10  28-May-1999  thorpej Make uvm_fault_unwire() take a vm_map_t, rather than a pmap_t, for
consistency. Use this opportunity for checking for intrsafe map use
in this routine (which is illegal).
 1.9  26-May-1999  thorpej Pass an access_type to uvm_fault_wire(), which it forwards on to
uvm_fault().
 1.8  25-Mar-1999  mrg branches: 1.8.4;
remove now >1 year old pre-release message.
 1.7  11-Oct-1998  chuck remove unused share map code from UVM:
- simplify uvm_faultinfo in uvm_fault.h (parent map tracking no longer needed)
- adjust locking and lookup functions in uvm_fault_i.h to reflect the above
- replace ufi.rvaddr with ufi.orig_rvaddr in uvm_fault.c since rvaddr is
no longer needed.
- no need to worry about share map translations in uvm_fault(). simplify.
 1.6  13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.5  09-Mar-1998  mrg branches: 1.5.2;
KNF.
 1.4  10-Feb-1998  perry add/cleanup multiple inclusion protection.
 1.3  07-Feb-1998  mrg restore rcsids
 1.2  06-Feb-1998  thorpej RCS ID police.
 1.1  05-Feb-1998  mrg branches: 1.1.1;
Initial revision
 1.1.1.1  05-Feb-1998  mrg initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code. i provided some help
getting swap and paging working, and other bug fixes/ideas. chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the UVM kernel code portion.


this will be KNF'd shortly. :-)
 1.5.2.1  30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.8.4.2  01-Jul-1999  thorpej Sync w/ -current.
 1.8.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.13.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.2.2  08-Jan-2002  nathanw Catch up to -current.
 1.14.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.15.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.16.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.16.2  18-Sep-2004  skrll Sync with HEAD.
 1.16.16.1  03-Aug-2004  skrll Sync with HEAD
 1.17.16.1  21-Jun-2006  yamt sync with head.
 1.18.10.1  19-Apr-2006  elad oops - *really* sync to head this time.
 1.18.8.1  01-Apr-2006  yamt sync with head.
 1.18.6.1  22-Apr-2006  simonb Sync with head.
 1.18.4.1  09-Sep-2006  rpaulo sync with head
 1.19.96.1  08-Feb-2011  bouyer Sync with HEAD
 1.19.94.1  06-Jun-2011  jruoho Sync with HEAD.
 1.19.88.1  05-Mar-2011  rmind sync with head

RSS XML Feed