kernel - pmap (i386) - Refactor the foreign pmap mapping
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 30 Dec 2009 19:38:39 +0000 (11:38 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 30 Dec 2009 19:38:39 +0000 (11:38 -0800)
commitc1692ddf9735ab0d85ef3a98b211dbf18f142f81
tree98f2f7c892ff894005bb00ba3b5a44a73c1879b1
parent5926987a8c7f76518fb332134f1f6c2f3db89862
kernel - pmap (i386) - Refactor the foreign pmap mapping

* Remove the global alternative pmap and related hacks.  Leave
  the PTD entry reserved because I really do not want to
  change the location of MPPTDI (The PDE via which the
  globaldata array is mapped).

* Reserve SMP_MAXCPU (16) PTDs in the kernel page table for
  per-cpu page table maps.  This eats about 64MB of KVM
  (not 64M of physical memory).

* Adjust get_ptbase() in platform/pc32/i386/pmap.c to use the
  per-cpu map.  This greatly simplifies the tracking required
  to determine when a cpu_invltlb() call is required.

  get_ptbase() is now MPSAFE but the rest of the pmap system
  is not, yet.  This is a big step though.

* Note that because these are PTD mappings and not PTE mappings,
  each process pmap gets its own set, and because processes
  may be threaded the new get_ptbase() still WILL NOT safely
  survive a thread switch.

  On the otherhand, for vkernels, this inherent (process pmap x NCPU)
  pagetable mapping cache should work quite efficiently.  The
  vkernel threads running on different physical cpus will get their
  own page table map cache ptd.
sys/platform/pc32/i386/genassym.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/include/globaldata.h
sys/platform/pc32/include/pmap.h