Christoph Egger | 2 Sep 16:00 2010
Picon
Picon

adding /dev/xen/gnttab


Hi!

For gnttab support a new device file is needed for a new set of ioctl()'s.
Attached patch adds /dev/xen/gnttab.
I would like to use the opportunity to move xen device files
into /dev/xen/. The patch keeps the existing ones for backward
compatibility.

Comments?

Christoph
Attachment (xen_makedev.diff): text/x-diff, 1256 bytes
Manuel Bouyer | 2 Sep 16:33 2010

Re: adding /dev/xen/gnttab

On Thu, Sep 02, 2010 at 04:00:44PM +0200, Christoph Egger wrote:
> 
> Hi!
> 
> For gnttab support a new device file is needed for a new set of ioctl()'s.

Can you explain what feature needs this gnttab device ?

> Attached patch adds /dev/xen/gnttab.

I see only patch for /dev/MAKEDEV, did you forget to
attach the diff for this device support ?

> I would like to use the opportunity to move xen device files
> into /dev/xen/. The patch keeps the existing ones for backward
> compatibility.

Looks good to me.

--

-- 
Manuel Bouyer <bouyer <at> antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

Christoph Egger | 2 Sep 17:16 2010
Picon
Picon

Re: adding /dev/xen/gnttab


> On Thu, Sep 02, 2010 at 04:00:44PM +0200, Christoph Egger wrote:
> > 
> > Hi!
> > 
> > For gnttab support a new device file is needed for a new set
> > of ioctl()'s.
> 
> Can you explain what feature needs this gnttab device ?

Look at xentools33/patches/patch-aj

gnttab is needed
a) to make xen tools compile
b) for the grant table hypercalls in
   sys/arch/xen/include/xen3-public/grant_table.h used by
   xen tools
c) for pci passthrough into HVM/PV guests
d) for PV drivers in HVM guests
d) for other things I'm not aware of

grant table is a feature that allows a guest to
give/remove permissions to/from given memory pages
to be accessed by an other guest either read-only
or read-write. The 'other guest' may be the Dom0 or
a backend domain.

BTW: Xen people are about rewriting the python code in C.
'xl' is written in C and will replace 'xm'.
You say, you don't know python and that hold you back from
(Continue reading)

Manuel Bouyer | 2 Sep 17:40 2010

Re: adding /dev/xen/gnttab

On Thu, Sep 02, 2010 at 05:16:12PM +0200, Christoph Egger wrote:
> 
> > On Thu, Sep 02, 2010 at 04:00:44PM +0200, Christoph Egger wrote:
> > > 
> > > Hi!
> > > 
> > > For gnttab support a new device file is needed for a new set
> > > of ioctl()'s.
> > 
> > Can you explain what feature needs this gnttab device ?
> 
> Look at xentools33/patches/patch-aj
> 
> gnttab is needed
> a) to make xen tools compile
> b) for the grant table hypercalls in
>    sys/arch/xen/include/xen3-public/grant_table.h used by
>    xen tools
> c) for pci passthrough into HVM/PV guests
> d) for PV drivers in HVM guests
> d) for other things I'm not aware of

ok, thanks 

> [...]
> > > Attached patch adds /dev/xen/gnttab.
> > 
> > I see only patch for /dev/MAKEDEV, did you forget to
> > attach the diff for this device support ?
> 
(Continue reading)

Jean-Yves Migeon | 2 Sep 18:14 2010
Picon

Re: adding /dev/xen/gnttab


On Thu, 02 Sep 2010 17:16:12 +0200, "Christoph Egger"
<Christoph_Egger <at> gmx.de> wrote:
> Thanks. Oh, do you mind if I add privcmd to /dev/xen/ as well?
> The kernel code to use /dev/xen/privcmd should be easy to adopt
> and will finally allow to remove kernfs.

While I welcome this move, I do not think it can be done easily, as there
are entries created dynamically under kernfs that cannot (yet?) be
manageable through /dev.

Anyway, if you want to commit (both upstream and in pkgsrc) preliminary
support for /dev/xen nodes within xentools (something "like check for
existence, then fallback to /kern/xen"), you have my vote :)

Many thanks for working on it, I never found enough time to get something
committed.

--

-- 
Jean-Yves Migeon
jeanyves.migeon <at> free.fr

Thor Lancelot Simon | 2 Sep 23:55 2010
Picon

Re: adding /dev/xen/gnttab

On Thu, Sep 02, 2010 at 06:14:26PM +0200, Jean-Yves Migeon wrote:
> 
> On Thu, 02 Sep 2010 17:16:12 +0200, "Christoph Egger"
> <Christoph_Egger <at> gmx.de> wrote:
> > Thanks. Oh, do you mind if I add privcmd to /dev/xen/ as well?
> > The kernel code to use /dev/xen/privcmd should be easy to adopt
> > and will finally allow to remove kernfs.
> 
> While I welcome this move, I do not think it can be done easily, as there
> are entries created dynamically under kernfs that cannot (yet?) be
> manageable through /dev.

The obvious solution is to remove the xen nodes from kernfs, and
add a xenfs and mount it at /dev/xen, no?

Thor

Manuel Bouyer | 3 Sep 00:05 2010

Re: adding /dev/xen/gnttab

On Thu, Sep 02, 2010 at 05:55:33PM -0400, Thor Lancelot Simon wrote:
> On Thu, Sep 02, 2010 at 06:14:26PM +0200, Jean-Yves Migeon wrote:
> > 
> > On Thu, 02 Sep 2010 17:16:12 +0200, "Christoph Egger"
> > <Christoph_Egger <at> gmx.de> wrote:
> > > Thanks. Oh, do you mind if I add privcmd to /dev/xen/ as well?
> > > The kernel code to use /dev/xen/privcmd should be easy to adopt
> > > and will finally allow to remove kernfs.
> > 
> > While I welcome this move, I do not think it can be done easily, as there
> > are entries created dynamically under kernfs that cannot (yet?) be
> > manageable through /dev.
> 
> The obvious solution is to remove the xen nodes from kernfs, and
> add a xenfs and mount it at /dev/xen, no?

how is it better than using /kern ?

--

-- 
Manuel Bouyer <bouyer <at> antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

Jean-Yves Migeon | 3 Sep 00:08 2010
Picon

Re: adding /dev/xen/gnttab

On 02.09.2010 23:55, Thor Lancelot Simon wrote:
> On Thu, Sep 02, 2010 at 06:14:26PM +0200, Jean-Yves Migeon wrote:
>> While I welcome this move, I do not think it can be done easily, as there
>> are entries created dynamically under kernfs that cannot (yet?) be
>> manageable through /dev.
> 
> The obvious solution is to remove the xen nodes from kernfs, and
> add a xenfs and mount it at /dev/xen, no?

You mean something like ptyfs? That would effectively be a solution; I
did not think about it.

--

-- 
Jean-Yves Migeon
jeanyves.migeon <at> free.fr

Manuel Bouyer | 3 Sep 00:50 2010

Re: adding /dev/xen/gnttab

On Thu, Sep 02, 2010 at 06:19:08PM -0400, Thor Lancelot Simon wrote:
> On Fri, Sep 03, 2010 at 12:05:59AM +0200, Manuel Bouyer wrote:
> >
> > > The obvious solution is to remove the xen nodes from kernfs, and
> > > add a xenfs and mount it at /dev/xen, no?
> > 
> > how is it better than using /kern ?
> 
> Perhaps it's easier to provide the nodes xentools want, where it wants
> them, without remounting all of /kern there or making a gigantic
> symlink forest...

We have some control on xentools; I see no problems intructing him to use
files from /kern (righ now, no remount or extra symlink is needed to have it
working). Maintainig another filesystem seems really overkill to me.

--

-- 
Manuel Bouyer <bouyer <at> antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

Thor Lancelot Simon | 3 Sep 00:19 2010
Picon

Re: adding /dev/xen/gnttab

On Fri, Sep 03, 2010 at 12:05:59AM +0200, Manuel Bouyer wrote:
>
> > The obvious solution is to remove the xen nodes from kernfs, and
> > add a xenfs and mount it at /dev/xen, no?
> 
> how is it better than using /kern ?

Perhaps it's easier to provide the nodes xentools want, where it wants
them, without remounting all of /kern there or making a gigantic
symlink forest...

--

-- 
Thor Lancelot Simon	                               tls <at> rek.tjls.com
  "All of my opinions are consistent, but I cannot present them all
   at once."	-Jean-Jacques Rousseau, On The Social Contract


Gmane