1. 08 2月, 2018 11 次提交
    • F
      block: Add VFIO based NVMe driver · bdd6a90a
      Fam Zheng 提交于
      This is a new protocol driver that exclusively opens a host NVMe
      controller through VFIO. It achieves better latency than linux-aio by
      completely bypassing host kernel vfs/block layer.
      
          $rw-$bs-$iodepth  linux-aio     nvme://
          ----------------------------------------
          randread-4k-1     10.5k         21.6k
          randread-512k-1   745           1591
          randwrite-4k-1    30.7k         37.0k
          randwrite-512k-1  1945          1980
      
          (unit: IOPS)
      
      The driver also integrates with the polling mechanism of iothread.
      
      This patch is co-authored by Paolo and me.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <20180116060901.17413-4-famz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      bdd6a90a
    • F
      util: Introduce vfio helpers · 418026ca
      Fam Zheng 提交于
      This is a library to manage the host vfio interface, which could be used
      to implement userspace device driver code in QEMU such as NVMe or net
      controllers.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20180116060901.17413-3-famz@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      418026ca
    • F
      stubs: Add stubs for ram block API · a37eaa53
      Fam Zheng 提交于
      These functions will be wanted by block-obj-y but the actual definition
      is in obj-y, so stub them to keep the linker happy.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180110091846.10699-2-famz@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      a37eaa53
    • P
      curl: convert to CoQueue · 709f2132
      Paolo Bonzini 提交于
      Now that CoQueues can use a QemuMutex for thread-safety, there is no
      need for curl to roll its own coroutine queue.  Coroutines can be
      placed directly on the queue instead of using a list of CURLAIOCBs.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180203153935.8056-6-pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      709f2132
    • P
      coroutine-lock: make qemu_co_enter_next thread-safe · 5261dd7b
      Paolo Bonzini 提交于
      qemu_co_queue_next does not need to release and re-acquire the mutex,
      because the queued coroutine does not run immediately.  However, this
      does not hold for qemu_co_enter_next.  Now that qemu_co_queue_wait
      can synchronize (via QemuLockable) with code that is not running in
      coroutine context, it's important that code using qemu_co_enter_next
      can easily use a standardized locking idiom.
      
      First of all, qemu_co_enter_next must use aio_co_wake to restart the
      coroutine.  Second, the function gains a second argument, a QemuLockable*,
      and the comments of qemu_co_queue_next and qemu_co_queue_restart_all
      are adjusted to clarify the difference.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180203153935.8056-5-pbonzini@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      5261dd7b
    • P
      coroutine-lock: convert CoQueue to use QemuLockable · 1a957cf9
      Paolo Bonzini 提交于
      There are cases in which a queued coroutine must be restarted from
      non-coroutine context (with qemu_co_enter_next).  In this cases,
      qemu_co_enter_next also needs to be thread-safe, but it cannot use
      a CoMutex and so cannot qemu_co_queue_wait.  Use QemuLockable so
      that the CoQueue can interchangeably use CoMutex or QemuMutex.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180203153935.8056-4-pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      1a957cf9
    • P
      lockable: add QemuLockable · e70372fc
      Paolo Bonzini 提交于
      QemuLockable is a polymorphic lock type that takes an object and
      knows which function to use for locking and unlocking.  The
      implementation could use C11 _Generic, but since the support is
      not very widespread I am instead using __builtin_choose_expr and
      __builtin_types_compatible_p, which are already used by
      include/qemu/atomic.h.
      
      QemuLockable can be used to implement lock guards, or to pass around
      a lock in such a way that a function can release it and re-acquire it.
      The next patch will do this for CoQueue.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180203153935.8056-3-pbonzini@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      e70372fc
    • P
      test-coroutine: add simple CoMutex test · 439b6e5e
      Paolo Bonzini 提交于
      In preparation for adding a similar test using QemuLockable, add a very
      simple testcase that has two interleaved calls to lock and unlock.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20180203153935.8056-2-pbonzini@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      439b6e5e
    • P
      docker: change Fedora base image to fedora:27 · 5b9b49d7
      Paolo Bonzini 提交于
      Using "fedora:latest" makes behavior different depending on when you
      actually pulled the image from the docker repository.  In my case,
      the supposedly "latest" image was a Fedora 25 download from 8 months
      ago, and the new "test-debug" test was failing.
      
      Use "27" to improve reproducibility and make it clear when the image
      is obsolete.
      
      Cc: Fam Zheng <famz@redhat.com>
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1515755504-21341-1-git-send-email-pbonzini@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      5b9b49d7
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 7b213bb4
      Peter Maydell 提交于
      * socket option parsing fix (Daniel)
      * SCSI fixes (Fam)
      * Readline double-free fix (Greg)
      * More HVF attribution fixes (Izik)
      * WHPX (Windows Hypervisor Platform Extensions) support (Justin)
      * POLLHUP handler (Klim)
      * ivshmem fixes (Ladi)
      * memfd memory backend (Marc-André)
      * improved error message (Marcelo)
      * Memory fixes (Peter Xu, Zhecheng)
      * Remove obsolete code and comments (Peter M.)
      * qdev API improvements (Philippe)
      * Add CONFIG_I2C switch (Thomas)
      
      # gpg: Signature made Wed 07 Feb 2018 15:24:08 GMT
      # gpg:                using RSA key BFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream: (47 commits)
        Add the WHPX acceleration enlightenments
        Introduce the WHPX impl
        Add the WHPX vcpu API
        Add the Windows Hypervisor Platform accelerator.
        tests/test-filter-redirector: move close()
        tests: use memfd in vhost-user-test
        vhost-user-test: make read-guest-mem setup its own qemu
        tests: keep compiling failing vhost-user tests
        Add memfd based hostmem
        memfd: add hugetlbsize argument
        memfd: add hugetlb support
        memfd: add error argument, instead of perror()
        cpus: join thread when removing a vCPU
        cpus: hvf: unregister thread with RCU
        cpus: tcg: unregister thread with RCU, fix exiting of loop on unplug
        cpus: dummy: unregister thread with RCU, exit loop on unplug
        cpus: kvm: unregister thread with RCU
        cpus: hax: register/unregister thread with RCU, exit loop on unplug
        ivshmem: Disable irqfd on device reset
        ivshmem: Improve MSI irqfd error handling
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      
      # Conflicts:
      #	cpus.c
      7b213bb4
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-02-06' into staging · 17a5bbb4
      Peter Maydell 提交于
      Error reporting patches for 2018-02-06
      
      # gpg: Signature made Tue 06 Feb 2018 19:48:30 GMT
      # gpg:                using RSA key 3870B400EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-error-2018-02-06:
        tcg: Replace fprintf(stderr, "*\n" with error_report()
        hw/xen*: Replace fprintf(stderr, "*\n" with error_report()
        hw/sparc*: Replace fprintf(stderr, "*\n" with error_report()
        hw/sd: Replace fprintf(stderr, "*\n" with DPRINTF()
        hw/ppc: Replace fprintf(stderr, "*\n" with error_report()
        hw/pci*: Replace fprintf(stderr, "*\n" with error_report()
        hw/openrisc: Replace fprintf(stderr, "*\n" with error_report()
        hw/moxie: Replace fprintf(stderr, "*\n" with error_report()
        hw/mips: Replace fprintf(stderr, "*\n" with error_report()
        hw/lm32: Replace fprintf(stderr, "*\n" with error_report()
        hw/dma: Replace fprintf(stderr, "*\n" with error_report()
        hw/arm: Replace fprintf(stderr, "*\n" with error_report()
        audio: Replace AUDIO_FUNC with __func__
        error: Improve documentation of error_append_hint()
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      17a5bbb4
  2. 07 2月, 2018 29 次提交