* [PATCH v2] misc: Reserve minor for VFIO
@ 2013-12-18 20:56 Alex Williamson
2013-12-18 21:01 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Alex Williamson @ 2013-12-18 20:56 UTC (permalink / raw)
To: linux-kernel; +Cc: gregkh, gnomes, arnd, hpa
VFIO currently allocates it's own dynamic chardev range, reserving the
first minor for the control part of the interface (/dev/vfio/vfio) and
the remainder for VFIO groups (/dev/vfio/$GROUP). This works, but it
doesn't support auto loading. For instance when libvirt checks for
VFIO support it looks for /dev/vfio/vfio, which currently doesn't
exist unless the vfio module is loaded. By converting the control
device to a misc driver and reserving a static minor, we can enable
auto loading.
Reserving the minor is a prerequist to that conversion. Minor 196
is unused by anything currently in the kernel.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
v2: Plea for ack edition
As Alan suspected, there's been no response from device@lanana.org,
so there's probably nobody monitoring it anymore. I've done due
diligence looking at all the callers of misc_register() in linux-next
and cannot find any conflicts with minor 196. If anyone wants to toss
me an ack or sign-off I'll be happy to bring this in through my vfio
tree, otherwise I'd appreciate if someone wants to take it directly.
Thanks!
Documentation/devices.txt | 1 +
include/linux/miscdevice.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 80b7241..10378cc 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -409,6 +409,7 @@ Your cooperation is appreciated.
193 = /dev/d7s SPARC 7-segment display
194 = /dev/zkshim Zero-Knowledge network shim control
195 = /dev/elographics/e2201 Elographics touchscreen E271-2201
+ 196 = /dev/vfio/vfio VFIO userspace driver interface
198 = /dev/sexec Signed executable interface
199 = /dev/scanners/cuecat :CueCat barcode scanner
200 = /dev/net/tun TAP/TUN network device
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index f7eaf2d..3737f72 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -30,6 +30,7 @@
#define STORE_QUEUE_MINOR 155
#define I2O_MINOR 166
#define MICROCODE_MINOR 184
+#define VFIO_MINOR 196
#define TUN_MINOR 200
#define CUSE_MINOR 203
#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-18 20:56 [PATCH v2] misc: Reserve minor for VFIO Alex Williamson
@ 2013-12-18 21:01 ` Greg KH
2013-12-18 21:04 ` Alex Williamson
2013-12-18 22:02 ` H. Peter Anvin
0 siblings, 2 replies; 8+ messages in thread
From: Greg KH @ 2013-12-18 21:01 UTC (permalink / raw)
To: Alex Williamson; +Cc: linux-kernel, gnomes, arnd, hpa
On Wed, Dec 18, 2013 at 01:56:32PM -0700, Alex Williamson wrote:
> VFIO currently allocates it's own dynamic chardev range, reserving the
> first minor for the control part of the interface (/dev/vfio/vfio) and
> the remainder for VFIO groups (/dev/vfio/$GROUP). This works, but it
> doesn't support auto loading. For instance when libvirt checks for
> VFIO support it looks for /dev/vfio/vfio, which currently doesn't
> exist unless the vfio module is loaded. By converting the control
> device to a misc driver and reserving a static minor, we can enable
> auto loading.
>
> Reserving the minor is a prerequist to that conversion. Minor 196
> is unused by anything currently in the kernel.
>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>
> v2: Plea for ack edition
>
> As Alan suspected, there's been no response from device@lanana.org,
> so there's probably nobody monitoring it anymore. I've done due
> diligence looking at all the callers of misc_register() in linux-next
> and cannot find any conflicts with minor 196. If anyone wants to toss
> me an ack or sign-off I'll be happy to bring this in through my vfio
> tree, otherwise I'd appreciate if someone wants to take it directly.
> Thanks!
>
> Documentation/devices.txt | 1 +
> include/linux/miscdevice.h | 1 +
> 2 files changed, 2 insertions(+)
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Feel free to take this through your tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-18 21:01 ` Greg KH
@ 2013-12-18 21:04 ` Alex Williamson
2013-12-18 22:02 ` H. Peter Anvin
1 sibling, 0 replies; 8+ messages in thread
From: Alex Williamson @ 2013-12-18 21:04 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, gnomes, arnd, hpa
On Wed, 2013-12-18 at 13:01 -0800, Greg KH wrote:
> On Wed, Dec 18, 2013 at 01:56:32PM -0700, Alex Williamson wrote:
> > VFIO currently allocates it's own dynamic chardev range, reserving the
> > first minor for the control part of the interface (/dev/vfio/vfio) and
> > the remainder for VFIO groups (/dev/vfio/$GROUP). This works, but it
> > doesn't support auto loading. For instance when libvirt checks for
> > VFIO support it looks for /dev/vfio/vfio, which currently doesn't
> > exist unless the vfio module is loaded. By converting the control
> > device to a misc driver and reserving a static minor, we can enable
> > auto loading.
> >
> > Reserving the minor is a prerequist to that conversion. Minor 196
> > is unused by anything currently in the kernel.
> >
> > Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> > ---
> >
> > v2: Plea for ack edition
> >
> > As Alan suspected, there's been no response from device@lanana.org,
> > so there's probably nobody monitoring it anymore. I've done due
> > diligence looking at all the callers of misc_register() in linux-next
> > and cannot find any conflicts with minor 196. If anyone wants to toss
> > me an ack or sign-off I'll be happy to bring this in through my vfio
> > tree, otherwise I'd appreciate if someone wants to take it directly.
> > Thanks!
> >
> > Documentation/devices.txt | 1 +
> > include/linux/miscdevice.h | 1 +
> > 2 files changed, 2 insertions(+)
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Feel free to take this through your tree.
Thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-18 21:01 ` Greg KH
2013-12-18 21:04 ` Alex Williamson
@ 2013-12-18 22:02 ` H. Peter Anvin
2013-12-18 23:55 ` One Thousand Gnomes
2013-12-20 2:38 ` Konrad Rzeszutek Wilk
1 sibling, 2 replies; 8+ messages in thread
From: H. Peter Anvin @ 2013-12-18 22:02 UTC (permalink / raw)
To: Greg KH, Alex Williamson; +Cc: linux-kernel, gnomes, arnd, Alan Cox
On 12/18/2013 01:01 PM, Greg KH wrote:
> On Wed, Dec 18, 2013 at 01:56:32PM -0700, Alex Williamson wrote:
>> VFIO currently allocates it's own dynamic chardev range, reserving the
>> first minor for the control part of the interface (/dev/vfio/vfio) and
>> the remainder for VFIO groups (/dev/vfio/$GROUP). This works, but it
>> doesn't support auto loading. For instance when libvirt checks for
>> VFIO support it looks for /dev/vfio/vfio, which currently doesn't
>> exist unless the vfio module is loaded. By converting the control
>> device to a misc driver and reserving a static minor, we can enable
>> auto loading.
>>
>> Reserving the minor is a prerequist to that conversion. Minor 196
>> is unused by anything currently in the kernel.
>>
>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
>> ---
>>
>> v2: Plea for ack edition
>>
>> As Alan suspected, there's been no response from device@lanana.org,
>> so there's probably nobody monitoring it anymore. I've done due
>> diligence looking at all the callers of misc_register() in linux-next
>> and cannot find any conflicts with minor 196. If anyone wants to toss
>> me an ack or sign-off I'll be happy to bring this in through my vfio
>> tree, otherwise I'd appreciate if someone wants to take it directly.
>> Thanks!
>>
>> Documentation/devices.txt | 1 +
>> include/linux/miscdevice.h | 1 +
>> 2 files changed, 2 insertions(+)
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
I think Alan Cox was the last person to man <device@lanana.org>... Alan,
are you still doing that? (Otherwise patching the file in the Linux
kernel tree seems eminently sensible... there really isn't any need to
reserve numbers for out-of-tree drivers anymore. Just another perk of
being in-tree.)
-hpa
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-18 22:02 ` H. Peter Anvin
@ 2013-12-18 23:55 ` One Thousand Gnomes
2013-12-19 0:18 ` H. Peter Anvin
2013-12-20 2:38 ` Konrad Rzeszutek Wilk
1 sibling, 1 reply; 8+ messages in thread
From: One Thousand Gnomes @ 2013-12-18 23:55 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Greg KH, Alex Williamson, linux-kernel, arnd
> I think Alan Cox was the last person to man <device@lanana.org>... Alan,
> are you still doing that? (Otherwise patching the file in the Linux
> kernel tree seems eminently sensible... there really isn't any need to
> reserve numbers for out-of-tree drivers anymore. Just another perk of
> being in-tree.)
I am sort of but the mail alias hasn't worked for a long time afaik.
>From the records I have 196 was never issued to anything in tree or
mainstream in recent history so lets make it official ?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-18 23:55 ` One Thousand Gnomes
@ 2013-12-19 0:18 ` H. Peter Anvin
0 siblings, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2013-12-19 0:18 UTC (permalink / raw)
To: One Thousand Gnomes; +Cc: Greg KH, Alex Williamson, linux-kernel, arnd
On 12/18/2013 03:55 PM, One Thousand Gnomes wrote:
>> I think Alan Cox was the last person to man <device@lanana.org>... Alan,
>> are you still doing that? (Otherwise patching the file in the Linux
>> kernel tree seems eminently sensible... there really isn't any need to
>> reserve numbers for out-of-tree drivers anymore. Just another perk of
>> being in-tree.)
>
> I am sort of but the mail alias hasn't worked for a long time afaik.
>
> From the records I have 196 was never issued to anything in tree or
> mainstream in recent history so lets make it official ?
>
I wonder if I have the RCS file from way back when...
-hpa
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-18 22:02 ` H. Peter Anvin
2013-12-18 23:55 ` One Thousand Gnomes
@ 2013-12-20 2:38 ` Konrad Rzeszutek Wilk
2013-12-20 3:31 ` Alex Williamson
1 sibling, 1 reply; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-12-20 2:38 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Greg KH, Alex Williamson, linux-kernel, gnomes, arnd, Alan Cox
On Wed, Dec 18, 2013 at 02:02:38PM -0800, H. Peter Anvin wrote:
> On 12/18/2013 01:01 PM, Greg KH wrote:
> > On Wed, Dec 18, 2013 at 01:56:32PM -0700, Alex Williamson wrote:
> >> VFIO currently allocates it's own dynamic chardev range, reserving the
> >> first minor for the control part of the interface (/dev/vfio/vfio) and
> >> the remainder for VFIO groups (/dev/vfio/$GROUP). This works, but it
> >> doesn't support auto loading. For instance when libvirt checks for
> >> VFIO support it looks for /dev/vfio/vfio, which currently doesn't
> >> exist unless the vfio module is loaded. By converting the control
> >> device to a misc driver and reserving a static minor, we can enable
> >> auto loading.
Why not have libvirt or systemctl try to load vfio first? If it does
not work it would error out.
Or perhaps make the loading of modules in /dev/vfio automatic? I thought
it was based on the name?
> >>
> >> Reserving the minor is a prerequist to that conversion. Minor 196
> >> is unused by anything currently in the kernel.
> >>
> >> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> >> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> >> ---
> >>
> >> v2: Plea for ack edition
> >>
> >> As Alan suspected, there's been no response from device@lanana.org,
> >> so there's probably nobody monitoring it anymore. I've done due
> >> diligence looking at all the callers of misc_register() in linux-next
> >> and cannot find any conflicts with minor 196. If anyone wants to toss
> >> me an ack or sign-off I'll be happy to bring this in through my vfio
> >> tree, otherwise I'd appreciate if someone wants to take it directly.
> >> Thanks!
> >>
> >> Documentation/devices.txt | 1 +
> >> include/linux/miscdevice.h | 1 +
> >> 2 files changed, 2 insertions(+)
> >
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
>
> I think Alan Cox was the last person to man <device@lanana.org>... Alan,
> are you still doing that? (Otherwise patching the file in the Linux
> kernel tree seems eminently sensible... there really isn't any need to
> reserve numbers for out-of-tree drivers anymore. Just another perk of
> being in-tree.)
>
> -hpa
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] misc: Reserve minor for VFIO
2013-12-20 2:38 ` Konrad Rzeszutek Wilk
@ 2013-12-20 3:31 ` Alex Williamson
0 siblings, 0 replies; 8+ messages in thread
From: Alex Williamson @ 2013-12-20 3:31 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: H. Peter Anvin, Greg KH, linux-kernel, gnomes, arnd, Alan Cox
On Thu, 2013-12-19 at 21:38 -0500, Konrad Rzeszutek Wilk wrote:
> On Wed, Dec 18, 2013 at 02:02:38PM -0800, H. Peter Anvin wrote:
> > On 12/18/2013 01:01 PM, Greg KH wrote:
> > > On Wed, Dec 18, 2013 at 01:56:32PM -0700, Alex Williamson wrote:
> > >> VFIO currently allocates it's own dynamic chardev range, reserving the
> > >> first minor for the control part of the interface (/dev/vfio/vfio) and
> > >> the remainder for VFIO groups (/dev/vfio/$GROUP). This works, but it
> > >> doesn't support auto loading. For instance when libvirt checks for
> > >> VFIO support it looks for /dev/vfio/vfio, which currently doesn't
> > >> exist unless the vfio module is loaded. By converting the control
> > >> device to a misc driver and reserving a static minor, we can enable
> > >> auto loading.
>
> Why not have libvirt or systemctl try to load vfio first? If it does
> not work it would error out.
Kay Sievers made a pass through the kernel a while back adding devname
support to a number of drivers to "remove a bunch of pretty useless init
scripts and modprobes from init scripts". So I believe this to be the
preferred approach for systemd. Besides, the init scripts don't know if
the feature is actually being used, so it's a waste to blindly load the
module because you've installed qemu or libvirt.
libvirt also has little interest in loading the module themselves and
frowned on the approach of them loading the module when I proposed it.
VFIO also has scope beyond libvirt, so solving it there only addresses
one use case, granted it's currently the most prevalent use case of
VFIO.
A number of other drivers have adopted the devname model for
auto-loading, kvm, vhost, fuse, dm, tun, ppp, etc, so why not use it
here too?
> Or perhaps make the loading of modules in /dev/vfio automatic? I thought
> it was based on the name?
I don't think I understand the question, this is an effort to do that
for /dev/vfio/vfio. I don't wish to force this module to be statically
loaded into the kernel, it's only used by a small fraction of users. To
support autoloading udev needs to know a static major/minor for the
device entry. It cannot be done with only a name. I posted a companion
patch to this last week that converts VFIO's control interface to a misc
driver with this static minor to accomplish that. Thanks,
Alex
> > >>
> > >> Reserving the minor is a prerequist to that conversion. Minor 196
> > >> is unused by anything currently in the kernel.
> > >>
> > >> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> > >> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> > >> ---
> > >>
> > >> v2: Plea for ack edition
> > >>
> > >> As Alan suspected, there's been no response from device@lanana.org,
> > >> so there's probably nobody monitoring it anymore. I've done due
> > >> diligence looking at all the callers of misc_register() in linux-next
> > >> and cannot find any conflicts with minor 196. If anyone wants to toss
> > >> me an ack or sign-off I'll be happy to bring this in through my vfio
> > >> tree, otherwise I'd appreciate if someone wants to take it directly.
> > >> Thanks!
> > >>
> > >> Documentation/devices.txt | 1 +
> > >> include/linux/miscdevice.h | 1 +
> > >> 2 files changed, 2 insertions(+)
> > >
> > > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > >
> >
> > I think Alan Cox was the last person to man <device@lanana.org>... Alan,
> > are you still doing that? (Otherwise patching the file in the Linux
> > kernel tree seems eminently sensible... there really isn't any need to
> > reserve numbers for out-of-tree drivers anymore. Just another perk of
> > being in-tree.)
> >
> > -hpa
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-12-20 3:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18 20:56 [PATCH v2] misc: Reserve minor for VFIO Alex Williamson
2013-12-18 21:01 ` Greg KH
2013-12-18 21:04 ` Alex Williamson
2013-12-18 22:02 ` H. Peter Anvin
2013-12-18 23:55 ` One Thousand Gnomes
2013-12-19 0:18 ` H. Peter Anvin
2013-12-20 2:38 ` Konrad Rzeszutek Wilk
2013-12-20 3:31 ` Alex Williamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox