1. 22 9月, 2014 2 次提交
    • J
      ahci: properly shadow the TFD register · fac7aa7f
      John Snow 提交于
      In a real AHCI device, several S/ATA registers are mirrored or shadowed
      within the AHCI register set. These registers are not updated
      synchronously for each read access, but are instead updated after a
      Device-to-Host Register FIS packet is received. The D2H FIS contains
      the values from these registers on the device.
      
      In QEMU, by reaching directly into the device to grab these bits before
      they are "sent," we may introduce race conditions where unexpected
      values are present "before they are sent" which could cause issues for
      some guests, particularly if an attempt is made to read the PxTFD
      register prior to enabling the port, where incorrect values will be read.
      
      This patch also addresses the boot-time values for the PxTFD and PxSIG
      registers to bring them in line with the AHCI 1.3 specification.
      
      Lastly, several fields (PxTFD, PxSIG and PxSACT) are read-only,
      and any attempts to write to them should be ignored.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1408643079-30675-6-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fac7aa7f
    • F
      ide/ahci: Check for -ECANCELED in aio callbacks · 0d910cfe
      Fam Zheng 提交于
      Before, bdrv_aio_cancel will either complete the request (like normal)
      and call CB with an actual return code, or skip calling the request (for
      example when the IO req is not submitted by thread pool yet).
      
      We will change bdrv_aio_cancel to do it differently: always call CB
      before return, with either [1] a normal req completion ret code, or [2]
      ret == -ECANCELED. So the callers' callback must accept both cases. The
      existing logic works with case [1], but not [2].
      
      The simplest transition of callback code is do nothing in case [2], just
      as if the CB is not called by the bdrv_aio_cancel() call.
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0d910cfe
  2. 10 9月, 2014 2 次提交
    • B
      block: Make the block accounting functions operate on BlockAcctStats · 5366d0c8
      Benoît Canet 提交于
      This is the next step for decoupling block accounting functions from
      BlockDriverState.
      In a future commit the BlockAcctStats structure will be moved from
      BlockDriverState to the device models structures.
      
      Note that bdrv_get_stats was introduced so device models can retrieve the
      BlockAcctStats structure of a BlockDriverState without being aware of it's
      layout.
      This function should go away when BlockAcctStats will be embedded in the device
      models structures.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Anthony Liguori <aliguori@amazon.com>
      CC: "Michael S. Tsirkin" <mst@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Michael Tokarev <mjt@tls.msk.ru>
      CC: John Snow <jsnow@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Alexander Graf <agraf@suse.de>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5366d0c8
    • B
      block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_ · 28298fd3
      Benoît Canet 提交于
      The middle term goal is to move the BlockAcctStats structure in the device models.
      (Capturing I/O accounting statistics in the device models is good for billing)
      This patch make a small step in this direction by removing a reference to BDRV.
      
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Keith Busch <keith.busch@intel.com>
      CC: Anthony Liguori <aliguori@amazon.com>
      CC: "Michael S. Tsirkin" <mst@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: John Snow <jsnow@redhat.com>
      CC: Richard Henderson <rth@twiddle.net>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Alexander Graf <agraf@suse.de>i
      Signed-off-by: NBenoît Canet <benoit.canet@nodalink.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      28298fd3
  3. 20 8月, 2014 1 次提交
    • M
      block: Use g_new() & friends where that makes obvious sense · 5839e53b
      Markus Armbruster 提交于
      g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
      for two reasons.  One, it catches multiplication overflowing size_t.
      Two, it returns T * rather than void *, which lets the compiler catch
      more type errors.
      
      Patch created with Coccinelle, with two manual changes on top:
      
      * Add const to bdrv_iterate_format() to keep the types straight
      
      * Convert the allocation in bdrv_drop_intermediate(), which Coccinelle
        inexplicably misses
      
      Coccinelle semantic patch:
      
          @@
          type T;
          @@
          -g_malloc(sizeof(T))
          +g_new(T, 1)
          @@
          type T;
          @@
          -g_try_malloc(sizeof(T))
          +g_try_new(T, 1)
          @@
          type T;
          @@
          -g_malloc0(sizeof(T))
          +g_new0(T, 1)
          @@
          type T;
          @@
          -g_try_malloc0(sizeof(T))
          +g_try_new0(T, 1)
          @@
          type T;
          expression n;
          @@
          -g_malloc(sizeof(T) * (n))
          +g_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc(sizeof(T) * (n))
          +g_try_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_malloc0(sizeof(T) * (n))
          +g_new0(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc0(sizeof(T) * (n))
          +g_try_new0(T, n)
          @@
          type T;
          expression p, n;
          @@
          -g_realloc(p, sizeof(T) * (n))
          +g_renew(T, p, n)
          @@
          type T;
          expression p, n;
          @@
          -g_try_realloc(p, sizeof(T) * (n))
          +g_try_renew(T, p, n)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5839e53b
  4. 18 8月, 2014 1 次提交
  5. 16 8月, 2014 9 次提交
  6. 07 7月, 2014 2 次提交
  7. 16 6月, 2014 1 次提交
  8. 06 5月, 2014 1 次提交
  9. 18 4月, 2014 1 次提交
  10. 19 3月, 2014 1 次提交
    • R
      ahci: fix sysbus support · bd164307
      Rob Herring 提交于
      Non-PCI AHCI support is broken due to assertion failures when trying
      to convert AHCIState to a PCIDevice pointer as AHCIState can have
      different container structs. Fix this by using the non-asserting object
      cast and checking the returned pointer is not NULL.
      
      The AddressSpace pointer is also being initialized to NULL and causing
      dma_memory_map call to fail. Fix this by initializing to
      address_space_memory for sysbus instances.
      
      Also correct AHCI_VMSTATE to use the correct container SysbusAHCIState
      for sysbus instances.
      Signed-off-by: NRob Herring <rob.herring@linaro.org>
      Message-id: 1392073373-3295-1-git-send-email-robherring2@gmail.com
      [PMM: added linebreaks to fix overlong lines]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      bd164307
  11. 29 10月, 2013 1 次提交
  12. 11 10月, 2013 1 次提交
  13. 31 8月, 2013 1 次提交
  14. 29 7月, 2013 1 次提交
  15. 23 7月, 2013 3 次提交
  16. 15 7月, 2013 1 次提交
    • K
      ahci: Fix FLUSH command · a62eaa26
      Kevin Wolf 提交于
      AHCI couldn't cope with asynchronous commands that aren't doing DMA, it
      simply wouldn't complete them. Due to the bug fixed in commit f68ec837,
      FLUSH commands would seem to have completed immediately even if they
      were still running on the host. After the commit, they would simply hang
      and never unset the BSY bit, rendering AHCI unusable on any OS sending
      flushes.
      
      This patch adds another callback for the completion of asynchronous
      commands. This is what AHCI really wants to use for its command
      completion logic rather than an DMA completion callback.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      a62eaa26
  17. 04 7月, 2013 3 次提交
  18. 20 6月, 2013 1 次提交
  19. 08 5月, 2013 1 次提交
  20. 16 4月, 2013 1 次提交
  21. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  22. 26 1月, 2013 3 次提交
  23. 11 1月, 2013 1 次提交
    • A
      Make all static TypeInfos const · 8c43a6f0
      Andreas Färber 提交于
      Since 39bffca2 (qdev: register all
      types natively through QEMU Object Model), TypeInfo as used in
      the common, non-iterative pattern is no longer amended with information
      and should therefore be const.
      
      Fix the documented QOM examples:
      
       sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
      
      Since frequently the wrong examples are being copied by contributors of
      new devices, fix all types in the tree:
      
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
      
      This also avoids to piggy-back these changes onto real functional
      changes or other refactorings.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8c43a6f0