summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | virtio-net: test peer header support at init timeMichael S. Tsirkin2012-10-291-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to query header support at random times: at load or feature query. Driver also might not query functions. Cleaner to do it at device init. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: minor code simplificationMichael S. Tsirkin2012-10-291-3/+1
| | | | | | | | | | | | | | | | | | | | | During packet filtering, we can now use host hdr len to offset incoming buffer unconditionally. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: simplify rx codeMichael S. Tsirkin2012-10-291-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | Remove code duplication using guest header length that we track. Drop specific layout requirement for rx buffers: things work using generic iovec functions in any case. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: switch tx to safe iov functionsMichael S. Tsirkin2012-10-291-12/+19
| | | | | | | | | | | | | | | | | | | | | Avoid mangling iovec manually: use safe iov_* functions. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: first s/g is always at start of bufMichael S. Tsirkin2012-10-291-2/+3
| | | | | | | | | | | | | | | | | | We know offset is 0, assert that. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: refactor receive_hdrMichael S. Tsirkin2012-10-291-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | Now that we know host hdr length, we don't need to duplicate the logic in receive_hdr: caller can figure out the offset itself. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: use safe iov operations for rxMichael S. Tsirkin2012-10-291-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid magling iov manually: use safe iov operations for processing packets incoming to guest. This also removes the requirement for virtio header to fit the first s/g entry exactly. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: avoid sg copyMichael S. Tsirkin2012-10-291-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid tweaking iovec during receive. This removes the need to copy the vector. Note: we currently have an evil cast in work_around_broken_dhclient and unfortunately this patch does not fix it - just pushes the evil cast to another place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | iov: add iov_cpyMichael S. Tsirkin2012-10-292-0/+32
| | | | | | | | | | | | | | | | | | Add API to copy part of iovec safely. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: track host/guest header lengthMichael S. Tsirkin2012-10-291-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | Tracking these in device state instead of re-calculating on each packet. No functional changes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pcie: Convert PCIExpressHost to use the QOM.Jason Baron2012-10-292-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let's use PCIExpressHost with QOM. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pcie: pass pcie window size to pcie_host_mmcfg_update()Jason Baron2012-10-292-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | This allows q35 to pass/set the size of the pcie window in its update routine. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: Add class 0xc05 as 'SMBus'Jan Kiszka2012-10-292-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | [jbaron@redhat.com: add PCI_CLASS_SERIAL_SMBUS definition] Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: introduce pci_swizzle_map_irq_fn() for standardized interrupt pin swizzleIsaku Yamahata2012-10-292-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce pci_swizzle_map_irq_fn() for interrupt pin swizzle which is standardized. PCI bridge swizzle is common logic, by introducing this function duplicated swizzle logic will be avoided later. [jbaron@redhat.com: drop opaque argument] Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci_ids: add intel 82801BA pci-to-pci bridge idIsaku Yamahata2012-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds pci id constants which will be used by q35. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: pci capability must be in PCI spaceIsaku Yamahata2012-10-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci capability must be in PCI space. It can't lay in PCIe extended config space. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: make each capability DWORD alignedMichael S. Tsirkin2012-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | PCI spec (see e.g. 6.7 Capabilities List in spec rev 3.0) requires that each capability is DWORD aligned. Ensure this when allocating space by rounding size up to 4. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | qemu: enable PV EOI for qemu 1.3Michael S. Tsirkin2012-10-293-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | Enable KVM PV EOI by default. You can still disable it with -kvm_pv_eoi cpu flag. To avoid breaking cross-version migration, enable only for qemu 1.3 (or in the future, newer) machine type. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: Return PCI_INTX_DISABLED when no bus INTx routing supportAlex Williamson2012-10-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than assert, simply return PCI_INTX_DISABLED when we don't have a pci_route_irq_fn. PIIX already returns DISABLED for an invalid pin, so users already deal with this state. Users of this interface should only be acting on an ENABLED or INVERTED return value (though we really have no support for INVERTED). Also complain loudly when we hit this so we don't forget it's missing. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
| * | pci-assign: Use msi_get_message()Alex Williamson2012-10-291-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | pci-assign only uses a subset of the flexibility msi_get_message() provides, but it's still worthwhile to use it. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | msi: Add msi_get_message()Alex Williamson2012-10-292-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | vfio-pci and pci-assign both do this on their own for setting up direct MSI injection through KVM. Provide a helper function for this in MSI code. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci-assign: Use pci_intx_route_changed()Alex Williamson2012-10-291-2/+1
| | | | | | | | | | | | | | | | | | | | | Replace open coded version Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: Helper function for testing if an INTx route changedAlex Williamson2012-10-292-0/+6
| | | | | | | | | | | | | | | Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | | pci: avoid destroying bridge address space windows in a transactionAvi Kivity2012-10-292-30/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling memory_region_destroy() in a transaction is illegal (and aborts), as until the transaction is committed, the region remains live. Fix by moving destruction until after the transaction commits. This requires having an extra set of regions, so the new and old regions can coexist. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | Merge remote-tracking branch 'kraxel/usb.68' into stagingAnthony Liguori2012-10-2911-328/+425
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kraxel/usb.68: (36 commits) xhci: fix usb name in caps xhci: make number of interrupters and slots configurable xhci: allow disabling interrupters xhci: flush endpoint context unconditinally xhci: fix function name in error message uhci: Use only one queue for ctrl endpoints uhci: Retry to fill the queue while waiting for td completion uhci: Always mark a queue valid when we encounter it uhci: When the guest marks a pending td non-active, cancel the queue uhci: Detect guest td re-use uhci: Verify queue has not been changed by guest uhci: Immediately free queues on device disconnect uhci: Store ep in UHCIQueue uhci: Make uhci_fill_queue() actually operate on an UHCIQueue uhci: Add uhci_read_td() helper function uhci: Rename UHCIAsync->td to UHCIAsync->td_addr uhci: Move emptying of the queue's asyncs' queue to uhci_queue_free uhci: Drop unnecessary forward declaration of some static functions uhci: Don't retry on error uhci: cleanup: Add an unlink call to uhci_async_cancel() ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | | xhci: fix usb name in capsGerd Hoffmann2012-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Used to be "UTB" not "USB". Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | xhci: make number of interrupters and slots configurableGerd Hoffmann2012-10-251-31/+48
| | | | | | | | | | | | | | | | | | | | | | | | Add properties to tweak the numbers of available interrupters and slots. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | xhci: allow disabling interruptersGerd Hoffmann2012-10-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For secondary interrupters this is explicitly allowed in the specs. For the primary interrupter behavior is undefined, lets be friendly and allow disabling too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | xhci: flush endpoint context unconditinallyGerd Hoffmann2012-10-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not updating the endpoint context in case the state didn't change is wrong. Other context fields might have changed, for example the dequeue pointer in response to a CR_SET_TR_DEQUEUE command. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | xhci: fix function name in error messageGerd Hoffmann2012-10-251-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Use only one queue for ctrl endpointsHans de Goede2012-10-251-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ctrl endpoints use different pids for different phases of a control transfer, this patch makes us use only one queue for a ctrl ep, rather then 3. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Retry to fill the queue while waiting for td completionHans de Goede2012-10-251-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the guest is using multiple transfers to try and keep the usb bus busy / used at maximum efficiency, currently we would see / do the following: 1) submit transfer 1 to the device 2) submit transfer 2 to the device 3) report transfer 1 completion to guest 4) report transfer 2 completion to guest 5) submit transfer 1 to the device 6) report transfer 1 completion to guest 7) submit transfer 2 to the device 8) report transfer 2 completion to guest etc. So after the initial submission we would effectively only have 1 transfer in flight, rather then 2. This is caused by us not checking the queue for addition of new transfers by the guest (ie the resubmission of a recently finished transfer), while waiting for a pending transfer to complete. This patch does add a check for this, changing the sequence to: 1) submit transfer 1 to the device 2) submit transfer 2 to the device 3) report transfer 1 completion to guest 4) submit transfer 1 to the device 5) report transfer 2 completion to guest 6) submit transfer 2 to the device etc. Thus keeping 2 transfers in flight (most of the time, and always 1), as intended by the guest. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Always mark a queue valid when we encounter itHans de Goede2012-10-251-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch we would not mark a queue valid when its head was a non-active td. This causes us to misbehave in the following scenario: 1) queue with multiple input transfers queued 2) We hit some latency issue, causing qemu to get behind processing frames 3) When qemu gets to run again, it notices the first transfer ends short, marking the head td non-active 4) It now processes 32+ frames in a row without giving the guest a chance to run since it is behind 5) valid is decreased to 0, causing the queue to get cancelled also cancelling already queued up further input transfers 6) guest gets to run, notices the inactive td, cleanups up further tds from the short transfer, and lets the queue continue at the first td of the next input transfer 7) we re-start the queue, issuing the second input transfer for the *second* time, and any data read by the first time we issued it has been lost Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: When the guest marks a pending td non-active, cancel the queueHans de Goede2012-10-251-0/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Detect guest td re-useHans de Goede2012-10-251-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A td can be reused by the guest in a different queue, before we notice the original queue has been unlinked. So search for tds by addr only, detect guest td reuse, and cancel the original queue, this is necessary to keep our packet ids unique. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Verify queue has not been changed by guestHans de Goede2012-10-252-18/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the spec a guest can unlink a qh, and then as soon as frindex has changed by 1 since the unlink, assume it is idle and re-use it. However for various reasons, we cannot simply consider a qh as unlinked if we've not seen it for 1 frame. This means that it is possible for a guest to re-use / restart the queue while we still see its old state. This patch adds a safety check for this, and "early" retires queues when they were changed by the guest. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Immediately free queues on device disconnectHans de Goede2012-10-251-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to just cancel any in-flight packets, and then wait for validate-end to clean things up, we can simply clean things up immediately on device removal. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Store ep in UHCIQueueHans de Goede2012-10-251-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids the need to repeatedly lookup the device, and ep. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Make uhci_fill_queue() actually operate on an UHCIQueueHans de Goede2012-10-251-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And move its calling point to handle_td, this removes the ep_ret ugliness, and prepates the way for further cleanups in the follow-up patches in this patch-set. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Add uhci_read_td() helper functionHans de Goede2012-10-251-10/+11
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Rename UHCIAsync->td to UHCIAsync->td_addrHans de Goede2012-10-251-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use the name td both to refer to a UHCI_TD read from guest memory as well as to refer to the guest address where a td is stored, switch over to always use td_addr in the second case for consistency. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Move emptying of the queue's asyncs' queue to uhci_queue_freeHans de Goede2012-10-251-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup: all callers of uhci_queue_free first unconditionally cancel all remaining asyncs in the queue, so lets move this to uhci_queue_free(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Drop unnecessary forward declaration of some static functionsHans de Goede2012-10-251-3/+0
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: Don't retry on errorHans de Goede2012-10-251-43/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we are either dealing with emulated devices, where retrying is not going to help, or with redirected devices where the host OS will have already retried, don't bother retrying on failed transfers. Also move some common/indentical code out of all the error cases into the generic error path. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: cleanup: Add an unlink call to uhci_async_cancel()Hans de Goede2012-10-251-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All callers of uhci_async_cancel() call uhci_async_unlink() first, so lets move the unlink call to uhci_async_cancel() Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | uhci: No need to handle async completion of isoc packetsHans de Goede2012-10-251-26/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No devices ever return async for isoc endpoints and the core already enforces this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: Enforce iso endpoints never returing USB_RET_ASYNCHans de Goede2012-10-252-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ehci was already testing for this, and we depend in various places on no devices doing this, so lets move the check for this to the usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: Add an int_req flag to USBPacketHans de Goede2012-10-257-13/+27
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: Move short-not-ok handling to the coreHans de Goede2012-10-259-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a short-not-ok packet ending short, we should not advance the queue. Move enforcing this to the core, rather then handling it in the hcd code. This may result in the queue now actually containing multiple input packets (which would not happen before), and this requires special handling in combination with pipelining, so disable pipleining for input endpoints (for now). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | usb: Move clearing of queue on halt to the coreHans de Goede2012-10-255-31/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hcds which queue up more then one packet at once (uhci, ehci and xhci), must clear the queue after an error which has caused the queue to halt. Currently this is handled as a special case inside the hcd code, this patch instead adds an USB_RET_REMOVE_FROM_QUEUE packet result code, teaches the 3 hcds about this and moves the clearing of the queue on a halt into the USB core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud