Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc().  It allows us to share the locks among UVM objects.
Reorganise UVM locking to protect P->V state and serialise pmap(9)
operations on the same page(s) by always locking their owner.  Hence
lock order: "vmpage"-lock -> pmap-lock.

Patch, proposed on tech-kern@, from Andrew Doran.
Unify /dev/{mem,kmem,zero,null} implementations in MI code.  Based on patch
from Joerg Sonnenberger, proposed on tech-kern@, in February 2008.

Work and depression still in progress.
only define __HAVE_MM_MD_READWRITE for !SUN4U builds.
Use consistent naming - uvm_obj_*().
Amend previous.
- Invent mm_md_getva() and mm_md_relva() routines, provided by MD and
  indicated with __HAVE_MM_MD_PREFER_VA.  It will be used to deal with
  cache aliasing issues and thus fix little MIPS, ARM and friends.

- Convert dev_mem_readwrite() to use unmanaged mappings.  Fix a missed
  offset addition in a case of direct map.  Sprinkle various comments in
  the memory device driver.

- Add missing direct map handling on hp700 and vax.  Make checks across
  m68k ports more consistent, reduce the diffs.  Fix kernacc check miss
  on news68k.  Minor off-by-one fix for alpha.  Add MEMC_PHYS_BASE for
  mmap() case check on acorn26.  Misc clean-up.
Drop per-"MD page" (i.e. struct pmap_page) locking i.e. pp_lock/pp_unlock
and rely on locking provided by upper layer, UVM.  Sprinkle asserts.
Pull-up rev 1.94
A round of compile and other fixes to previous.
Fix hp300, missed in previous.
- Drop vmmap and its reserved page on hp700, sparc and x86.
- mm_init: use UVM_KMF_WAITVA when allocating a VA.
ubc_alloc: when replacing a cache entry, lock the old object from which we
are deassociating and removing the old mapping.
Add ubc_purge() and purge/deassociate any related UBC entries during
object (usually, vnode) destruction.  Since locking (and thus object)
is required to enter/remove mappings - object is not allowed anymore
to disappear with any UBC entries left.

From original patch by ad@ with some modifications.
Apply renovated patch to significantly reduce TLB shootdowns in x86 pmap,
also provide TLBSTATS option to measure and track TLB shootdowns.  Details:

http://mail-index.netbsd.org/port-i386/2009/01/11/msg001018.html

Patch from Andrew Doran, proposed on tech-x86 [sic], in January 2009.

XXX: amd64 and xen are not yet; work in progress.
Partly rewrite amd64 TLB shutdown handler for the changes in x86 pmap.
At this point, branch seems to pass preliminar stress tests on amd64.
Slight simplification to TLB shootdown handler on i386 and amd64.
Split x86 TLB shootdown code into a separate file.
Code part is under TNF license, as per pmap.c 1.105.2.4 revision.
pmap_map_ptes: handle emap on TLB flush.
sync with head