Subject: Re: Split pmap_activate() into pmap_activate() and pmap_newvmspace().
To: Chuck Silvers <chuq@chuq.com>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 09/06/2002 17:47:50
On Mon, Sep 02, 2002 at 02:34:39PM -0700, Jason R Thorpe wrote:

 > What I'd like to do is split the two operations into two different calls:

Okay!  I've gone ahead and done this :-)

Actually, what I did is:

	* New pmap interface function:

	void pmap_newvmspace(struct proc *p, struct pmap *oldpm,
	    struct pmap *newpm);

	pmap_newvmspace() switches proc "p" from the pmap "oldpm"
	to the pmap "newpm".  If the process has multiple LWPs,
	each LWP is updated to reflect the new VM space.  If any
	LWP is currently running on a processor, the new VM space
	shall take effect immediately.

	* The pmap interfaces pmap_activate() and pmap_deactivate()
	  have been removed as interface functions.  Some pmaps retain
	  these routines (most notably for MP support), but they are
	  no longer referenced by MI code.

While doing this, I also cleaned up a bunch of random stuff related
to the "pmap activate" operation.  I want to do some more cleaning
to the vax pmap in this area, but "another day".

I've compiled this for every platform except hppa, sh5, x86_64.  I will
test-boot kernels on i386, arm[evbarm], alpha, m68k[hp300], mips[sgimips],
sh3[dreamcast], sparc, sparc64, and vax.

I'll also update the documentation.  Chuq -- this should allow basically
all pmaps to use your switch-to-kernel-pmap-during-teardown-for-exec hack
(although I still prefer a new pmap_remove_all() interface function :-)

Patch is at:

	ftp://ftp.netbsd.org/pub/incoming/thorpej/pmap-vmspace-diff

What do you think?

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>