Skip to contentSkip to conversation

add 1394 OHCI device

PATCH In review Ladi Prosek 4 participants 6 messages Mar 2, 2016 – Apr 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add 1394 OHCI device

This patch adds 1394 (FireWire) virtual device support to QEMU.

---
I am resurrecting this patch sent to the list by Itamar last year. My motivation is remote Windows kernel debugging - probably the same reason why this work was started in the first place.

I have not changed anything in the actual logic as I am not familiar with how the 1394 device works. I have however:

- added type_init & co so the device can actually be instantiated
- refactored the freakishly long hcd_chr_receive into several subroutines
- eliminated all bitfields and refactored everything to use explicit bit operations
- made the device available on all platforms
- renamed structures and fields to follow the QEMU coding style (checkpatch.pl is clean)

I am cc'ing Itamar and the folks who provided feedback last year in the hope of achieving at least some continuity.

 default-configs/pci.mak  |    1 +
 hw/1394/Makefile.objs    |    1 +
 hw/1394/hcd-ohci.c       | 1736 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/1394/hcd-ohci.h       |  131 ++++
 hw/Makefile.objs         |    1 +
 include/hw/pci/pci_ids.h |    3 +
 6 files changed, 1873 insertions(+)
 create mode 100644 hw/1394/Makefile.objs
 create mode 100644 hw/1394/hcd-ohci.c
 create mode 100644 hw/1394/hcd-ohci.h
default-configs/pci.mak +1 -0
index 4fa9a28..573d55c 100644
@@ -5,6 +5,7 @@ CONFIG_USB_UHCI=y
 CONFIG_USB_OHCI=y
 CONFIG_USB_EHCI=y
 CONFIG_USB_XHCI=y
+CONFIG_1394_OHCI=y
 CONFIG_NE2000_PCI=y
 CONFIG_EEPRO100_PCI=y
 CONFIG_PCNET_PCI=y
hw/1394/Makefile.objs new file +1 -0
new file mode 100644
index 0000000..bddc0e1
@@ -0,0 +1 @@
+common-obj-$(CONFIG_1394_OHCI) += hcd-ohci.o
hw/1394/hcd-ohci.c new file +1736 -0

1,736 lines not on this page · raw message

hw/1394/hcd-ohci.h new file +131 -0

131 lines not on this page · raw message

hw/Makefile.objs +1 -0
index 4a07ed4..db012bf 100644
@@ -27,6 +27,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += ssi/
 devices-dirs-$(CONFIG_SOFTMMU) += timer/
 devices-dirs-$(CONFIG_TPM) += tpm/
 devices-dirs-$(CONFIG_SOFTMMU) += usb/
+devices-dirs-$(CONFIG_SOFTMMU) += 1394/
 devices-dirs-$(CONFIG_SOFTMMU) += vfio/
 devices-dirs-$(CONFIG_VIRTIO) += virtio/
 devices-dirs-$(CONFIG_SOFTMMU) += watchdog/
include/hw/pci/pci_ids.h +3 -0
index db85afa..0ff5335 100644
@@ -35,6 +35,7 @@
 #define PCI_CLASS_SYSTEM_SDHCI           0x0805
 #define PCI_CLASS_SYSTEM_OTHER           0x0880
 
+#define PCI_CLASS_SERIAL_1394            0x0c00
 #define PCI_CLASS_SERIAL_USB             0x0c03
 #define PCI_CLASS_SERIAL_SMBUS           0x0c05
 
@@ -157,6 +158,8 @@
 
 #define PCI_DEVICE_ID_INTEL_Q35_MCH      0x29c0
 
+#define PCI_DEVICE_ID_INTEL_1394_OHCI    0x7605
+
 #define PCI_VENDOR_ID_XEN                0x5853
 #define PCI_DEVICE_ID_XEN_PLATFORM       0x0001
 
Signature · 1 line
2.5.0
#1 lore raw

Just a friendly ping after two weeks of silence.

Thanks,
Ladi

Tested-by
#2 lore raw

Hello All,

I've tested windows live debugging using the Firewire device and it seems to be good.

Test case scenario:
Kernel-Mode Debugging over a 1394 as detailed in:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff556866(v=vs.85).aspx.

Setup:

    Two separate VMs, both running Windows 2012 X64. One as Host VM ( 

which runs the debugger ) and the other as Target VM ( which is being debugged ).

Qemu Command line:

On the Host VM:
-chardev

socket,id=serial10,path=/tmp/debug-serial2,server,nowait \
        -device ohci-1394,chardev=serial10,idserial10

    On the Target VM:
        -chardev socket,id=serial10,path=/tmp/debug-serial2 \
        -device ohci-1394,chardev=serial10,idserial10

Results:
I've successfully connected to the Target VM using WindbgX64 and ran basic debugging functions such as "Break" and "stack trace". Moreover I've successfully viewed live trace output from virtio-net driver while running Iperf test and ping.

------ Original Message ------
From: "Ladi Prosek" <[email protected]>
To: [email protected]
Cc: [email protected]; "Ladi Prosek" <[email protected]>; [email protected]; [email protected]; [email protected]
Sent: 3/17/2016 10:11:33 AM
Subject: Re: [Qemu-devel] [PATCH] add 1394 OHCI device

Quoted 6 lines

Just a friendly ping after two weeks of silence.

Thanks,
Ladi

#3 lore raw

Hi all,

That's the exactly use case we've intended for when we've wrote this patch and have tested it as well. On my tests the patch worked for both 32 and 64 bit machines for Windows Server 2003, 2008 and 2012 and it seemed to be working just fine. I've also benchmarked it against the good old char device and it was superior on a scale of magnitude.
Feel free to ask me if you encounter any issues and I'll gladly respond.

Itamar,
Guardicore

Quoted 50 lines · Sameeh Jubran

Hello All,

I've tested windows live debugging using the Firewire device and it seems to be good.

Test case scenario:
Kernel-Mode Debugging over a 1394 as detailed in:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff556866(v=vs.85).aspx
.

Setup:

    Two separate VMs, both running Windows 2012 X64. One as Host VM (

which runs the debugger ) and the other as Target VM ( which is being debugged ).

Qemu Command line:

    On the Host VM:
        -chardev socket,id=serial10,path=/tmp/debug-serial2,server,nowait \
        -device ohci-1394,chardev=serial10,idserial10

    On the Target VM:
        -chardev socket,id=serial10,path=/tmp/debug-serial2 \
        -device ohci-1394,chardev=serial10,idserial10

Results:
I've successfully connected to the Target VM using WindbgX64 and ran basic debugging functions such as "Break" and "stack trace". Moreover I've successfully viewed live trace output from virtio-net driver while running Iperf test and ping.

------ Original Message ------
From: "Ladi Prosek" <[email protected]>
To: [email protected]
Cc: [email protected]; "Ladi Prosek" <[email protected]>; [email protected]; [email protected]; [email protected]
Sent: 3/17/2016 10:11:33 AM
Subject: Re: [Qemu-devel] [PATCH] add 1394 OHCI device

Just a friendly ping after two weeks of silence.

Quoted 6 lines

Thanks,
Ladi

#4 lore raw

Thank you Sameeh & Itamar!

Peter, it looks like there are people who care about this device and are willing to maintain it. Would it be enough to merge the patch?

CC Alexander who may be interested as well.

Thanks,
Ladi

Quoted 65 lines · Itamar Tal

Hi all,

That's the exactly use case we've intended for when we've wrote this patch and have tested it as well. On my tests the patch worked for both 32 and 64 bit machines for Windows Server 2003, 2008 and 2012 and it seemed to be working just fine. I've also benchmarked it against the good old char device and it was superior on a scale of magnitude.
Feel free to ask me if you encounter any issues and I'll gladly respond.

Itamar,
Guardicore

Quoted 50 lines · Sameeh Jubran

Hello All,

I've tested windows live debugging using the Firewire device and it seems to be good.

Test case scenario:
Kernel-Mode Debugging over a 1394 as detailed in:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff556866(v=vs.85).aspx.

Setup:

    Two separate VMs, both running Windows 2012 X64. One as Host VM (

which runs the debugger ) and the other as Target VM ( which is being debugged ).

Qemu Command line:

On the Host VM:
-chardev socket,id=serial10,path=/tmp/debug-serial2,server,nowait

\
        -device ohci-1394,chardev=serial10,idserial10

    On the Target VM:
        -chardev socket,id=serial10,path=/tmp/debug-serial2 \
        -device ohci-1394,chardev=serial10,idserial10

Results:
I've successfully connected to the Target VM using WindbgX64 and ran basic debugging functions such as "Break" and "stack trace". Moreover I've successfully viewed live trace output from virtio-net driver while running Iperf test and ping.

------ Original Message ------
From: "Ladi Prosek" <[email protected]>
To: [email protected]
Cc: [email protected]; "Ladi Prosek" <[email protected]>; [email protected]; [email protected]; [email protected]
Sent: 3/17/2016 10:11:33 AM
Subject: Re: [Qemu-devel] [PATCH] add 1394 OHCI device

Quoted 6 lines

Just a friendly ping after two weeks of silence.

Thanks,
Ladi

#5 lore raw
Quoted 4 lines · Ladi Prosek

Thank you Sameeh & Itamar!

Peter, it looks like there are people who care about this device and are willing to maintain it. Would it be enough to merge the patch?

I have no objections to the patch particularly, but I would prefer it if you can find a submaintainer willing to deal with the device and include any related patches in their pull requests to me.

thanks
-- PMM