Go to file
thorpej a8f80ad4fd Fix a bogosity apparently inherited from when the Utah 4.3BSD code base
was converted to use Mach VM for Net2/4.4BSD.  The user segment table
pointer was originally stored in the PCB.  When Mach VM came along,
however, it was also stored in the pmap, and loaded into the PCB in
pmap_activate().  pmap_activate() would then note that the PCB's USTP
was now in sync with the pmap's USTP, and the low-level context switch
code would use the value from the PCB.

However, pmap_activate() would also load the hardware MMU context if
the pmap was the current pmap (or, in the case where pmaps can be shared,
such as in NetBSD, if the proc was the current proc).  The low-level
context switch code would then reload the hardware _again_ using the
USTP from the PCB.

However, the optimization of not calling pmap_activate() if "stchanged"
was false ended up causing some processes to use stale USTP values from
the PCB when the low-level context switch code reloaded the hardware!
This was noticed by using a real vfork(2) (which worked for some time
before failing, surprisingly!)

Since I'm hard pressed to find any real optimization here (since the
hardware was always reloaded once, sometimes twice!), the code now always
calls pmap_activate(), which uses the correct USTP value (the one in the
pmap).  The PCB's USTP is now ignored, and should eventually be g/c'd.

Another optimization can actually be performed, and I have added a comment
describing what it is, but have not yet implemented it.

Also note that most of the loadustp() functions where actually incomplete.
This has been corrected.  These functions should probably be split up into
MMU-specific operations, and called indirectly, rather than doing constant
run-time decision making based on values that will never change during the
course of a boot's lifetime.
1998-01-05 23:16:21 +00:00
bin Make lint(1) happy. 1998-01-04 23:53:58 +00:00
distrib regenerate 1998-01-05 09:26:17 +00:00
etc /usr/{src,obj,pkgsrc} -> root:wsrc, 0775 1998-01-03 06:00:33 +00:00
games don't clobber /var/games/robots_roll on install; from 1997-12-18 05:56:18 +00:00
gnu RCS Id police 1998-01-05 22:00:34 +00:00
include Update for __vfork14(). 1998-01-05 06:14:51 +00:00
lib document net.inet.ip.anonport{min,max} 1998-01-05 09:59:03 +00:00
libexec RCS Id police 1998-01-05 22:00:34 +00:00
regress add regression tests for some m4 problems I recently found relating 1997-12-30 23:30:48 +00:00
sbin RCS Id police 1998-01-05 22:00:34 +00:00
share Document new queue access methods. 1998-01-05 06:28:04 +00:00
sys Fix a bogosity apparently inherited from when the Utah 4.3BSD code base 1998-01-05 23:16:21 +00:00
usr.bin RCS Id police 1998-01-05 22:00:34 +00:00
usr.sbin document net.inet.ip.anonport{min,max} 1998-01-05 09:59:03 +00:00
Makefile Make the "build" target depend on "beforeinstall", ensuring that all 1997-10-27 18:06:39 +00:00