summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-09-13slirp: Fix error reported by static code analysisStefan Weil1-1/+1
Report from smatch: slirp/tcp_subr.c:127 tcp_respond(17) error: we previously assumed 'tp' could be null (see line 124) Return if 'tp' is NULL. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-09-13slirp: Remove wrong type casts ins debug statementsStefan Weil1-3/+3
The type casts of pointers to long are not allowed when sizeof(pointer) != sizeof(long). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-09-11Merge branch 'usb.64' of git://git.kraxel.org/qemuAurelien Jarno13-1042/+1376
* 'usb.64' of git://git.kraxel.org/qemu: (54 commits) xhci: allow bytewise capability register reads xhci: kill xhci_mem_{read,write} dispatcher functions xhci: support multiple interrupters xhci: pick target interrupter xhci: prepare xhci_runtime_{read,write} for multiple interrupters xhci: add XHCIInterrupter xhci: move register update into xhci_intr_raise xhci: add msix support xhci: rework interrupt handling xhci: fix & cleanup msi. usb-storage: usb3 support usb3: bos decriptor usb3: superspeed endpoint companion usb3: superspeed descriptors xhci: update port handling xhci: update register layout xhci: fix runtime write tracepoint xhci: add trace_usb_xhci_ep_set_dequeue xhci: trace cc codes in cleartext xhci: iso xfer support ...
2012-09-11tcg/optimize: fix if/else/break coding styleAurelien Jarno1-23/+11
optimizer.c contains some cases were the break is appearing in both the if and the else parts. Fix that by moving it to the outer part. Also move some common code there. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: add constant folding for brcondAurelien Jarno1-1/+26
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: add constant folding for setcondAurelien Jarno1-0/+81
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: swap brcond/setcond arguments when possibleAurelien Jarno1-0/+18
brcond and setcond ops are not commutative, but it's easy to compute the new condition after swapping the arguments. Try to always put the constant argument in second position like for commutative ops, to help backends to generate better code. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: simplify shift/rot r, 0, a => movi r, 0 casesAurelien Jarno1-0/+20
shift/rot r, 0, a is equivalent to movi r, 0. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: simplify and r, a, 0 casesAurelien Jarno1-0/+1
and r, a, 0 is equivalent to a movi r, 0. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: simplify or/xor r, a, 0 casesAurelien Jarno1-0/+2
or/xor r, a, 0 is equivalent to a mov r, a. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: split expression simplificationAurelien Jarno1-1/+13
Split expression simplification in multiple parts so that a given op can appear multiple times. This patch should not change anything. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg: improve profilerAurelien Jarno2-1/+12
Now that there are two passes of optimization (optimize.c, liveness) there is no point of outputing the statistics of the liveness part only. Update the code to take into account both optimizations. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11xhci: allow bytewise capability register readsGerd Hoffmann1-1/+3
Some guests need this according to Alejandro Martinez Ruiz <alex@securiforest.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: kill xhci_mem_{read,write} dispatcher functionsGerd Hoffmann1-65/+75
... and register subregions instead, so we offload the dispatching to the the memory subsystem which is designed to handle it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: support multiple interruptersGerd Hoffmann1-5/+1
Everything is in place, flip the big switch now and enable support for multiple interrupters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: pick target interrupterGerd Hoffmann1-6/+16
Pick the correct interrupter when queuing an event. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: prepare xhci_runtime_{read,write} for multiple interruptersGerd Hoffmann1-43/+57
Prepare xhci runtime register access function for multiple interrupters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add XHCIInterrupterGerd Hoffmann2-148/+161
Move all state belonging to the (single) interrupter into a separate struct. First step in adding support for multiple interrupters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: move register update into xhci_intr_raiseGerd Hoffmann1-9/+5
Now that we have a separate function to raise an IRQ we can move some comon code into the function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add msix supportGerd Hoffmann2-1/+49
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: rework interrupt handlingGerd Hoffmann1-14/+33
Split xhci_irq_update into a function which handles intx updates (including lowering the irq line once the guests acks the interrupt) and one which is used for raising an irq only. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: fix & cleanup msi.Gerd Hoffmann1-18/+9
Drop custom write_config function which isn't needed any more. Make the msi property a bit property so it accepts 'on' & 'off'. Enable MSI by default. TODO: add compat property to disable on old machine types. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-storage: usb3 supportGerd Hoffmann1-3/+43
Add usb3 descriptors to usb-storage, so it shows up as superspeed device when connected to xhci. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb3: bos decriptorGerd Hoffmann4-0/+141
Add support for creating BOS descriptor and device cappability descriptors. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb3: superspeed endpoint companionGerd Hoffmann3-20/+62
Add support for building superspeed endpoint companion descriptors, create them for superspeed usb devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb3: superspeed descriptorsGerd Hoffmann2-1/+10
Add superspeed descriptor entry to USBDesc, advertise superspeed support when present. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: update port handlingGerd Hoffmann1-40/+97
This patch changes the way xhci ports are linked to USBPorts. The fixed 1:1 relationship between xhci ports and USBPorts is gone. Now each USBPort represents a physical plug which has usually two xhci ports assigned: one usb2 and ond usb3 port. usb devices show up at one or the other, depending on whenever they support superspeed or not. This patch also makes the number of usb2 and usb3 ports runtime configurable by adding 'p2' and 'p3' properties. It is allowed to have different numbers of usb2 and usb3 ports. Specifying p2=4,p3=2 will give you an xhci adapter which supports all speeds on physical ports 1+2 and usb2 only on ports 3+4.
2012-09-11xhci: update register layoutGerd Hoffmann1-8/+13
Change the register layout to be a bit more sparse and also not depend on the number of ports. Useful when for making the number of ports runtime-configurable.
2012-09-11xhci: fix runtime write tracepointGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add trace_usb_xhci_ep_set_dequeueGerd Hoffmann2-1/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: trace cc codes in cleartextGerd Hoffmann2-2/+48
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: iso xfer supportGerd Hoffmann1-16/+101
Add support for iso transfers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: implement mfindexGerd Hoffmann1-7/+46
Implement mfindex register and mfindex wrap event. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: move device lookup into xhci_setup_packetGerd Hoffmann1-36/+38
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: drop bufferingGerd Hoffmann2-115/+72
This patch splits the xhci_xfer_data function into three. The xhci_xfer_data function used to do does two things: (1) copy transfer data between guest memory and a temporary buffer. (2) report transfer results to the guest using events. Now we three functions to handle this: (1) xhci_xfer_map creates a scatter list for the transfer and uses that (instead of the temporary buffer) to build a USBPacket. (2) xhci_xfer_unmap undoes the mapping. (3) xhci_xfer_report sends out events. The patch also fixes reporting of transaction errors which must be reported unconditinally, not only in case the guest asks for it using the ISP flag. [ v2: fix warning ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: rip out background transfer codeGerd Hoffmann1-219/+4
original xhci code (the one which used libusb directly) used to use 'background transfers' for iso streams. In upstream qemu the iso stream buffering is handled by usb-host & usb-redir, so we will never ever need this. It has been left in as reference, but is dead code anyway. Rip it out. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-audio: fix usb versionGerd Hoffmann1-1/+1
usb-audio is a full speed (1.1) device, but bcdUSB claims it is usb 2.0. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11Better name usb braille deviceSamuel Thibault1-1/+1
Windows users need to know that they have to use the Baum driver to make the qemu braille device work. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Enable pipelining for bulk endpointsHans de Goede1-0/+3
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Ensure our peer has the necessary caps when redirecting to XHCIHans de Goede1-0/+11
In order for redirection to work properly when redirecting to an emulated XHCI controller, the usb-redir-host must support both usb_redir_cap_ep_info_max_packet_size and usb_redir_cap_64bits_ids, reject any devices redirected to an XHCI controller when these are not supported. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Add a usbredir_reject_device helper functionHans de Goede1-10/+11
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Set ep max_packet_size if availableHans de Goede1-0/+5
This is needed for usb-redir to work properly with the xhci emulation. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Convert to new libusbredirparser 0.5 APIHans de Goede2-32/+32
This gives us support for 64 bit ids which is needed for using XHCI with the new hcd generated ids. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Return babble when getting more bulk data then requestedHans de Goede1-3/+3
Babble is the appropriate error in this case (rather then signalling a stall). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Move to core packet id and queue handlingHans de Goede1-134/+92
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Get rid of unused async-struct dev memberHans de Goede1-2/+0
This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Get rid of local shadow copy of packet headersHans de Goede1-27/+0
The shadow copy only serves as an extra check (besides the packet-id) to ensure the packet we get back is a reply to the packet we think it is. This check has never triggered in all the time usb-redir is in use now, and since the verified data in the returned packet-header is not used otherwise, removing the check does not open any possibilities for the usbredirhost to confuse us. This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Get rid of async-struct get memberHans de Goede1-6/+3
This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Don't delay handling of open events to a bottom halfHans de Goede1-47/+53
There is no need for this, and doing so means that a backend trying to write immediately after an open event will see qemu_chr_be_can_write returning 0, which not all backends handle well as there is no wakeup mechanism to detect when the frontend does become writable. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-redir: Never return USB_RET_NAK for async handled packetsHans de Goede1-3/+6
USB_RET_NAK is not a valid response for async handled packets (and will trigger an assert as such). Also drop the warning when receiving a status of cancelled for packets not cancelled by qemu itself, this can happen when a device gets unredirected by the usbredir-host while transfers are pending. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>