summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* net/cadence_gem: Don't rx packets when no rx buffer availablePeter Crosthwaite2013-12-101-1/+10
| | | | | | | | | Return false from can_receive() when no valid buffer descriptor is available. Ensures against mass packet droppage in some applications. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: cde00ef774e84e2586bf10fd37b542f75bf36cfb.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Improve can_receive debug printferyPeter Crosthwaite2013-12-101-2/+10
| | | | | | | | | | | | Currently this just floods indicating that can_receive has been called by the net framework. Instead, save the result of the most recent can_receive callback as state and only print a message if the result changes (indicating some sort of actual state change in GEM). Make said debug message more meaningful as well. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 2eb74ca6a5756aea242d9f525961db95d6cfcf2c.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Fix register w1c logicPeter Crosthwaite2013-12-101-7/+6
| | | | | | | | | | | This write-1-clear logic was incorrect. It was always clearing w1c bits regardless of whether the written value was 1 or not. i.e. it was implementing a write-anything-to-clear strategy. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: ed905b04d3343966ded425f06aa2224bc7a35b59.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Fix small packet FCS strippingPeter Crosthwaite2013-12-101-5/+8
| | | | | | | | | | The minimum packet size is 64, however this is before FCS stripping occurs. So when FCS stripping the minimum packet size is 60. Fix. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 8aac5bd737f9cf48b87f32943d7eb5939061e546.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Fix rx multi-fragment packetsPeter Crosthwaite2013-12-101-1/+1
| | | | | | | | | | | | | Bytes_to_copy was being updated before its final use where it advances the rx buffer pointer. This was causing total mayhem, where packet data for any subsequent fragments was being fetched from the wrong place. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: c2a1c65c1fd06eb274442a0fa4a6839d940e145e.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Add missing VMSTATE_END_OF_LISTPeter Crosthwaite2013-12-101-0/+1
| | | | | | Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 8f8c2bfb15f40fb5f0d5766aa4cd3d54c596de6a.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Implement SAR (de)activationPeter Crosthwaite2013-12-101-4/+23
| | | | | | | | | | | | The Specific address registers can be enabled or disabled by software. QEMU was assuming they were always enabled. Implement the disable/enable feature. SARs are disabled by writing to the lower half register. They are re-enabled by then writing the upper half. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 49efd1f7450af8f980b967d3054245bae137866c.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Implement SAR match bit in rx descPeter Crosthwaite2013-12-101-0/+2
| | | | | | | | | | | | | | Bit 27 of the RX buffer desc word 1 should be set when the packet was accepted due to specific address register match. Implement. This feature is absent from the Xilinx documentation (UG585) but the behaviour is tested as accurate on real hardware. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 7e3f26fc4ab244e8123efc12723e7164730abdcb.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Implement RX descriptor match mode flagsPeter Crosthwaite2013-12-101-13/+69
| | | | | | | | | | The various Rx packet address matching mode flags were not being set in the rx descriptor. Implement. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 6002a24a6a8ceaa11d3009ab5392840d1c084b28.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Prefetch rx descriptors ASAPPeter Crosthwaite2013-12-101-27/+35
| | | | | | | | | | | The real hardware prefetches rx buffer descriptors ASAP and potentially throws relevant interrupts following the fetch even in the absence of a received packet. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 41629e35edfdb1f02f1e401f2c3d0e2e4c9e44b3.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: simplify rx buf descriptor walkingPeter Crosthwaite2013-12-101-28/+9
| | | | | | | | | | There was a replication of the rx descriptor address walking logic. Reorder the flow control to remove. This refactoring also obsoletes the local variables packet_desc_addr and last_desc_addr. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 2a425b457ff0b57274bf206ad2236690cd7f5909.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Don't assert against 0 buffer addressPeter Crosthwaite2013-12-101-9/+0
| | | | | | | | | This has no real hardware analog and asserting correctness of DMA addresses is not a perhiperal level problem. Delete. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: fc02417eb1874cb05e4f20531c6203c5a00110f1.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Update DMA rx descriptors as we process themEdgar E. Iglesias2013-12-101-17/+16
| | | | | | | | | | | We were updating the ownership bit of all descriptors if packets get split and written through several descriptors. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: d61b7847b51487118783c93765a485bc5c66d272.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* net/cadence_gem: Implement mac level loopback modePeter Crosthwaite2013-12-101-1/+1
| | | | | | | | | | | Cadence GEM has a MAC level loopback mode. Implement. Use the same basic operation as the already implemented PHY loopback. Reported-by: Deepika Dhamija <deepika@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 3a0baf1b6b2fc1be638bdf1a37408ec38988e970.1386136219.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/arm/virt: Support -cpu hostPeter Maydell2013-12-101-0/+8
| | | | | | | | | Support -cpu host in virt machine (treating it like an A15, ie with a GIC v2 and the A15's private peripherals.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Message-id: 1385140638-10444-12-git-send-email-peter.maydell@linaro.org
* hw/arm: Add 'virt' platformPeter Maydell2013-12-102-1/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'virt' platform support corresponding to arch/arm/mach-virt in the Linux kernel tree. This has no platform-specific code but can use any device whose kernel driver is is able to work purely from a device tree node. We use this to instantiate a minimal set of devices: a GIC and some virtio-mmio transports. Signed-off-by: John Rigby <john.rigby@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Message-id: 1385140638-10444-8-git-send-email-peter.maydell@linaro.org [PMM: Significantly overhauled: * renamed user-facing machine to just "virt" * removed the A9 support (it can't work since the A9 has no generic timers) * added virtio-mmio transports instead of random set of 'soc' devices (though we retain a pl011 UART) * instead of updating io_base as we step through adding devices, define a memory map with an array (similar to vexpress) * similarly, define irqmap with an array * folded in some minor fixes from John's aarch64-support patch * rather than explicitly doing endian-swapping on FDT cells, use fdt APIs that let us just pass in host-endian values and let the fdt layer take care of the swapping * miscellaneous minor code cleanups and style fixes ] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/arm/boot: Allow boards to provide an fdt blobJohn Rigby2013-12-101-12/+20
| | | | | | | | | | | | If no fdt is provided on command line and the new field get_dtb in struct arm_boot_info is set then call it to get a device tree blob. Signed-off-by: John Rigby <john.rigby@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Message-id: 1385140638-10444-4-git-send-email-peter.maydell@linaro.org [PMM: minor tweaks and cleanup] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* cpu/a9mpcore: Add Global TimerFrançois LEGAL2013-12-101-5/+21
| | | | | | | | | | | | | | | | Add the global timer to A9 MPCore. Signed-off-by: François LEGAL <devel@thom.fr.eu.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: ff92f35f438ac671b57d99d823723dd3e62d2c49.1385969450.git.peter.crosthwaite@xilinx.com [PC Changes: * new commit message * split off original version as a separate patch * Rebased against new mpcore implementation (with struct embedding) ] Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/timer: Introduce ARM A9 Global Timer.Peter Crosthwaite2013-12-102-0/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ARM A9 MPCore has a timer that is global to all cores in the cluster. The timer is shared but each core has a private independent comparator and interrupt. Based on version contributed by Francois LEGAL. Signed-off-by: François LEGAL <devel@thom.fr.eu.org> Message-id: 4918e89476b8da916be2964ec41578b50d569a37.1385969450.git.peter.crosthwaite@xilinx.com [PC changes: * New commit message * Re-implemented as single timer model * Fixed backwards counting issue in polled mode * completed VMSD fields * macroified magic numbers (and headerified reg definitions) * split of as device-model-only patch * use bitops for 64 bit register access * Fixed auto increment mode to check condition properly * general cleanup (names/style etc). ] Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [PMM: * minor typo fixes * added missing return after error_setg() * dropped setting dc->no_user = 1 ] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* cpu/a9mpcore: reorder operations/declarationsPeter Crosthwaite2013-12-101-14/+14
| | | | | | | | | | | | | | | | | To make it consistent for easier code reading. The order in which variables are defined and functions are called is set to match the address map ordering. The new consistent order of doing stuff is: SCU -> GIC -> MPTimer -> WDT. 0 functional change. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 8f31398e6d9a93f57291399f269039da1a77a2b5.1385969450.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* cpu/a9mpcore: rename timerbusdev variablePeter Crosthwaite2013-12-101-4/+4
| | | | | | | | | | Rename this variable for consistency with the above defined mptimerdev variable. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 28939ef95589a62414634e86c47cef76b21b15f7.1385969450.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* integrator/cp: add support for REFCNT registerJan Petrous2013-12-101-3/+10
| | | | | | | | | | Linux kernel from version 3.4 requires CM_REFCNT register for sched timer for Integrator/CP board (integrator_defconfig). See http://infocenter.arm.com/help/topic/com.arm.doc.dui0138e/ch04s06s11.html Signed-off-by: Jan Petrous <jan.petrous@tieto.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20131206.0' ↵Anthony Liguori2013-12-071-5/+128
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging vfio-pci updates include: - Update linux-headers to include KVM-VFIO device support - Enable QEMU support for KVM-VFIO device - Additional Nvidia x-vga quirk to ACK MSI interrupts - Debug options to disable MSI/X KVM acceleration - Fix to cleanup MSI-X vectors on shutdown and avoid IRQ route leaks The KVM-VFIO device support enables KVM to manage how it handles coherency instructions in the presence of non-coherent I/O. Dave Airlie had noted that the Nvidia MSI ACK support here may just be scratching the surface, but it's better than what we have now and it's only enabled via the x-vga option, so I'm willing to add since it does enable some users. # gpg: Signature made Fri 06 Dec 2013 12:28:19 PM PST using RSA key ID 3BB08B22 # gpg: Can't check signature: public key not found # By Alex Williamson # Via Alex Williamson * awilliam/tags/vfio-pci-for-qemu-20131206.0: vfio-pci: Release all MSI-X vectors when disabled vfio-pci: Add debug config options to disable MSI/X KVM support vfio-pci: Fix Nvidia MSI ACK through 0x88000 quirk vfio-pci: Make use of new KVM-VFIO device linux-headers: Update from v3.13-rc3 Message-id: 20131206204715.16731.12627.stgit@bling.home Signed-off-by: Anthony Liguori <aliguori@amazon.com>
| * vfio-pci: Release all MSI-X vectors when disabledAlex Williamson2013-12-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | We were relying on msix_unset_vector_notifiers() to release all the vectors when we disable MSI-X, but this only happens when MSI-X is still enabled on the device. Perform further cleanup by releasing any remaining vectors listed as in-use after this call. This caused a leak of IRQ routes on hotplug depending on how the guest OS prepared the device for removal. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Cc: qemu-stable@nongnu.org
| * vfio-pci: Add debug config options to disable MSI/X KVM supportAlex Williamson2013-12-061-4/+20
| | | | | | | | | | | | | | It's sometimes useful to be able to verify interrupts are passing through correctly. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio-pci: Fix Nvidia MSI ACK through 0x88000 quirkAlex Williamson2013-12-061-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | When MSI is enabled on Nvidia GeForce cards the driver seems to acknowledge the interrupt by writing a 0xff byte to the MSI capability ID register using the PCI config space mirror at offset 0x88000 from BAR0. Without this, the device will only fire a single interrupt. VFIO handles the PCI capability ID/next registers as virtual w/o write support, so any write through config space is currently dropped. Add a check for this and allow the write through the BAR window. The registers are read-only anyway. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio-pci: Make use of new KVM-VFIO deviceAlex Williamson2013-12-061-0/+67
| | | | | | | | | | | | | | | | Add and remove groups from the KVM virtual VFIO device as we make use of them. This allows KVM to optimize for performance and correctness based on properties of the group. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* | Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori2013-12-071-23/+131
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Paolo Bonzini (17) and others # Via Stefan Hajnoczi * stefanha/block: (48 commits) qemu-iotests: filter QEMU monitor \r\n aio: make aio_poll(ctx, true) block with no fds block: clean up bdrv_drain_all() throttling comments qcow2: use start_of_cluster() and offset_into_cluster() everywhere qemu-img: decrease progress update interval on convert qemu-img: round down request length to an aligned sector qemu-img: dynamically adjust iobuffer size during convert block/iscsi: set bs->bl.opt_transfer_length block: add opt_transfer_length to BlockLimits block/iscsi: set bdi->cluster_size qemu-img: fix usage instruction for qemu-img convert qemu-img: add support for skipping zeroes in input during convert qemu-nbd: add doc for option -f qemu-iotests: add test for snapshot in qemu-img convert qemu-img: add -l for snapshot in convert qemu-iotests: add 058 internal snapshot export with qemu-nbd case qemu-nbd: support internal snapshot export snapshot: distinguish id and name in load_tmp qemu-iotests: Split qcow2 only cases in 048 qemu-iotests: Clean up spaces in usage output ... Message-id: 1386347807-27359-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
| * | scsi-disk: correctly implement WRITE SAMEPaolo Bonzini2013-12-031-24/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fetch the data to be written from the input buffer. If it is all zeroes, we can use the write_zeroes call (possibly with the new MAY_UNMAP flag). Otherwise, do as many write cycles as needed, writing 512k at a time. Strictly speaking, this is still incorrect because a zero cluster should only be written if the MAY_UNMAP flag is set. But this is a bug in qcow2 and the other formats, not in the SCSI code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commandsPaolo Bonzini2013-12-031-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we report ANC_SUP==0 in VPD page B2h, we need to return an error (ILLEGAL REQUEST/INVALID FIELD IN CDB) for all WRITE SAME requests with ANCHOR==1. Inspired by a similar patch to the LIO in-kernel target. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | scsi-disk: catch write protection errors in UNMAPPaolo Bonzini2013-12-031-0/+6
| |/ | | | | | | | | | | | | This is the same that is already done for WRITE SAME. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | Merge remote-tracking branch 'kraxel/tags/pull-seabios-31b8b4e-1' into stagingAnthony Liguori2013-12-072-3/+26
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update seabios to master snapshot (pre-1.7.4). Update vgabios, switch from lgplvgabios to seavgabios. Update build process to build both 128k and 256k bios versions. Use 256k bios for pc-*-2.0+ machine types. # gpg: Signature made Fri 06 Dec 2013 12:01:24 AM PST using RSA key ID D3E87138 # gpg: Can't check signature: public key not found # By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/tags/pull-seabios-31b8b4e-1: pc: switch 2.0 machine types to large seabios binary roms: update vgabios binaries roms: update seabios binaries roms: enable seabios cross builds roms: build two seabios binaries roms: update seabios submodule to 31b8b4eea9d9ad58a73b22a6060d3ac1c419c26d add firmware to machine options add pc-{i440fx,q35}-2.0 machine types Message-id: 1386322527-23148-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
| * | pc: switch 2.0 machine types to large seabios binaryGerd Hoffmann2013-12-062-2/+6
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | add pc-{i440fx,q35}-2.0 machine typesGerd Hoffmann2013-12-022-3/+22
| |/ | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'sstabellini/xen-2013-12-01' into stagingAnthony Liguori2013-12-062-2/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Paul Durrant (1) and Wei Liu (1) # Via Stefano Stabellini * sstabellini/xen-2013-12-01: xen-pvdevice: make device-id property compulsory xen: fix two errors when debug is enabled Message-id: alpine.DEB.2.02.1312011829000.3198@kaball.uk.xensource.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
| * | xen-pvdevice: make device-id property compulsoryPaul Durrant2013-12-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intention of the Xen PV device is that it is used as a parent device for PV drivers in Xen HVM guests and the set of PV drivers that bind to the device is determined by its device ID (and possibly vendor ID and revision). As such, the device should not have a default device ID, it should always be supplied by the Xen toolstack. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| * | xen: fix two errors when debug is enabledWei Liu2013-12-011-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes: 1. build error in xen_pt.c when XEN_PT_LOGGING_ENABLED is defined 2. debug output format string error when DEBUG_XEN is defined In the second case I also have the output info in consistent with the output in mapping function - that is, print start_addr instead of phys_offset. Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* | Merge remote-tracking branch 'kraxel/tags/pull-usb-1' into stagingAnthony Liguori2013-12-069-87/+300
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improvements for usb3 bulk stream (usb core, xhci). Bugfixes for uas emulation. Add remote wakeup support for ehci. Add suspend support for xhci. Misc minor tweaks and fixes. # gpg: Signature made Thu 28 Nov 2013 11:44:49 PM PST using RSA key ID D3E87138 # gpg: Can't check signature: public key not found # By Hans de Goede (11) and others # Via Gerd Hoffmann * kraxel/tags/pull-usb-1: usb: move usb_{hi,lo} helpers to header file. usb: add vendor request defines trace-events: Clean up after removal of old usb-host code Revert "usb-tablet: Don't claim wakeup capability for USB-2 version" ehci: implement port wakeup xhci: Call usb_device_alloc/free_streams usb: Add usb_device_alloc/free_streams usb: Add max_streams attribute to endpoint info uas: s/ui/iu/ uas: Fix response iu struct definition uas: Bounds check tags when using streams uas: Streams are numbered 1-y, rather then 0-x uas: Fix / cleanup usb_uas_task error handling uas: Only use report iu-s for task_mgmt status reporting scsi: Add 2 new sense codes needed by uas xhci: add support for suspend/resume xhci: Add a few missing checks for disconnected devices Message-id: 1385712381-30918-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
| * | usb: move usb_{hi,lo} helpers to header file.Gerd Hoffmann2013-11-282-10/+11
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | Revert "usb-tablet: Don't claim wakeup capability for USB-2 version"Gerd Hoffmann2013-11-281-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit aa1c9e971e80d25b92908dce3dec7c38b49480ea. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | ehci: implement port wakeupGerd Hoffmann2013-11-281-2/+16
| | | | | | | | | | | | | | | | | | | | | Update portsc register and raise irq in case a suspended port is woken up, so remote wakeup works on our ehci ports. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | xhci: Call usb_device_alloc/free_streamsHans de Goede2013-11-261-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note this code is not as KISS as I would like, the reason for this is that the Linux kernel interface wants streams on eps belonging to one interface to be allocated in one call. Things will also work if we do this one ep at a time (as long as all eps support the same amount of streams), but lets stick to the kernel API. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: Add usb_device_alloc/free_streamsHans de Goede2013-11-261-0/+18
| | | | | | | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: Add max_streams attribute to endpoint infoHans de Goede2013-11-262-0/+24
| | | | | | | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | uas: s/ui/iu/Hans de Goede2013-11-261-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | The various uas data structures are called IU-s, which is short for Information Unit, rather then UI-s. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | uas: Fix response iu struct definitionHans de Goede2013-11-261-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch mirrors a patch to the Linux uas kernel driver which I've just submitted. It looks like the qemu uas struct definitions were taken from the Linux kernel driver, and have inherited the same mistake. Besides fixing the response iu struct, the patch also drops the add_info parameter from the usb_uas_queue_response() function, it is always 0 anyways, and expressing 3 zero-bytes as a function argument is a bit hard. Below is the long explanation for this change taken from the kernel commit: The response iu struct before this patch has a size of 7 bytes, which is weird since all other iu-s are explictly padded to a multiple of 4 bytes. Submitting a 7 byte bulk transfer to the status endpoint of a real uasp device when expecting a response iu results in an USB babble error, as the device actually sends 8 bytes. Up on closer reading of the UAS spec: http://www.t10.org/cgi-bin/ac.pl?t=f&f=uas2r00.pdf The reason for this becomes clear, the 2 entries in "Table 17 — RESPONSE IU" are numbered 4 and 6, looking at other iu definitions in the spec, esp. multi-byte fields, this indicates that the ADDITIONAL RESPONSE INFORMATION field is not a 2 byte field as one might assume at a first look, but is a multi-byte field containing 3 bytes. This also aligns with the SCSI Architecture Model 4 spec, which UAS is based on which states in paragraph "7.1 Task management function procedure calls" that the "Additional Response Information" output argument for a Task management function procedure call is 3 bytes. Last but not least I've verified this by sending a logical unit reset task management call with an invalid lun to an actual uasp device, and received back a response-iu with byte 6 being 0, and byte 7 being 9, which is the responce code for an invalid iu, which confirms that the response code is being reported in byte 7 of the response iu rather then in byte 6. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | uas: Bounds check tags when using streamsHans de Goede2013-11-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Disallow the guest to cause us to address the data3 and status3 arrays out of bounds. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | uas: Streams are numbered 1-y, rather then 0-xHans de Goede2013-11-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | It is easier to simply make the arrays one larger, rather then substracting one everywhere. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | uas: Fix / cleanup usb_uas_task error handlingHans de Goede2013-11-261-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -The correct error if we cannot find the dev is INCORRECT_LUN rather then INVALID_INFO_UNIT -Move the device not found check to the top so we only need to do it once -Remove the dev->lun != lun checks, dev is returned by scsi_device_find which searches by lun, so this will never trigger Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | uas: Only use report iu-s for task_mgmt status reportingHans de Goede2013-11-261-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | Regular scsi cmds should always report their status using a sense-iu, using the sense code to report any errors. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud