Skip to contentSkip to conversation

pvusb drivers for pvops 2.6.32.x kernel

DISCUSSION Pasi Kärkkäinen 5 participants 14 messages Jan 3, 2011 – Feb 8, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hello,

Jeremy: See the included patch. If it's OK it'd be nice to get it into xen/stable-2.6.32.x branch.

Thanks Nathanael!

-- Pasi

----- Forwarded message from Nathanael Rensen <[email protected]> -----

From: Nathanael Rensen <[email protected]>
To: Pasi Kärkkäinen <[email protected]>
Cc: [email protected]
Date: Mon, 3 Jan 2011 19:32:23 +0800
Subject: Re: pvusb for pvops

Quoted 33 lines · Nathanael Rensen
Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Nathanael Rensen

Hi Noboru,

In case it is helpful ...

I've attached a diff that adds the pvusb drivers to the debian squeeze 2.6.32 pvops kernel.
So far I've only tested with a USB drive on xen 4.0.1 between debian squeeze pvops dom0 and
debian squeeze pvops domU.

Quoted 6 lines

The diff is based on the SLES SP1 diffs posted here:
  http://code.google.com/p/gentoo-xen-kernel/downloads/list
It almost applies cleanly to xen/stable-2.6.32.x except for the patch to include/xen/interface/io/ring.h which is not required for xen/stable-2.6.32.x. I haven't tested the xen/stable-2.6.32.x kernel though.

Quoted 8 lines

Great, thanks!
Is it OK to forward this email to xen-devel mailinglist?

Btw did you check from novell's kernel git tree if there has been fixes to the pvusb code after that patch on code.google.com was posted?

-- Pasi

For sure, you're welcome to forward it, but maybe hold off a bit because I've refactored the pvusb frontend code to be consistent with the way the other frontend drivers are within the pvops tree. I'll also take a look at Novell's tree to check for updates.

Quoted 5 lines

I'll do some testing on a kernel built from the pvops stable-2.6.32.x tree and send an updated diff against that tree in the next couple of days.

Nathanael

I've attached an updated diff against the pvops xen/stable-2.6.32.x tree. I've tested by attaching an af9015 USB TV tuner to a pvops domu from a pvops dom0 and recording a few hours of TV.

I also tried to attach various USB devices to a WinXP domu with GPLPV drivers, but the domu kept crashing. That needs more investigation, but I suspect a problem with the GPLPV drivers. I'm keen for that to be fixed, but I don't have time immediately to dig into it.

I took a look at the patches at
http://gitorious.org/opensuse/kernel-source/trees/SLE11-SP1/patches.xen
and as far as I can tell, everything that relates to pvusb is included in the attached patch.

Nathanael

----- End forwarded message -----

drivers/usb/host/Kconfig +13 -0
index 9b43b22..498d8c5 100644
@@ -381,3 +381,16 @@ config USB_HWA_HCD
 
 	  To compile this driver a module, choose M here: the module
 	  will be called "hwa-hc".
+
+config XEN_USB_FRONTEND
+        tristate "Xen pvusb device frontend driver"
+        depends on XEN
+        select XEN_XENBUS_FRONTEND
+        default y
+        help
+          The pvusb device frontend driver allows the kernel to
+          access usb devices exported exported by a virtual
+          machine containing a physical usb device driver. The
+          frontend driver is intended for unprivileged guest domains;
+          if you are compiling a kernel for a Xen guest, you almost
+          certainly want to enable this.
drivers/usb/host/Makefile +1 -0
index f58b249..bc46412 100644
@@ -32,3 +32,4 @@ obj-$(CONFIG_USB_U132_HCD)	+= u132-hcd.o
 obj-$(CONFIG_USB_R8A66597_HCD)	+= r8a66597-hcd.o
 obj-$(CONFIG_USB_ISP1760_HCD)	+= isp1760.o
 obj-$(CONFIG_USB_HWA_HCD)	+= hwa-hc.o
+obj-$(CONFIG_XEN_USB_FRONTEND)  += xen-usbfront.o
drivers/usb/host/xen-usbfront.c new file +1740 -0

1,740 lines not on this page · raw message

drivers/xen/Kconfig +8 -1
index fa9982e..b4a5665 100644
@@ -51,7 +51,14 @@ config XEN_BLKDEV_BACKEND
 	  block devices to other guests via a high-performance shared-memory
 	  interface.
 
- 
+config XEN_USB_BACKEND
+	tristate "PVUSB backend driver"
+	depends on XEN_BACKEND && USB
+	help
+	  The pvusb backend driver allows the kernel to export its
+	  usb to other guests via a high-performance shared-memory
+	  interface.
+
 config XEN_BLKDEV_TAP
 	tristate "Block-device tap backend driver"
 	depends on XEN_BACKEND && BLOCK
drivers/xen/Makefile +1 -0
index ef1ea63..d64d2c6 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= pciback/
 obj-$(CONFIG_XEN_BLKDEV_BACKEND)	+= blkback/
 obj-$(CONFIG_XEN_BLKDEV_TAP)            += blktap/
 obj-$(CONFIG_XEN_NETDEV_BACKEND)	+= netback/
+obj-$(CONFIG_XEN_USB_BACKEND)		+= usbback/
 obj-$(CONFIG_XENFS)			+= xenfs/
 obj-$(CONFIG_XEN_SYS_HYPERVISOR)	+= sys-hypervisor.o
 obj-$(CONFIG_XEN_MCE)		+= mce.o
drivers/xen/usbback/Makefile new file +4 -0
new file mode 100644
index 0000000..a7548cb
@@ -0,0 +1,4 @@
+obj-$(CONFIG_XEN_USB_BACKEND) := usbbk.o
+
+usbbk-y   := usbstub.o xenbus.o interface.o usbback.o
+
drivers/xen/usbback/interface.c new file +250 -0

250 lines not on this page · raw message

drivers/xen/usbback/usbback.c new file +1194 -0

964 lines not on this page · raw message

drivers/xen/usbback/usbback.h new file +182 -0

182 lines not on this page · raw message

drivers/xen/usbback/usbstub.c new file +325 -0

325 lines not on this page · raw message

drivers/xen/usbback/xenbus.c new file +338 -0

338 lines not on this page · raw message

include/xen/interface/io/usbif.h new file +151 -0

151 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 6 lines · Pasi Kärkkäinen

Hello,

Jeremy: See the included patch. If it's OK it'd be nice to get it into xen/stable-2.6.32.x branch.

Thanks Nathanael!

Yes thanks!

I think the correct path for this functionality is to first get it accepted into the upstream kernel by working with the USB subsystem maintainer+list, fixing the issue arising from their review etc.

The stuff necessary to get the frontend upstream has been upstream for ages. For the backend basic dom0 boot support is in 2.6.37 and the generic scaffolding for backends is currently in linux-next (via Konrad's tree) and is intended to be in the next merge window.

I think the backend just looks like a regular USB driver to the host system so it probably belongs in drivers/usb/<something>/xen-usbback/ and not drivers/xen. (I'm not sure what the <something> should be, perhaps "misc").

IIRC when the PV USB drivers were originally submitted there was no toolstack support included. Has this since been implemented? Seems to be missing from libxl at least. Is someone looking into this?

Ian.

Quoted 70 lines

-- Pasi

----- Forwarded message from Nathanael Rensen <[email protected]> -----

From: Nathanael Rensen <[email protected]>
To: Pasi Kärkkäinen <[email protected]>
Cc: [email protected]
Date: Mon, 3 Jan 2011 19:32:23 +0800
Subject: Re: pvusb for pvops

Quoted 33 lines · Nathanael Rensen
Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Nathanael Rensen

Hi Noboru,

In case it is helpful ...

I've attached a diff that adds the pvusb drivers to the debian squeeze 2.6.32 pvops kernel.
So far I've only tested with a USB drive on xen 4.0.1 between debian squeeze pvops dom0 and
debian squeeze pvops domU.

Quoted 6 lines

The diff is based on the SLES SP1 diffs posted here:
http://code.google.com/p/gentoo-xen-kernel/downloads/list
It almost applies cleanly to xen/stable-2.6.32.x except for the patch to include/xen/interface/io/ring.h which is not required for xen/stable-2.6.32.x. I haven't tested the xen/stable-2.6.32.x kernel though.

Quoted 8 lines

Great, thanks!
Is it OK to forward this email to xen-devel mailinglist?

Btw did you check from novell's kernel git tree if there has been fixes to the pvusb code after that patch on code.google.com was posted?

-- Pasi

For sure, you're welcome to forward it, but maybe hold off a bit because I've refactored the pvusb frontend code to be consistent with the way the other frontend drivers are within the pvops tree. I'll also take a look at Novell's tree to check for updates.

Quoted 5 lines

I'll do some testing on a kernel built from the pvops stable-2.6.32.x tree and send an updated diff against that tree in the next couple of days.

Nathanael

I've attached an updated diff against the pvops xen/stable-2.6.32.x tree. I've tested by attaching an af9015 USB TV tuner to a pvops domu from a pvops dom0 and recording a few hours of TV.

I also tried to attach various USB devices to a WinXP domu with GPLPV drivers, but the domu kept crashing. That needs more investigation, but I suspect a problem with the GPLPV drivers. I'm keen for that to be fixed, but I don't have time immediately to dig into it.

I took a look at the patches at
http://gitorious.org/opensuse/kernel-source/trees/SLE11-SP1/patches.xen
and as far as I can tell, everything that relates to pvusb is included in the attached patch.

Nathanael

----- End forwarded message -----

#2 lore raw
Quoted 10 lines · Ian Campbell
Quoted 6 lines · Pasi Kärkkäinen

Hello,

Jeremy: See the included patch. If it's OK it'd be nice to get it into xen/stable-2.6.32.x branch.

Thanks Nathanael!

Yes thanks!

Added Nathanael to CC, I forgot him earlier.. doh.

Quoted 4 lines

I think the correct path for this functionality is to first get it accepted into the upstream kernel by working with the USB subsystem maintainer+list, fixing the issue arising from their review etc.

Ok.

Quoted 10 lines

The stuff necessary to get the frontend upstream has been upstream for ages. For the backend basic dom0 boot support is in 2.6.37 and the generic scaffolding for backends is currently in linux-next (via Konrad's tree) and is intended to be in the next merge window.

I think the backend just looks like a regular USB driver to the host system so it probably belongs in drivers/usb/<something>/xen-usbback/ and not drivers/xen. (I'm not sure what the <something> should be, perhaps "misc").

Yeah, maybe the USB maintainers can suggest proper location.

Quoted 4 lines

IIRC when the PV USB drivers were originally submitted there was no toolstack support included. Has this since been implemented? Seems to be missing from libxl at least. Is someone looking into this?

Xen 4.0.0 added pvusb toolstack support to xm/xend.

This driver is ported (by Nathanael) from Novell SLES11SP1 2.6.32 Xenlinux kernel, where it works with xm/xend.

Some info here:
http://wiki.xen.org/xenwiki/XenUSBPassthrough

and:
http://wiki.xen.org/xenwiki/Xen4.0

-- Pasi

Quoted 74 lines

Ian.

Quoted 70 lines

-- Pasi

----- Forwarded message from Nathanael Rensen <[email protected]> -----

From: Nathanael Rensen <[email protected]>
To: Pasi Kärkkäinen <[email protected]>
Cc: [email protected]
Date: Mon, 3 Jan 2011 19:32:23 +0800
Subject: Re: pvusb for pvops

Quoted 33 lines · Nathanael Rensen
Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Nathanael Rensen

Hi Noboru,

In case it is helpful ...

I've attached a diff that adds the pvusb drivers to the debian squeeze 2.6.32 pvops kernel.
So far I've only tested with a USB drive on xen 4.0.1 between debian squeeze pvops dom0 and
debian squeeze pvops domU.

Quoted 6 lines

The diff is based on the SLES SP1 diffs posted here:
http://code.google.com/p/gentoo-xen-kernel/downloads/list
It almost applies cleanly to xen/stable-2.6.32.x except for the patch to include/xen/interface/io/ring.h which is not required for xen/stable-2.6.32.x. I haven't tested the xen/stable-2.6.32.x kernel though.

Quoted 8 lines

Great, thanks!
Is it OK to forward this email to xen-devel mailinglist?

Btw did you check from novell's kernel git tree if there has been fixes to the pvusb code after that patch on code.google.com was posted?

-- Pasi

For sure, you're welcome to forward it, but maybe hold off a bit because I've refactored the pvusb frontend code to be consistent with the way the other frontend drivers are within the pvops tree. I'll also take a look at Novell's tree to check for updates.

Quoted 5 lines

I'll do some testing on a kernel built from the pvops stable-2.6.32.x tree and send an updated diff against that tree in the next couple of days.

Nathanael

I've attached an updated diff against the pvops xen/stable-2.6.32.x tree. I've tested by attaching an af9015 USB TV tuner to a pvops domu from a pvops dom0 and recording a few hours of TV.

I also tried to attach various USB devices to a WinXP domu with GPLPV drivers, but the domu kept crashing. That needs more investigation, but I suspect a problem with the GPLPV drivers. I'm keen for that to be fixed, but I don't have time immediately to dig into it.

I took a look at the patches at
http://gitorious.org/opensuse/kernel-source/trees/SLE11-SP1/patches.xen
and as far as I can tell, everything that relates to pvusb is included in the attached patch.

Nathanael

----- End forwarded message -----

#3 lore raw
Quoted 4 lines · Ian Campbell

I think the correct path for this functionality is to first get it accepted into the upstream kernel by working with the USB subsystem maintainer+list, fixing the issue arising from their review etc.

I'm happy to have a shot at that. I don't imagine it will be a quick process so in the meantime I think there is value in supporting pvusb in stable/2.6.32.x to encourage people to test and identify issues, and also to make it easier to track the maintenance.

Quoted 9 lines

The stuff necessary to get the frontend upstream has been upstream for ages. For the backend basic dom0 boot support is in 2.6.37 and the generic scaffolding for backends is currently in linux-next (via Konrad's tree) and is intended to be in the next merge window.

I think the backend just looks like a regular USB driver to the host system so it probably belongs in drivers/usb/<something>/xen-usbback/ and not drivers/xen. (I'm not sure what the <something> should be, perhaps "misc").

I agree that the frontend driver looks like a regular USB host controller driver and belongs in drivers/usb/host. From the dom0 perspective the backend driver is a consumer of USB services rather than a provider so my inclination is that the proper place for the backend is drivers/xen along with blkback, netback and pciback. Much the same way as I would expect to find a USB TV tuner driver in drivers/media rather than drivers/usb. I would prefer to remain consistent with the model established by the block, net and pci drivers, but I am happy to adopt whatever convention is acceptable to upstream.

Nathanael

Quoted 72 lines

Ian.

Quoted 69 lines
Quoted 67 lines

----- Forwarded message from Nathanael Rensen <[email protected]> -----

From: Nathanael Rensen <[email protected]>
To: Pasi Kärkkäinen <[email protected]>
Cc: [email protected]
Date: Mon, 3 Jan 2011 19:32:23 +0800
Subject: Re: pvusb for pvops

Quoted 33 lines · Nathanael Rensen
Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Nathanael Rensen

Hi Noboru,

In case it is helpful ...

I've attached a diff that adds the pvusb drivers to the debian squeeze 2.6.32 pvops kernel.
So far I've only tested with a USB drive on xen 4.0.1 between debian squeeze pvops dom0 and
debian squeeze pvops domU.

Quoted 6 lines

The diff is based on the SLES SP1 diffs posted here:
  http://code.google.com/p/gentoo-xen-kernel/downloads/list
It almost applies cleanly to xen/stable-2.6.32.x except for the patch to include/xen/interface/io/ring.h which is not required for xen/stable-2.6.32.x. I haven't tested the xen/stable-2.6.32.x kernel though.

Quoted 8 lines

Great, thanks!
Is it OK to forward this email to xen-devel mailinglist?

Btw did you check from novell's kernel git tree if there has been fixes to the pvusb code after that patch on code.google.com was posted?

-- Pasi

For sure, you're welcome to forward it, but maybe hold off a bit because I've refactored the pvusb frontend code to be consistent with the way the other frontend drivers are within the pvops tree. I'll also take a look at Novell's tree to check for updates.

Quoted 5 lines

I'll do some testing on a kernel built from the pvops stable-2.6.32.x tree and send an updated diff against that tree in the next couple of days.

Nathanael

I've attached an updated diff against the pvops xen/stable-2.6.32.x tree. I've tested by attaching an af9015 USB TV tuner to a pvops domu from a pvops dom0 and recording a few hours of TV.

I also tried to attach various USB devices to a WinXP domu with GPLPV drivers, but the domu kept crashing. That needs more investigation, but I suspect a problem with the GPLPV drivers. I'm keen for that to be fixed, but I don't have time immediately to dig into it.

I took a look at the patches at
http://gitorious.org/opensuse/kernel-source/trees/SLE11-SP1/patches.xen
and as far as I can tell, everything that relates to pvusb is included in the attached patch.

Nathanael

----- End forwarded message -----

#4 lore raw
Quoted 11 lines · Nathanael Rensen
Quoted 4 lines · Ian Campbell

I think the correct path for this functionality is to first get it accepted into the upstream kernel by working with the USB subsystem maintainer+list, fixing the issue arising from their review etc.

I'm happy to have a shot at that. I don't imagine it will be a quick process so in the meantime I think there is value in supporting pvusb in stable/2.6.32.x to encourage people to test and identify issues, and also to make it easier to track the maintenance.

Yeah, at least earlier Jeremy said he's happy to take most patches for xen/stable-2.6.32.x :)

Quoted 10 lines
Quoted 9 lines

The stuff necessary to get the frontend upstream has been upstream for ages. For the backend basic dom0 boot support is in 2.6.37 and the generic scaffolding for backends is currently in linux-next (via Konrad's tree) and is intended to be in the next merge window.

I think the backend just looks like a regular USB driver to the host system so it probably belongs in drivers/usb/<something>/xen-usbback/ and not drivers/xen. (I'm not sure what the <something> should be, perhaps "misc").

Quoted 11 lines

I agree that the frontend driver looks like a regular USB host controller driver and belongs in drivers/usb/host. From the dom0 perspective the backend driver is a consumer of USB services rather than a provider so my inclination is that the proper place for the backend is drivers/xen along with blkback, netback and pciback. Much the same way as I would expect to find a USB TV tuner driver in drivers/media rather than drivers/usb. I would prefer to remain consistent with the model established by the block, net and pci drivers, but I am happy to adopt whatever convention is acceptable to upstream.

Something I noticed about the pvusb backend..
Should the name of the driver be xen-usbbk instead of just usbbk ?

The other backend driver modules seem to have xen- prefix.

-- Pasi

Quoted 74 lines

Nathanael

Quoted 72 lines

Ian.

Quoted 69 lines
Quoted 67 lines

----- Forwarded message from Nathanael Rensen <[email protected]> -----

From: Nathanael Rensen <[email protected]>
To: Pasi Kärkkäinen <[email protected]>
Cc: [email protected]
Date: Mon, 3 Jan 2011 19:32:23 +0800
Subject: Re: pvusb for pvops

Quoted 33 lines · Nathanael Rensen
Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Nathanael Rensen

Hi Noboru,

In case it is helpful ...

I've attached a diff that adds the pvusb drivers to the debian squeeze 2.6.32 pvops kernel.
So far I've only tested with a USB drive on xen 4.0.1 between debian squeeze pvops dom0 and
debian squeeze pvops domU.

Quoted 6 lines

The diff is based on the SLES SP1 diffs posted here:
  http://code.google.com/p/gentoo-xen-kernel/downloads/list
It almost applies cleanly to xen/stable-2.6.32.x except for the patch to include/xen/interface/io/ring.h which is not required for xen/stable-2.6.32.x. I haven't tested the xen/stable-2.6.32.x kernel though.

Quoted 8 lines

Great, thanks!
Is it OK to forward this email to xen-devel mailinglist?

Btw did you check from novell's kernel git tree if there has been fixes to the pvusb code after that patch on code.google.com was posted?

-- Pasi

For sure, you're welcome to forward it, but maybe hold off a bit because I've refactored the pvusb frontend code to be consistent with the way the other frontend drivers are within the pvops tree. I'll also take a look at Novell's tree to check for updates.

Quoted 5 lines

I'll do some testing on a kernel built from the pvops stable-2.6.32.x tree and send an updated diff against that tree in the next couple of days.

Nathanael

I've attached an updated diff against the pvops xen/stable-2.6.32.x tree. I've tested by attaching an af9015 USB TV tuner to a pvops domu from a pvops dom0 and recording a few hours of TV.

I also tried to attach various USB devices to a WinXP domu with GPLPV drivers, but the domu kept crashing. That needs more investigation, but I suspect a problem with the GPLPV drivers. I'm keen for that to be fixed, but I don't have time immediately to dig into it.

I took a look at the patches at
http://gitorious.org/opensuse/kernel-source/trees/SLE11-SP1/patches.xen
and as far as I can tell, everything that relates to pvusb is included in the attached patch.

Nathanael

----- End forwarded message -----

#5 lore raw
Quoted 6 lines · Pasi Kärkkäinen

Something I noticed about the pvusb backend..
Should the name of the driver be xen-usbbk instead of just usbbk ?

The other backend driver modules seem to have xen- prefix.

-- Pasi

Good point - although I think xen-usbback would better match xen-blkback, xen-netback, xen-pciback.

For consistency the config options should probably be CONFIG_XEN_USBDEV_BACKEND and CONFIG_XEN_USBDEV_FRONTEND (the previous patch had CONFIG_XEN_USB_...).

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Nathanael

drivers/usb/host/Kconfig +13 -0
index 9b43b22..b77ddfb 100644
@@ -381,3 +381,16 @@ config USB_HWA_HCD
 
 	  To compile this driver a module, choose M here: the module
 	  will be called "hwa-hc".
+
+config XEN_USBDEV_FRONTEND
+        tristate "Xen pvusb device frontend driver"
+        depends on XEN && USB
+        select XEN_XENBUS_FRONTEND
+        default m
+        help
+          The pvusb device frontend driver allows the kernel to
+          access usb devices exported exported by a virtual
+          machine containing a physical usb device driver. The
+          frontend driver is intended for unprivileged guest domains;
+          if you are compiling a kernel for a Xen guest, you almost
+          certainly want to enable this.
drivers/usb/host/Makefile +1 -0
index f58b249..be2f0ff 100644
@@ -32,3 +32,4 @@ obj-$(CONFIG_USB_U132_HCD)	+= u132-hcd.o
 obj-$(CONFIG_USB_R8A66597_HCD)	+= r8a66597-hcd.o
 obj-$(CONFIG_USB_ISP1760_HCD)	+= isp1760.o
 obj-$(CONFIG_USB_HWA_HCD)	+= hwa-hc.o
+obj-$(CONFIG_XEN_USBDEV_FRONTEND)  += xen-usbfront.o
drivers/usb/host/xen-usbfront.c new file +1741 -0

1,741 lines not on this page · raw message

drivers/xen/Kconfig +8 -1
index fa9982e..98a97b03 100644
@@ -51,7 +51,14 @@ config XEN_BLKDEV_BACKEND
 	  block devices to other guests via a high-performance shared-memory
 	  interface.
 
- 
+config XEN_USBDEV_BACKEND
+	tristate "PVUSB backend driver"
+	depends on XEN_BACKEND && USB
+	help
+	  The pvusb backend driver allows the kernel to export its
+	  usb to other guests via a high-performance shared-memory
+	  interface.
+
 config XEN_BLKDEV_TAP
 	tristate "Block-device tap backend driver"
 	depends on XEN_BACKEND && BLOCK
drivers/xen/Makefile +1 -0
index ef1ea63..ebce2b3 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= pciback/
 obj-$(CONFIG_XEN_BLKDEV_BACKEND)	+= blkback/
 obj-$(CONFIG_XEN_BLKDEV_TAP)            += blktap/
 obj-$(CONFIG_XEN_NETDEV_BACKEND)	+= netback/
+obj-$(CONFIG_XEN_USBDEV_BACKEND)	+= usbback/
 obj-$(CONFIG_XENFS)			+= xenfs/
 obj-$(CONFIG_XEN_SYS_HYPERVISOR)	+= sys-hypervisor.o
 obj-$(CONFIG_XEN_MCE)		+= mce.o
drivers/xen/usbback/Makefile new file +3 -0
new file mode 100644
index 0000000..23a3a40
@@ -0,0 +1,3 @@
+obj-$(CONFIG_XEN_USBDEV_BACKEND) := xen-usbback.o
+
+xen-usbback-y   := usbstub.o xenbus.o interface.o usbback.o
drivers/xen/usbback/interface.c new file +250 -0

250 lines not on this page · raw message

drivers/xen/usbback/usbback.c new file +1194 -0

964 lines not on this page · raw message

drivers/xen/usbback/usbback.h new file +182 -0

182 lines not on this page · raw message

drivers/xen/usbback/usbstub.c new file +325 -0

325 lines not on this page · raw message

drivers/xen/usbback/xenbus.c new file +338 -0

338 lines not on this page · raw message

include/xen/interface/io/usbif.h new file +151 -0

151 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Part of the diff is not shown here. View the raw message.

#14 lore raw
In reply to Pasi Kärkkäinen
Quoted 7 lines · Pasi Kärkkäinen
Quoted 6 lines · Nathanael Rensen
Quoted 4 lines · Ian Campbell

I think the correct path for this functionality is to first get it accepted into the upstream kernel by working with the USB subsystem maintainer+list, fixing the issue arising from their review etc.

Quoted 7 lines
Quoted 5 lines

I'm happy to have a shot at that. I don't imagine it will be a quick process so in the meantime I think there is value in supporting pvusb in stable/2.6.32.x to encourage people to test and identify issues, and also to make it easier to track the maintenance.

Yeah, at least earlier Jeremy said he's happy to take most patches for xen/stable-2.6.32.x :)

I have fewer objections if Nathanael is stepping up to maintain the functionality and to take on the upstreaming work etc (thanks Nathanael!). The existing maintainers mostly have their plates full. (I'm assuming the original author/maintainer of this code is no longer active in the area, otherwise we really ought to be hearing from them about this).

However what we need to avoid is having this conversation again WRT xen/stable-2.6.{38,39,40,41,...}.x and so on for every stable (or long term stable) branch.

I didn't review the code in details but checkpatch.pl says:
total: 7 errors, 104 warnings, 4226 lines checked

The majority look to be trivial to resolve whitespace or new typedef issues. There's a bunch of 80-character line warnings but personally I'd encourage using your own judgement on a case by case basis for those rather than blindly following checkpatch.pl (applies in general too but specifically wrt line length).

Also the patch needs a suitable commit message and a signed-off-by per the D.C.O in Documentation/SubmittingPatches.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

The stuff necessary to get the frontend upstream has been upstream for ages. For the backend basic dom0 boot support is in 2.6.37 and the generic scaffolding for backends is currently in linux-next (via Konrad's tree) and is intended to be in the next merge window.

I think the backend just looks like a regular USB driver to the host system so it probably belongs in drivers/usb/<something>/xen-usbback/ and not drivers/xen. (I'm not sure what the <something> should be, perhaps "misc").

Quoted 9 lines
Quoted 9 lines

I agree that the frontend driver looks like a regular USB host controller driver and belongs in drivers/usb/host. From the dom0 perspective the backend driver is a consumer of USB services rather than a provider so my inclination is that the proper place for the backend is drivers/xen along with blkback, netback and pciback. Much the same way as I would expect to find a USB TV tuner driver in drivers/media rather than drivers/usb. I would prefer to remain consistent with the model established by the block, net and pci drivers,

A fair point.

Quoted 2 lines

but I am happy to adopt whatever convention is acceptable to

Quoted 1 line

upstream.

That's probably the best approach to take.

Quoted 4 lines

Something I noticed about the pvusb backend..
Should the name of the driver be xen-usbbk instead of just usbbk ?

The other backend driver modules seem to have xen- prefix.

xen-usbback please but, yes, this is a good change to make which happened to the other drivers in the pvops tree sometime ago e.g.:
a84aa84cd0db4dd6a1a911f2263846c9b6f30a49 xen: rename netbk module xen-netback. e762bd5145e59c043e47228fe1a6c1eebef07c0c xen: rename blkbk module xen-blkback.

Skimming "git log --pretty=oneline --no-merges xen/xen/stable-2.6.32.x
-- drivers/xen/{blk,net}back drivers/net/xen-netfront.c
drivers/block/xen-blkfront.c" for other generic changes which would be
worth propagating gives:
71133087313f15db44ffb6ea802e5bdb2479a600 xen: use less generic names in blkfront driver. 9c9c87f53f87d0368ef04207cce4c92884f4ae3d xen: use less generic names in netfront driver. 0c989045948320d583a190b75a12ba0ec556b804 Fix compile warnings: ignoring return value of 'xenbus_register_backend' .. d2748d40e3e8a14706d0f3a378160def877aa222 xen/netback: don't include xen/evtchn.h d3d3c63ce04b34ad6b45ed6da12d2be012861622 xen/blkback: don't include xen/evtchn.h

Ian.

#6 lore raw
In reply to Nathanael Rensen
Quoted 5 lines · Nathanael Rensen
Quoted 3 lines · Pasi Kärkkäinen

Something I noticed about the pvusb backend..
Should the name of the driver be xen-usbbk instead of just usbbk ?

Quoted 7 lines
Quoted 3 lines

The other backend driver modules seem to have xen- prefix.

-- Pasi

Good point - although I think xen-usbback would better match xen-blkback, xen-netback, xen-pciback.

Yeah, yesterday I tried porting PVSCSI drivers to pvops, and I used xen-scsiback and xen-scsifront there aswell.

Quoted 4 lines

For consistency the config options should probably be CONFIG_XEN_USBDEV_BACKEND and CONFIG_XEN_USBDEV_FRONTEND (the previous patch had CONFIG_XEN_USB_...).

I'll have to check these for PVSCSI aswell.

Quoted 6 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Great, thanks.

-- Pasi

#7 lore raw
Quoted 10 lines · Pasi Kärkkäinen
Quoted 7 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Great, thanks.

Hello again,

Nathanael: Did you have time to take a look at upstreaming xen pvusb drivers ?

-- Pasi

#8 lore raw
Quoted 9 lines · Pasi Kärkkäinen
Quoted 8 lines · Pasi Kärkkäinen
Quoted 7 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Quoted 7 lines
Quoted 2 lines

Great, thanks.

Hello again,

Nathanael: Did you have time to take a look at upstreaming xen pvusb drivers ?

Hello,

Now there's actually LinuxCon Vancouver event coming up, where Linux USB virtualization is going to be discussed:
http://marc.info/?l=linux-kernel&m=130766622608800&w=2

So people interested in Xen PVUSB might want to attend/contribute..
http://events.linuxfoundation.org/events/linuxcon

-- Pasi

#10 lore raw
In reply to a message not in the archive
Quoted 2 lines · Nathanael Rensen

Hi Pasi,

Hello,

(I added Konrad and xen-devel to CC list, hopefully that's ok..)

Quoted 3 lines

It's been a very long time since we discussed PVUSB - I haven't given up, just been caught up with other things.

Great! Really nice to hear from you again..

Just last weekend I fetched the opensuse Linux 3.2 kernel-xen src.rpm, extracted the xen patches, and started preparing to re-port the driver to pvops. So now I don't have to finish that :)

Quoted 5 lines

I've updated the PVUSB patch, done some refactoring and cleaned up the checkpatch warnings.
The patch is targetted at linux-next, but it also applies cleanly to Konrad's linux-next branch:

Quoted 8 lines

http://members.iinet.net.au/~nathanael/0001-pvusb-driver.linux-next.patch

I haven't done a lot of testing, but it does work for my basic test (USB TV-tuner). My next step is to get in contact with the USB maintainer and see what further changes are required in order to get this work upstreamed. In the meantime, the more testing and exposure the patch gets the better.

I'm sure we can get people testing this patch. Many people have been asking for USB passthru solution for Linux 3.x.

Quoted 2 lines

Thanks,

Thanks a lot!

-- Pasi

Quoted 21 lines

Nathanael

Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Pasi Kärkkäinen
Quoted 7 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Great, thanks.

Hello again,

Nathanael: Did you have time to take a look at upstreaming xen pvusb drivers ?

-- Pasi

#11 lore raw
Quoted 12 lines · Pasi Kärkkäinen
Quoted 2 lines · Nathanael Rensen

Hi Pasi,

Hello,

(I added Konrad and xen-devel to CC list, hopefully that's ok..)

Quoted 3 lines

It's been a very long time since we discussed PVUSB - I haven't given up, just been caught up with other things.

Quoted 12 lines

Great! Really nice to hear from you again..

Just last weekend I fetched the opensuse Linux 3.2 kernel-xen src.rpm, extracted the xen patches, and started preparing to re-port the driver to pvops. So now I don't have to finish that :)

Quoted 6 lines

I've updated the PVUSB patch, done some refactoring and cleaned up the checkpatch warnings.
The patch is targetted at linux-next, but it also applies cleanly to Konrad's linux-next branch:

http://members.iinet.net.au/~nathanael/0001-pvusb-driver.linux-next.patch

Nice job (I took a brief look at it). I see you handled those m2p_override nicely.

Quoted 6 lines
Quoted 6 lines

I haven't done a lot of testing, but it does work for my basic test (USB TV-tuner). My next step is to get in contact with the USB maintainer and see what further changes are required in order to get this work upstreamed. In the meantime, the more testing and exposure the patch gets the better.

OK. Well let me stick on my #testing branch which is a kitchensink of things and play with a bit.

Quoted 35 lines
Quoted 1 line

I'm sure we can get people testing this patch. Many people have been asking for USB passthru solution for Linux 3.x.

Quoted 2 lines

Thanks,

Thanks a lot!

-- Pasi

Quoted 21 lines

Nathanael

Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Pasi Kärkkäinen
Quoted 7 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Great, thanks.

Hello again,

Nathanael: Did you have time to take a look at upstreaming xen pvusb drivers ?

-- Pasi

#12 lore raw
In reply to Pasi Kärkkäinen
Quoted 7 lines · Pasi Kärkkäinen
Quoted 2 lines · Nathanael Rensen

Hi Pasi,

Hello,

(I added Konrad and xen-devel to CC list, hopefully that's ok..)

And let me add James Harper here since he was doing some testing with the Windows GPL PV USB driver as well

Quoted 63 lines
Quoted 4 lines

It's been a very long time since we discussed PVUSB - I haven't given up, just been caught up with other things.

Great! Really nice to hear from you again..

Just last weekend I fetched the opensuse Linux 3.2 kernel-xen src.rpm, extracted the xen patches, and started preparing to re-port the driver to pvops. So now I don't have to finish that :)

Quoted 5 lines

I've updated the PVUSB patch, done some refactoring and cleaned up the checkpatch warnings.
The patch is targetted at linux-next, but it also applies cleanly to Konrad's linux-next branch:

Quoted 8 lines

http://members.iinet.net.au/~nathanael/0001-pvusb-driver.linux-next.patch

I haven't done a lot of testing, but it does work for my basic test (USB TV-tuner). My next step is to get in contact with the USB maintainer and see what further changes are required in order to get this work upstreamed. In the meantime, the more testing and exposure the patch gets the better.

I'm sure we can get people testing this patch. Many people have been asking for USB passthru solution for Linux 3.x.

Quoted 2 lines

Thanks,

Thanks a lot!

-- Pasi

Quoted 21 lines

Nathanael

Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Pasi Kärkkäinen
Quoted 7 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Great, thanks.

Hello again,

Nathanael: Did you have time to take a look at upstreaming xen pvusb drivers ?

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#13 lore raw

Re: Xen pvusb drivers for upstream Linux 3.x kernels

Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Pasi Kärkkäinen
Quoted 2 lines · Nathanael Rensen

Hi Pasi,

Quoted 7 lines
Quoted 3 lines

Hello,

(I added Konrad and xen-devel to CC list, hopefully that's ok..)

And let me add James Harper here since he was doing some testing with the Windows GPL PV USB driver as well

And let's modify the subject aswell :)

-- Pasi

Quoted 64 lines
Quoted 64 lines
Quoted 5 lines

It's been a very long time since we discussed PVUSB - I haven't given up, just been caught up with other things.

Great! Really nice to hear from you again..

Just last weekend I fetched the opensuse Linux 3.2 kernel-xen src.rpm, extracted the xen patches, and started preparing to re-port the driver to pvops. So now I don't have to finish that :)

Quoted 5 lines

I've updated the PVUSB patch, done some refactoring and cleaned up the checkpatch warnings.
The patch is targetted at linux-next, but it also applies cleanly to Konrad's linux-next branch:

Quoted 8 lines

http://members.iinet.net.au/~nathanael/0001-pvusb-driver.linux-next.patch

I haven't done a lot of testing, but it does work for my basic test (USB TV-tuner). My next step is to get in contact with the USB maintainer and see what further changes are required in order to get this work upstreamed. In the meantime, the more testing and exposure the patch gets the better.

I'm sure we can get people testing this patch. Many people have been asking for USB passthru solution for Linux 3.x.

Quoted 2 lines

Thanks,

Thanks a lot!

-- Pasi

Quoted 21 lines

Nathanael

Quoted 18 lines · Pasi Kärkkäinen
Quoted 10 lines · Pasi Kärkkäinen
Quoted 7 lines

I also noticed the frontend driver was producing a warning when loading which is resolved by setting the module owner.

I've placed an updated diff here:
http://members.iinet.net.au/~nathanael/pvusb.diff

Great, thanks.

Hello again,

Nathanael: Did you have time to take a look at upstreaming xen pvusb drivers ?

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel