qemu usb-linux.c vl.h hw/esp.c hw/lsi53c895a.c ...
CVSROOT: /sources/qemu
Module name: qemu
Changes by: Paul Brook <pbrook> 06/08/12 01:04:27
Modified files:
. : usb-linux.c vl.h
hw : esp.c lsi53c895a.c scsi-disk.c usb-hid.c
usb-hub.c usb-msd.c usb-ohci.c usb-uhci.c usb.c usb.h
pc-bios : openbios-sparc32
Added files:
pc-bios : openbios-esp.diff
Log message:
SCSI and USB async IO support.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/usb-linux.c?cvsroot=qemu&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemu/vl.h?cvsroot=qemu&r1=1.140&r2=1.141
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/esp.c?cvsroot=qemu&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/lsi53c895a.c?cvsroot=qemu&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/scsi-disk.c?cvsroot=qemu&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb-hid.c?cvsroot=qemu&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb-hub.c?cvsroot=qemu&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb-msd.c?cvsroot=qemu&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb-ohci.c?cvsroot=qemu&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb-uhci.c?cvsroot=qemu&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb.c?cvsroot=qemu&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/usb.h?cvsroot=qemu&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemu/pc-bios/openbios-sparc32?cvsroot=qemu&rev=1.2
http://cvs.savannah.gnu.org/viewcvs/qemu/pc-bios/openbios-esp.diff?cvsroot=qemu&rev=1.1
Hi,
OK for the SCSI async support. I am making changes to have a better low level handling of CDROMs (both real host CDROMs and emulated ones), but I don't know when it will be ready. The changes mostly consists in adding a method in the block devices to support packet CD commands.
About async USB, maybe some simplifications are possible. When you have a real USB controller, there is always a single current request and you don't neep to have provisions to handle several ones (of course more complicated host controllers could do that, but it is not useful to model it now). Moreover, the devices must reply to the request immediately so the request are asynchronous just because it takes a few uS to send the data, not because the device blocks (I am not sure it is clear for you).
So in QEMU, async USB is not needed in practise for emulated devices. For MSD you don't need it for example even if you are using SCSI AIO because the host keep polling the MSD storage device until there is an SCSI reply.
Async USB is only really needed in the case where QEMU speaks to a host device. In this case the operation to send a TD may block (ideally at most 1 ms) and it is interesting to hide that to the guest. In this case, we must make compromises to hide this fact to the guest. Your proposal seems good for that but USB frames will be longer than 1 ms in case of host devices (and I am ready to accept that as it is better than the previous solution !).
The more complicated implementation would be to suppress USB async as you did it but to export to the generic USB layers that list of TD that the controller maintains. Then it is possible to submit several requests at once to the host devices while having a consistent low level model.
Regards,
Fabrice.
[following up to record the discussion on IRC]
Quoted 8 lines · Fabrice Bellard
About async USB, maybe some simplifications are possible. When you have a real USB controller, there is always a single current request and you don't neep to have provisions to handle several ones (of course more complicated host controllers could do that, but it is not useful to model it now). Moreover, the devices must reply to the request immediately so the request are asynchronous just because it takes a few uS to send the data, not because the device blocks (I am not sure it is clear for you).
Right. It depends which level of the USB spec you're looking at.
At the low level (frames) USB is a bus system. Each TD is send on the bus in turn, and the device responds immediately (with a NAK if it is not ready to handle the request).
However at a higher level (endpoints) USB Bulk (and Control) transfers can be considered to be concurrent packet streams. This is closer to the level at which the current async support was intended to work.
With OHCI this matches the interface presented by the host controller. With UHCI a bit of guesswork is needed to recover this from the low-level frame/queue structures.
Paul
Quoted 14 lines · Paul Brook
CVSROOT: /sources/qemu Module name: qemu Changes by: Paul Brook <pbrook> 06/08/12 01:04:27Modified files:
. :usb-linux.cvl.h
hw :esp.clsi53c895a.cscsi-disk.cusb-hid.c
usb-hub.cusb-msd.cusb-ohci.cusb-uhci.cusb.cusb.h
pc-bios : openbios-sparc32
Added files:
pc-bios : openbios-esp.diff
Quoted 2 lines
Log message:
SCSI and USB async IO support.
Problem in esp.c: if request cannot be handled in one scsi device access, DMA ptr s->espdmaregs[1] will be incremented by async transfer size both in esp_do_dma() and in esp_command_complete(). Removing the one in esp_do_dma() allows me to boot aurora sparc linux with qemu-system-sparc.
--
Kind Regards,
Igor V. Kovalenko