Subject: Re: leftovers
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Chuck Silvers <chuq@chuq.com>
List: port-xen
Date: 05/29/2005 07:21:54
On Sun, May 29, 2005 at 05:22:59PM +0900, YAMAMOTO Takashi wrote:
> > I was looking into fixing all the pmaps to pay attention to the
> > flags args to pmap_enter() (PR 25640), and I noticed that the xen/i386
> > pmap has a pmap_enter_ma() function that has the same problem but
> > is apparently unused.  is there any reason to keep this around?
> 
> i have a plan to merge pmap_enter_ma and pmap_remap_pages.

ok, good, I hadn't even noticed that there was a third variation.
it looks like it would be worthwhile to merge all three into a common
backend and pass an extra argument to say which one we're doing.
if the backend function is an inline and the extra argument is a constant
then this should result in pretty much the same code generated as having
three separate functions in the source.  I'll leave this to you.

currently pmap_remap_pages() always sets PG_M in the new PTE, which is
a bit odd.  if this is really a good thing to be doing, it would be better
to just have all the caller pass in VM_PROT_WRITE in the flags, to maximize
the commonality with pmap_enter().  I'll also leave that to someone who
knows more what what this function is doing.

-Chuck