Subject: Re: remplacing page mappings behind uvm
To: None <bouyer@antioche.eu.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 11/30/2007 21:34:05
> On Fri, Nov 30, 2007 at 09:08:39PM +0900, YAMAMOTO Takashi wrote:
> > > On Fri, Nov 30, 2007 at 12:31:06PM +0900, YAMAMOTO Takashi wrote:
> > > > > Although it'a gross hack, it works for Xeni386. It also works on Xenamd64,
> > > > > up to process exit: it triggers an assersion in pmap_destroy() because
> > > > > pmap_remove() is not called on the hacked memory ranges.
> > > > 
> > > > how about tweaking device pager instead of maintaining these hacks?
> > > 
> > > I did look at this when I implemented these ioctls. It's not so easy.
> > > mmap() on devices will use offsets, but the physical pages are not contigous,
> > > yet xen wants them mapped as a contigous VM area. It can be done but would
> > > mean a driver more complex than the simple ioctl I have now,
> > 
> > isn't an array enough to convert offset -> machine address?
> 
> No, because machine addresses are not contigous, but xen wants a contigous
> virtual adresses. Also, you have to pass a domain id in some way

i meant something like:
	array[(va - start_va) >> PAGE_SIZE].maddr

> > i'm not sure if it's a good idea to make vm deal with it
> > in order to simplify this very uncommon driver.
> 
> pmap_enter_ma() is also used in other places.

what i don't like is the design which overwrites existing unrelated mappings.
not pmap_enter_ma itself.

> > > and to maintain
> > > changes in qemu-dm too (or other hardware emulators when they show up in
> > > Xen). 
> > 
> > does qemu-dm work without modifications currently?
> 
> There are some minor changes, mostly to deal with pkgsrc, and our
> /dev/tap. This part is not touched.

i see.

YAMAMOTO Takashi