1. 10 12月, 2018 1 次提交
    • G
      ehci: fix fetch qtd race · b7d3a7e1
      Gerd Hoffmann 提交于
      The token field contains the (guest-filled) state of the qtd, which
      indicates whenever the other fields are valid or not.  So make sure
      we read the token first, otherwise we may end up with an stale next
      pointer:
      
        (1) ehci reads next
        (2) guest writes next
        (3) guest writes token
        (4) ehci reads token
        (5) ehci operates with stale next.
      
      Typical effect is that qemu doesn't notice that the guest appends new
      qtds to the end of the queue.  Looks like the usb device stopped
      responding.  Linux can recover from that, but leaves a message in the
      kernel log that it did reset the usb device in question.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20181126100836.8805-1-kraxel@redhat.com
      b7d3a7e1
  2. 03 7月, 2018 1 次提交
    • S
      ehci: Don't fetch a NULL current qtd but advance the queue instead. · 8bb01b25
      Sebastian Bauer 提交于
      Fetching qtd with the NULL address most likely makes no sense so from now
      on, we handle it this case similarly as if the terminate (T) bit is not
      set, which is already an exception as according to section 3.6 of the EHCI
      spec there is no T bit defined for the current_qtd field.
      
      The spec is a bit vague on how an EHCI driver should initialize these
      fields: "The general operational model is that the host controller can
      detect whether the overlay area contains a description of an active
      transfer" (p. 49). QEMU primarily uses the QTD_TOKEN_ACTIVE bit of the
      queue header to infer the activity state but there are other ways
      conceivable.
      
      This change allows QEMU to boot further into AmigaOS. The public available
      version of the EHCI driver recycles queue heads in some rare conditions but
      only clears the current_qtd field but not the status field. This works with
      many available EHCI PCI cards but e.g., not with the Freescale USB
      controller's found on the P5040. On the emulated EHCI controller of QEMU
      the consequence is that some garbage was read in, which resulted in a
      reset of the controller. This change fixes the problem.
      Signed-off-by: NSebastian Bauer <mail@sebastianbauer.info>
      Tested-by: NBALATON Zoltan <balaton@eik.bme.hu>
      Message-id: 20180625222718.4488-1-mail@sebastianbauer.info
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8bb01b25
  3. 27 9月, 2017 1 次提交
  4. 19 9月, 2017 1 次提交
    • A
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis 提交于
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
  5. 17 7月, 2017 1 次提交
  6. 13 6月, 2017 1 次提交
  7. 29 5月, 2017 2 次提交
  8. 21 2月, 2017 1 次提交
    • L
      usb: ehci: fix memory leak in ehci · d710e1e7
      Li Qiang 提交于
      In usb_ehci_init function, it initializes 's->ipacket', but there
      is no corresponding function to free this. As the ehci can be hotplug
      and unplug, this will leak host memory leak. In order to make the
      hierarchy clean, we should add a ehci pci finalize function, then call
      the clean function in ehci device.
      Signed-off-by: NLi Qiang <liqiang6-s@360.cn>
      Message-id: 589a85b8.3c2b9d0a.b8e6.1434@mx.google.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d710e1e7
  9. 10 11月, 2016 1 次提交
  10. 08 10月, 2016 1 次提交
  11. 02 8月, 2016 1 次提交
    • E
      ehci: faster frame index calculation for skipped frames · 72aa364b
      Evgeny Yakovlev 提交于
      ehci_update_frindex takes time linearly proportional to a number
      of uframes to calculate new frame index and raise FLR interrupts,
      which is a problem for large amounts of uframes.
      
      If we experience large delays between echi timer callbacks (i.e. because
      other periodic handlers have taken a lot of time to complete) we
      get a lot of skipped frames which then delay ehci timer callback more
      and this leads to deadlocking the system when ehci schedules next
      callback to be too soon.
      
      Observable behaviour is qemu consuming 100% host CPU time while guest
      is unresponsive. This misbehavior could happen for a while and QEMU does
      not get out from this state automatically without the patch.
      
      This change makes ehci_update_frindex execute in constant time.
      Signed-off-by: NEvgeny Yakovlev <eyakovlev@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Message-id: 1469638520-32706-1-git-send-email-den@openvz.org
      CC: Gerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      72aa364b
  12. 19 4月, 2016 2 次提交
  13. 23 3月, 2016 2 次提交
    • R
      Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND · 73bcb24d
      Rutuja Shah 提交于
      This patch replaces get_ticks_per_sec() calls with the macro
      NANOSECONDS_PER_SECOND. Also, as there are no callers, get_ticks_per_sec()
      is then removed.  This replacement improves the readability and
      understandability of code.
      
      For example,
      
          timer_mod(fdctrl->result_timer,
      	      qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() / 50));
      
      NANOSECONDS_PER_SECOND makes it obvious that qemu_clock_get_ns
      matches the unit of the expression on the right side of the plus.
      Signed-off-by: NRutuja Shah <rutu.shah.26@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      73bcb24d
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  14. 18 3月, 2016 1 次提交
  15. 02 2月, 2016 2 次提交
  16. 29 1月, 2016 1 次提交
    • P
      usb: Clean up includes · e532b2e0
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-20-git-send-email-peter.maydell@linaro.org
      e532b2e0
  17. 15 12月, 2015 1 次提交
  18. 03 11月, 2015 1 次提交
  19. 21 7月, 2015 1 次提交
  20. 02 7月, 2015 1 次提交
  21. 20 3月, 2015 1 次提交
  22. 17 3月, 2015 2 次提交
  23. 26 1月, 2015 1 次提交
  24. 23 9月, 2014 1 次提交
  25. 29 8月, 2014 3 次提交
  26. 15 8月, 2014 1 次提交
  27. 02 6月, 2014 1 次提交
  28. 14 5月, 2014 1 次提交
  29. 03 12月, 2013 1 次提交
  30. 28 11月, 2013 1 次提交
  31. 10 9月, 2013 1 次提交
  32. 31 8月, 2013 1 次提交
  33. 23 8月, 2013 1 次提交