1. 14 10月, 2016 8 次提交
  2. 13 10月, 2016 17 次提交
  3. 12 10月, 2016 15 次提交
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20161012-1' into staging · c264a880
      Peter Maydell 提交于
      various usb bugfixes
      some xhci cleanups
      
      # gpg: Signature made Wed 12 Oct 2016 13:38:27 BST
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/pull-usb-20161012-1:
        usb-redir: allocate buffers before waking up the host adapter
        usb: Fix incorrect default DMA offset.
        usb: fix serial generator
        xhci: make xhci_epid_to_usbep accept XHCIEPContext
        xhci: drop XHCITransfer->{slotid,epid}
        xhci: add & use xhci_kick_epctx()
        xhci: drop XHCITransfer->xhci
        xhci: use linked list for transfers
        xhci: drop unused comp_xfer field
        xhci: decouple EV_QUEUE from TD_QUEUE
        xhci: limit the number of link trbs we are willing to process
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c264a880
    • H
      usb-redir: allocate buffers before waking up the host adapter · d5c42857
      Hans de Goede 提交于
      Needed to make sure usb redirection is prepared to actually handle the
      callback from the usb host adapter.  Without this interrupt endpoints
      don't work on xhci.
      
      Note: On ehci the usb_wakeup() call only schedules a BH for the actual
      work, which hides this bug because the allocation happens before ehci
      calls back even without this patch.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Message-id: 1476096313-7730-1-git-send-email-kraxel@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d5c42857
    • V
      usb: Fix incorrect default DMA offset. · 6998b6c7
      Vijay Kumar B 提交于
      The default DMA offset is set to 3. When the property is not set by
      the consumer, the default causes DMA access to be shifted by 3
      bytes. In PXA, this results in incorrect DMA access, leading to error
      notification in the USB controller driver. A better default would be
      0, so that there is no offset, when the consumer does not specify one.
      Signed-off-by: NVijay Kumar B. <vijaykumar@zilogic.com>
      Reviewed-by: NDeepak S. <deepak@zilogic.com>
      Message-id: 1475060958-7760-1-git-send-email-vijaykumar@zilogic.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      6998b6c7
    • G
      usb: fix serial generator · 0136464d
      Gerd Hoffmann 提交于
      snprintf return value is *not* the number of chars written into the
      buffer, but the number of chars needed.  So in case the buffer is too
      small you can go alloc a bigger one and try again.  But that also means
      you can't simply use the return value for the next snprintf call
      without checking beforehand that things did actually fit.
      
      Problem is that usb_desc_create_serial didn't perform that check, so a
      loooong path string (can happen with deep pci-bridge nesting) results in
      the third snprintf call smashing the stack.
      
      Fix this by throwing out all the snpintf calls and use g_strdup_printf
      instead.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1381630Reported-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1475659998-22045-1-git-send-email-kraxel@redhat.com
      0136464d
    • G
      xhci: make xhci_epid_to_usbep accept XHCIEPContext · 070eeef9
      Gerd Hoffmann 提交于
      All callsites have a XHCIEPContext pointer anyway, so we can just pass
      it directly instead of fiddeling with slotid and epid.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-9-git-send-email-kraxel@redhat.com
      070eeef9
    • G
      xhci: drop XHCITransfer->{slotid,epid} · d6fcb293
      Gerd Hoffmann 提交于
      We can use XHCITransfer->epctx->{slotid,epid} instead.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-8-git-send-email-kraxel@redhat.com
      d6fcb293
    • G
      xhci: add & use xhci_kick_epctx() · 3a533ee8
      Gerd Hoffmann 提交于
      xhci_kick_epctx is a xhci_kick_ep variant which takes an XHCIEPContext
      as input instead of slotid and epid.  So in case we have a XHCIEPContext
      at hand at the callsite we can just pass it directly.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-7-git-send-email-kraxel@redhat.com
      3a533ee8
    • G
      xhci: drop XHCITransfer->xhci · 5612564e
      Gerd Hoffmann 提交于
      Use XHCITransfer->epctx->xhci instead.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-6-git-send-email-kraxel@redhat.com
      5612564e
    • G
      xhci: use linked list for transfers · 94b037f2
      Gerd Hoffmann 提交于
      xhci has a fixed number of 24 (TD_QUEUE) XHCITransfer structs per
      endpoint, which turns out to be a problem for usb3 devices with 32 (or
      more) bulk streams.  xhci re-checks the trb rings on every finished
      transfer to make sure it'll pick up any pending work.  But that scheme
      breaks in case the first transfer of a ring can't be started because we
      ran out of XHCITransfer structs already.
      
      So remove static XHCITransfer array from XHCIEPContext.  Use a linked
      list instead, and allocate/free XHCITransfer as needed.  Add helper
      functions to allocate & initialize and to cleanup & release
      XHCITransfer structs.  That also simplifies trb management, we never
      have to realloc XHCITransfer->trbs because we don't reuse XHCITransfer
      structs any more.
      
      New dynamic limit for in-flight xhci transfers per endpoint is
      number-of-streams + 16.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-5-git-send-email-kraxel@redhat.com
      94b037f2
    • G
      xhci: drop unused comp_xfer field · 7512b13d
      Gerd Hoffmann 提交于
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-4-git-send-email-kraxel@redhat.com
      7512b13d
    • G
      xhci: decouple EV_QUEUE from TD_QUEUE · 1fe163fe
      Gerd Hoffmann 提交于
      EV_QUEUE must not change because an array of that size is part of live
      migration data.  Hard-code current value there, so we can touch TD_QUEUE
      without breaking live migration.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1474965172-30321-3-git-send-email-kraxel@redhat.com
      1fe163fe
    • G
      xhci: limit the number of link trbs we are willing to process · 05f43d44
      Gerd Hoffmann 提交于
      Needed to avoid we run in circles forever in case the guest builds
      an endless loop with link trbs.
      Reported-by: NLi Qiang <liqiang6-s@360.cn>
      Tested-by: NP J P <ppandit@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1476096382-7981-1-git-send-email-kraxel@redhat.com
      05f43d44
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging · ae4b28ac
      Peter Maydell 提交于
      # gpg: Signature made Wed 12 Oct 2016 09:43:03 BST
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/tracing-pull-request:
        trace: Add missing execution mode of guest events
        trace: introduce a formal group name for trace events
        trace: pass trace-events to tracetool as a positional param
        trace: push reading of events up a level to tracetool main
        trace: rename _read_events to read_events
        trace: get rid of generated-events.h/generated-events.c
        trace: dynamically allocate event IDs at runtime
        trace: dynamically allocate trace_dstate in CPUState
        trace: provide mechanism for registering trace events
        trace: don't abort qemu if ftrace can't be initialized
        trace: emit name <-> ID mapping in simpletrace header
        trace: remove the TraceEventID and TraceEventVCPUID enums
        trace: give each trace event a named TraceEvent struct
        trace: break circular dependency in event-internal.h
        trace: remove duplicate control.h includes in generated-tracers.h
        trace: remove global 'uint16 dstate[]' array
        trace: remove some now unused functions
        trace: convert code to use event iterators
        trace: add trace event iterator APIs
        trace: move colo trace events to net/ sub-directory
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ae4b28ac
    • L
      trace: Add missing execution mode of guest events · f5e2b3be
      Lluís Vilanova 提交于
      Add missing execution mode documentation for the 'guest_cpu_enter' and
      'guest_cpu_reset' events.
      Signed-off-by: NLluís Vilanova <vilanova@ac.upc.edu>
      Message-id: 147566900921.7708.656450813307396468.stgit@fimbulvetr.bsc.es
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      f5e2b3be
    • D
      trace: introduce a formal group name for trace events · 80dd5c49
      Daniel P. Berrange 提交于
      The declarations in the generated-tracers.h file are
      assuming there's only ever going to be one instance
      of this header, as they are not namespaced. When we
      have one header per event group, if a single source
      file needs to include multiple sets of trace events,
      the symbols will all clash.
      
      This change thus introduces a '--group NAME' arg to the
      'tracetool' program. This will cause all the symbols in
      the generated header files to be given a unique namespace.
      
      If no group is given, the group name 'common' is used,
      which is suitable for the current usage where there is
      only one global trace-events file used for code generation.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NLluís Vilanova <vilanova@ac.upc.edu>
      Message-id: 1475588159-30598-21-git-send-email-berrange@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      80dd5c49