Subject: Re: remplacing page mappings behind uvm
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 11/30/2007 17:59:52
On Sat, Dec 01, 2007 at 01:45:05AM +0900, YAMAMOTO Takashi wrote:
> > Yes, but in Xen2. They're not used in exactly the same way in Xen3.
> 
> can you explain how differently they are used?
> it seems quite similar to me.

I think in Xen2, and Xen3 paravirtualized, these mapping are used only
to load the domains's kernel. They are unmapped once the domU is
running. In xen3-hvm these persist as long as the domain exists, and
may be remapped to different physical memory area over time.

Now, I admit the function of the ioctl itself does the same thing.

> > But this doesn't helps us, because it's mmapped before calling
> > IOCTL_PRIVCMD_MMAP*. AFAIK we have to return a valid page address at the
> > time a device mmap callback is called.
> 
> are you talking about d_mmap calls in udv_attach?

Yes, probably. In fact I looked at some device's mmap routine, and saw they
were either returning a pfn or an error.

> we can easily tweak the api.

This would mean changing all device's mmap functions, isn't ?
I'd prefer to see support for custom mmap in /kern ...

Now that I'm thinking about it, it should be possible to create a
uvm_object backed mapping in the ioctl calls, isn't it ?

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 26 ans d'experience feront toujours la difference
--