* [Qemu-devel] USB Passthrough not working for Windows 7 guest
@ 2013-11-05 16:01 Frederich, Jens
2013-11-05 17:38 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Frederich, Jens @ 2013-11-05 16:01 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Hi all,
we're currently evaluating different RTOS systems (Windows CE, Intime, RTX, etc.).
One system is Linux RT + KVM/QEMU with a Windows 7 guest. Up to now all
works fine, Linux RT has good latency and KVM/Qemu setup was easy. But one QEMU bug
breaks my measurement setup and evaluation.
I've some usb devices for the Windows 7 guest. I configure them as USB passthrough.
The devices appears in the device manager of Windows 7, but with
"Error code 10": device cannot start". The Windows driver fails on USB set configuration.
The driver creates a IRP and send it via IOCTRL to lower layer. The IOCTRL fails with
invalid parameter.
driver log:
00000009 0.65470564 vnCDrvUsbControlRequestSetConfiguration, WdfUsbTargetDeviceSelectConfig single interface failed 0xc000000d
00000010 0.65472370 vnCDrvUsbIFPrepareHardwareState, vnCDrvUsbControlRequestSetConfiguration failed: 0xc000000d
00000011 0.65473646 vnCDrvDevConPrepareHardware, vnCDrvUsbIFPrepareHardwareState failed 0xc000000d
00000012 0.65474838 vnCDrvEvtDevicePrepareHardware, vnCDrvDevConPrepareHardware failed 0xc0000001
00000013 0.6547
This bug breaks my latency measurement setup and Linux RT is out of the evaluationg
race. Windows CE should not win :-), it there anyway workaround or hack to fix the issue?
My setup:
Ubuntu 64-bit
Windows 7 Embedded Guest
Linux Kernel: 3.10.10-rt7
QEMU: 1.4.0, 1.6.1
thanks,
Jens
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
2013-11-05 16:01 Frederich, Jens
@ 2013-11-05 17:38 ` Jan Kiszka
0 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2013-11-05 17:38 UTC (permalink / raw)
To: Frederich, Jens, qemu-devel@nongnu.org
On 2013-11-05 17:01, Frederich, Jens wrote:
> Hi all,
>
> we're currently evaluating different RTOS systems (Windows CE, Intime, RTX, etc.).
> One system is Linux RT + KVM/QEMU with a Windows 7 guest. Up to now all
> works fine, Linux RT has good latency and KVM/Qemu setup was easy. But one QEMU bug
> breaks my measurement setup and evaluation.
>
> I've some usb devices for the Windows 7 guest. I configure them as USB passthrough.
> The devices appears in the device manager of Windows 7, but with
> "Error code 10": device cannot start". The Windows driver fails on USB set configuration.
> The driver creates a IRP and send it via IOCTRL to lower layer. The IOCTRL fails with
> invalid parameter.
>
> driver log:
> 00000009 0.65470564 vnCDrvUsbControlRequestSetConfiguration, WdfUsbTargetDeviceSelectConfig single interface failed 0xc000000d
> 00000010 0.65472370 vnCDrvUsbIFPrepareHardwareState, vnCDrvUsbControlRequestSetConfiguration failed: 0xc000000d
> 00000011 0.65473646 vnCDrvDevConPrepareHardware, vnCDrvUsbIFPrepareHardwareState failed 0xc000000d
> 00000012 0.65474838 vnCDrvEvtDevicePrepareHardware, vnCDrvDevConPrepareHardware failed 0xc0000001
> 00000013 0.6547
>
> This bug breaks my latency measurement setup and Linux RT is out of the evaluationg
> race. Windows CE should not win :-), it there anyway workaround or hack to fix the issue?
Workaround: Pass-through one of the (typically) many USB host
controllers to the Windows guest (vfio or classic pci-assign). I did
this back then when *HCI emulation was still pretty immature.
But USB device pass-through should also work. Do you happen to pass a
USB 2.0 device via an emulated UHCI? Or are you already using the EHCI
emulation? In the latter case, activating USB tracing (see also
qemu/docs/tracing.txt) and posting the results here may help analysing
the issue.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
@ 2013-11-05 20:20 Jens Frederich
2013-11-06 6:58 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Jens Frederich @ 2013-11-05 20:20 UTC (permalink / raw)
To: qemu-devel; +Cc: jan.kiszka
>On 2013-11-05 17:01, Frederich, Jens wrote:
>> Hi all,
>>
>> we're currently evaluating different RTOS systems (Windows CE, Intime, RTX,
>> etc.).
>> One system is Linux RT + KVM/QEMU with a Windows 7 guest. Up to now all
>> works fine, Linux RT has good latency and KVM/Qemu setup was easy. But one
>> QEMU bug
>> breaks my measurement setup and evaluation.
>>
>> I've some usb devices for the Windows 7 guest. I configure them as USB
>> passthrough.
>> The devices appears in the device manager of Windows 7, but with
>> "Error code 10": device cannot start". The Windows driver fails on USB set
>> configuration.
>> The driver creates a IRP and send it via IOCTRL to lower layer. The IOCTRL
>> fails with
>> invalid parameter.
>>
>> driver log:
>> 00000009 0.65470564 vnCDrvUsbControlRequestSetConfiguration,
>> WdfUsbTargetDeviceSelectConfig single interface failed 0xc000000d
>> 00000010 0.65472370 vnCDrvUsbIFPrepareHardwareState,
>> vnCDrvUsbControlRequestSetConfiguration failed: 0xc000000d
>> 00000011 0.65473646 vnCDrvDevConPrepareHardware,
>> vnCDrvUsbIFPrepareHardwareState failed 0xc000000d
>> 00000012 0.65474838 vnCDrvEvtDevicePrepareHardware,
>> vnCDrvDevConPrepareHardware failed 0xc0000001
>> 00000013 0.6547
>>
>> This bug breaks my latency measurement setup and Linux RT is out of the
>> evaluationg
>> race. Windows CE should not win :-), it there anyway workaround or hack to
>> fix the issue?
>
>Workaround: Pass-through one of the (typically) many USB host
>controllers to the Windows guest (vfio or classic pci-assign). I did
>this back then when *HCI emulation was still pretty immature.
>
>But USB device pass-through should also work. Do you happen to pass a
>USB 2.0 device via an emulated UHCI? Or are you already using the EHCI
>emulation?
I'm not sure which mode it has been. I've used the virt-manager to configure
the device. A usb controller is already configured in mode 'default'.
My steps on virt-manager:
1. add hardware
2. select usb host device
3. I can see my usb device, I select it
4. start guest and open Windows device manager
I don't know is this UHCI or EHCI? On the usb host device list are
some controller listed e.q. xhci, ehci and so on. Should I map these
controller to Windows 7 as well?
thanks,
Jens
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
2013-11-05 20:20 [Qemu-devel] USB Passthrough not working for Windows 7 guest Jens Frederich
@ 2013-11-06 6:58 ` Jan Kiszka
2013-11-06 10:36 ` Frederich, Jens
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2013-11-06 6:58 UTC (permalink / raw)
To: Jens Frederich, qemu-devel
On 2013-11-05 21:20, Jens Frederich wrote:
>> On 2013-11-05 17:01, Frederich, Jens wrote:
>>> Hi all,
>>>
>>> we're currently evaluating different RTOS systems (Windows CE, Intime, RTX,
>>> etc.).
>>> One system is Linux RT + KVM/QEMU with a Windows 7 guest. Up to now all
>>> works fine, Linux RT has good latency and KVM/Qemu setup was easy. But one
>>> QEMU bug
>>> breaks my measurement setup and evaluation.
>>>
>>> I've some usb devices for the Windows 7 guest. I configure them as USB
>>> passthrough.
>>> The devices appears in the device manager of Windows 7, but with
>>> "Error code 10": device cannot start". The Windows driver fails on USB set
>>> configuration.
>>> The driver creates a IRP and send it via IOCTRL to lower layer. The IOCTRL
>>> fails with
>>> invalid parameter.
>>>
>>> driver log:
>>> 00000009 0.65470564 vnCDrvUsbControlRequestSetConfiguration,
>>> WdfUsbTargetDeviceSelectConfig single interface failed 0xc000000d
>>> 00000010 0.65472370 vnCDrvUsbIFPrepareHardwareState,
>>> vnCDrvUsbControlRequestSetConfiguration failed: 0xc000000d
>>> 00000011 0.65473646 vnCDrvDevConPrepareHardware,
>>> vnCDrvUsbIFPrepareHardwareState failed 0xc000000d
>>> 00000012 0.65474838 vnCDrvEvtDevicePrepareHardware,
>>> vnCDrvDevConPrepareHardware failed 0xc0000001
>>> 00000013 0.6547
>>>
>>> This bug breaks my latency measurement setup and Linux RT is out of the
>>> evaluationg
>>> race. Windows CE should not win :-), it there anyway workaround or hack to
>>> fix the issue?
>>
>> Workaround: Pass-through one of the (typically) many USB host
>> controllers to the Windows guest (vfio or classic pci-assign). I did
>> this back then when *HCI emulation was still pretty immature.
>>
>> But USB device pass-through should also work. Do you happen to pass a
>> USB 2.0 device via an emulated UHCI? Or are you already using the EHCI
>> emulation?
>
> I'm not sure which mode it has been. I've used the virt-manager to configure
> the device. A usb controller is already configured in mode 'default'.
> My steps on virt-manager:
>
> 1. add hardware
> 2. select usb host device
> 3. I can see my usb device, I select it
> 4. start guest and open Windows device manager
Unfortunately, I do not know what virt-manager is configuring by
default. It likely also depends on its version, so you should share this
information as well. Maybe other folks here can comment on this.
>
> I don't know is this UHCI or EHCI? On the usb host device list are
> some controller listed e.q. xhci, ehci and so on. Should I map these
> controller to Windows 7 as well?
Pick the host controller to which the USB device you want to give to the
guest is attached to (lsusb and the bus number reported via
/sys/bus/pci/devices/<id>/usbX can tell this - or trial and error). When
doing this, you no longer need to pass through the USB device itself, it
is implicitely passed.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
2013-11-06 6:58 ` Jan Kiszka
@ 2013-11-06 10:36 ` Frederich, Jens
2013-11-06 11:09 ` Gerd Hoffmann
0 siblings, 1 reply; 8+ messages in thread
From: Frederich, Jens @ 2013-11-06 10:36 UTC (permalink / raw)
To: Jan Kiszka, Jens Frederich, qemu-devel@nongnu.org
>-----Original Message-----
>From: qemu-devel-bounces+jens.frederich=vector.com@nongnu.org
>[mailto:qemu-devel-bounces+jens.frederich=vector.com@nongnu.org] On
>Behalf Of Jan Kiszka
>Sent: Wednesday, November 06, 2013 7:58 AM
>To: Jens Frederich; qemu-devel@nongnu.org
>Subject: Re: [Qemu-devel] USB Passthrough not working for Windows 7
>guest
>
>On 2013-11-05 21:20, Jens Frederich wrote:
>>> On 2013-11-05 17:01, Frederich, Jens wrote:
>>>> Hi all,
>>>>
>>>> we're currently evaluating different RTOS systems (Windows CE,
>Intime, RTX,
>>>> etc.).
>>>> One system is Linux RT + KVM/QEMU with a Windows 7 guest. Up to
>now all
>>>> works fine, Linux RT has good latency and KVM/Qemu setup was easy.
>But one
>>>> QEMU bug
>>>> breaks my measurement setup and evaluation.
>>>>
>>>> I've some usb devices for the Windows 7 guest. I configure them as
>USB
>>>> passthrough.
>>>> The devices appears in the device manager of Windows 7, but with
>>>> "Error code 10": device cannot start". The Windows driver fails on
>USB set
>>>> configuration.
>>>> The driver creates a IRP and send it via IOCTRL to lower layer.
>The IOCTRL
>>>> fails with
>>>> invalid parameter.
>>>>
>>>> driver log:
>>>> 00000009 0.65470564
>vnCDrvUsbControlRequestSetConfiguration,
>>>> WdfUsbTargetDeviceSelectConfig single interface failed 0xc000000d
>>>> 00000010 0.65472370 vnCDrvUsbIFPrepareHardwareState,
>>>> vnCDrvUsbControlRequestSetConfiguration failed: 0xc000000d
>>>> 00000011 0.65473646 vnCDrvDevConPrepareHardware,
>>>> vnCDrvUsbIFPrepareHardwareState failed 0xc000000d
>>>> 00000012 0.65474838 vnCDrvEvtDevicePrepareHardware,
>>>> vnCDrvDevConPrepareHardware failed 0xc0000001
>>>> 00000013 0.6547
>>>>
>>>> This bug breaks my latency measurement setup and Linux RT is out
>of the
>>>> evaluationg
>>>> race. Windows CE should not win :-), it there anyway workaround or
>hack to
>>>> fix the issue?
>>>
>>> Workaround: Pass-through one of the (typically) many USB host
>>> controllers to the Windows guest (vfio or classic pci-assign). I
>did
>>> this back then when *HCI emulation was still pretty immature.
>>>
>>> But USB device pass-through should also work. Do you happen to pass
>a
>>> USB 2.0 device via an emulated UHCI? Or are you already using the
>EHCI
>>> emulation?
>>
>> I'm not sure which mode it has been. I've used the virt-manager to
>configure
>> the device. A usb controller is already configured in mode
>'default'.
>> My steps on virt-manager:
>>
>> 1. add hardware
>> 2. select usb host device
>> 3. I can see my usb device, I select it
>> 4. start guest and open Windows device manager
>
>Unfortunately, I do not know what virt-manager is configuring by
>default. It likely also depends on its version, so you should share
>this
>information as well. Maybe other folks here can comment on this.
>
>>
>> I don't know is this UHCI or EHCI? On the usb host device list are
>> some controller listed e.q. xhci, ehci and so on. Should I map these
>> controller to Windows 7 as well?
>
>Pick the host controller to which the USB device you want to give to
>the
>guest is attached to (lsusb and the bus number reported via
>/sys/bus/pci/devices/<id>/usbX can tell this - or trial and error).
>When
>doing this, you no longer need to pass through the USB device itself,
>it
>is implicitely passed.
>
Okay, that sounds good.
That's my lsusb output:
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 1248:1030
The last line is my usb device.
I've used 'virsh edit' to map all controllers for Windows 7.
I want to be on the safe side ;-).
The libvirt xml fragment:
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='1' device='2'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='2' device='2'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='1' device='1'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='2' device='1'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='3' device='1'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='4' device='1'/>
</source>
</hostdev>
On Win 7 I can see a new NEC USB Hub. I don't know why Win. 7
it initialized as USB Hub. But my device isn't there. I've
plugged it to other USB ports, but nothing happend. I used
prebuild Ubuntu 13.04 qemu 1.4.0.
I think my next step is to build my on 1.6.x qemu from git with
--enable-libusb and --enable-trace-backend=simpe.
thanks
Jens
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
2013-11-06 10:36 ` Frederich, Jens
@ 2013-11-06 11:09 ` Gerd Hoffmann
2013-11-06 11:16 ` Frederich, Jens
0 siblings, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2013-11-06 11:09 UTC (permalink / raw)
To: Frederich, Jens; +Cc: Jan Kiszka, qemu-devel@nongnu.org, Jens Frederich
On Mi, 2013-11-06 at 10:36 +0000, Frederich, Jens wrote:
> >> I'm not sure which mode it has been. I've used the virt-manager to
> >configure
> >> the device. A usb controller is already configured in mode
> >'default'.
Flip that to "usb 2".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
2013-11-06 11:09 ` Gerd Hoffmann
@ 2013-11-06 11:16 ` Frederich, Jens
2013-11-06 11:22 ` Gerd Hoffmann
0 siblings, 1 reply; 8+ messages in thread
From: Frederich, Jens @ 2013-11-06 11:16 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Jan Kiszka, qemu-devel@nongnu.org, Jens Frederich
>-----Original Message-----
>From: Gerd Hoffmann [mailto:kraxel@redhat.com]
>Sent: Wednesday, November 06, 2013 12:09 PM
>To: Frederich, Jens
>Cc: Jan Kiszka; Jens Frederich; qemu-devel@nongnu.org
>Subject: Re: [Qemu-devel] USB Passthrough not working for Windows 7
>guest
>
>On Mi, 2013-11-06 at 10:36 +0000, Frederich, Jens wrote:
>> >> I'm not sure which mode it has been. I've used the virt-manager
>to
>> >configure
>> >> the device. A usb controller is already configured in mode
>> >'default'.
>
>Flip that to "usb 2".
Thanks, Gerd. Now I can see the usb controller on Win 7. But my device
isn't there...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] USB Passthrough not working for Windows 7 guest
2013-11-06 11:16 ` Frederich, Jens
@ 2013-11-06 11:22 ` Gerd Hoffmann
0 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2013-11-06 11:22 UTC (permalink / raw)
To: Frederich, Jens; +Cc: Jan Kiszka, qemu-devel@nongnu.org, Jens Frederich
> the device. A usb controller is already configured in mode
> >> >'default'.
> >
> >Flip that to "usb 2".
>
> Thanks, Gerd. Now I can see the usb controller on Win 7. But my device
> isn't there...
Anything in the logs (/var/log/libvirt/qemu/$guest.log)?
cheers,
Gerd
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-11-06 11:23 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 20:20 [Qemu-devel] USB Passthrough not working for Windows 7 guest Jens Frederich
2013-11-06 6:58 ` Jan Kiszka
2013-11-06 10:36 ` Frederich, Jens
2013-11-06 11:09 ` Gerd Hoffmann
2013-11-06 11:16 ` Frederich, Jens
2013-11-06 11:22 ` Gerd Hoffmann
-- strict thread matches above, loose matches on Subject: below --
2013-11-05 16:01 Frederich, Jens
2013-11-05 17:38 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).