1. 15 9月, 2016 1 次提交
    • M
      virtio-bus: Plug devices after features are negotiated · d1b4259f
      Maxime Coquelin 提交于
      Currently, devices are plugged before features are negotiated.
      If the backend doesn't support VIRTIO_F_VERSION_1, the transport
      needs to rewind some settings.
      
      This is the case for CCW, for which a post_plugged callback had
      been introduced, where max_rev field is just updated if
      VIRTIO_F_VERSION_1 is not supported by the backend.
      For PCI, implementing post_plugged would be much more
      complicated, so it needs to know whether the backend supports
      VIRTIO_F_VERSION_1 at plug time.
      
      Currently, nothing is done for PCI. Modern capabilities get
      exposed to the guest even if VIRTIO_F_VERSION_1 is not supported
      by the backend, which confuses the guest.
      
      This patch replaces existing post_plugged solution with an
      approach that fits with both transports.
      Features negotiation is performed before ->device_plugged() call.
      A pre_plugged callback is introduced so that the transports can
      set their supported features.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: qemu-stable@nongnu.org
      Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> [ccw]
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      d1b4259f
  2. 10 9月, 2016 5 次提交
  3. 29 7月, 2016 1 次提交
  4. 22 7月, 2016 2 次提交
  5. 24 6月, 2016 1 次提交
  6. 20 6月, 2016 1 次提交
    • E
      coccinelle: Remove unnecessary variables for function return value · 9be38598
      Eduardo Habkost 提交于
      Use Coccinelle script to replace 'ret = E; return ret' with
      'return E'. The script will do the substitution only when the
      function return type and variable type are the same.
      
      Manual fixups:
      
      * audio/audio.c: coding style of "read (...)" and "write (...)"
      * block/qcow2-cluster.c: wrap line to make it shorter
      * block/qcow2-refcount.c: change indentation of wrapped line
      * target-tricore/op_helper.c: fix coding style of
        "remainder|quotient"
      * target-mips/dsp_helper.c: reverted changes because I don't
        want to argue about checkpatch.pl
      * ui/qemu-pixman.c: fix line indentation
      * block/rbd.c: restore blank line between declarations and
        statements
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1465855078-19435-4-git-send-email-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Unused Coccinelle rule name dropped along with a redundant comment;
      whitespace touched up in block/qcow2-cluster.c; stale commit message
      paragraph deleted]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      9be38598
  7. 23 3月, 2016 1 次提交
    • 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
  8. 11 3月, 2016 1 次提交
  9. 18 2月, 2016 1 次提交
  10. 29 1月, 2016 1 次提交
  11. 03 12月, 2015 1 次提交
  12. 12 11月, 2015 5 次提交
    • M
      hw/virtio: Add PCIe capability to virtio devices · 1811e64c
      Marcel Apfelbaum 提交于
      The virtio devices are converted to PCI-Express
      if they are plugged into a PCI-Express bus and
      the 'modern' protocol is enabled.
      
      Devices plugged directly into the Root Complex as
      Integrated Endpoints remain PCI.
      Signed-off-by: NMarcel Apfelbaum <marcel@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      1811e64c
    • J
      virtio-pci: unbreak queue_enable read · 393f04d3
      Jason Wang 提交于
      Guest always get zero when reading queue_enable. This violates
      spec. Fixing this by setting the queue_enable to true during any guest
      writing and setting it to zero during reset.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      393f04d3
    • J
      virtio-pci: introduce pio notification capability for modern device · 9824d2a3
      Jason Wang 提交于
      We used to use mmio for notification. This could be slow on some arch
      (e.g on x86 without EPT). So this patch introduces pio bar and a pio
      notification cap for modern device. This ability is enabled through
      property "modern-pio-notify" for virtio pci devices and was disabled
      by default. Management can enable when it thinks it was needed.
      
      Benchmarks shows almost no obvious difference compared to legacy
      device on machines without ept. Thanks Wenli Quan <wquan@redhat.com>
      for the benchmarking.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      9824d2a3
    • J
      virtio-pci: use zero length mmio eventfd for 1.0 notification cap when possible · bc85ccfd
      Jason Wang 提交于
      We use data match eventfd for 1.0 notification currently. This could
      be slow since software decoding is needed for mmio exit. To speed this
      up, we can switch to use zero length mmio eventfd for 1.0 notification
      since we can examine the queue index directly from the writing
      address. KVM kernel module can utilize this by registering it to fast
      mmio bus which could be as fast as pio on ept capable machine when
      fast mmio is supported by host kernel.
      
      Lots of improvements were seen on a ept capable machine:
      
      Guest RX:(TCP)
      size/session/+throughput%/+cpu%/-+per cpu%/
      64/1/+1.6807%/[-16.2421%]/[+21.3984%]/
      64/2/+0.6091%/[-11.0187%]/[+13.0678%]/
      64/4/+0.0553%/[-5.9768%]/[+6.4155%]/
      64/8/+0.1206%/[-4.0057%]/[+4.2984%]/
      256/1/-0.0031%/[-10.1166%]/[+11.2517%]/
      256/2/-0.5058%/[-6.1656%]/+6.0317%]/
      ...
      
      Guest TX:(TCP)
      size/session/+throughput%/+cpu%/-+per cpu%/
      64/1/[+18.9183%]/-0.2823%/[+19.2550%]/
      64/2/[+13.5714%]/[+2.2675%]/[+11.0533%]/
      64/4/[+13.1070%]/[+2.1817%]/[+10.6920%]/
      64/8/[+13.0426%]/[+2.0887%]/[+10.7299%]/
      256/1/[+36.2761%]/+6.3434%/[+28.1471%]/
      ...
      1024/1/[+44.8873%]/+2.0811%/[+41.9335%]/
      ...
      1024/4/+0.0228%/[-2.2044%]/[+2.2774%]/
      ...
      16384/2/+0.0127%/[-5.0346%]/[+5.3148%]/
      ...
      65535/1/[+0.0062%]/[-4.1183%]/[+4.3017%]/
      65535/2/+0.0004%/[-4.2311%]/[+4.4185%]/
      65535/4/+0.0107%/[-4.6106%]/[+4.8446%]/
      65535/8/-0.0090%/[-5.5178%]/[+5.8306%]/
      
      Latency:(TCP_RR)
      size/session/+transaction rate%/+cpu%/-+per cpu%/
      64/1/[+6.5248%]/[-9.2882%]/[+17.4322%]/
      64/25/[+11.0854%]/[+0.8000%]/[+10.2038%]/
      64/50/[+12.1076%]/[+2.4627%]/[+9.4131%]/
      256/1/[+5.3677%]/[+10.5669%]/-4.7024%/
      256/25/[+5.6402%]/-0.8962%/[+6.5955%]/
      256/50/[+5.9685%]/[+1.7766%]/[+4.1188%]/
      4096/1/+0.2508%/[-10.4941%]/[+12.0047%]/
      4096/25/[+1.8533%]/-0.0273%/+1.8812%/
      4096/50/[+1.2156%]/-1.4134%/+2.6667%/
      
      Notes: data with '[]' is the one whose significance is greater than 95%.
      
      Thanks Wenli Quan <wquan@redhat.com> for the benchmarking.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      bc85ccfd
    • J
      virtio-pci: fix 1.0 virtqueue migration · a6df8adf
      Jason Wang 提交于
      We don't migrate the followings fields for virtio-pci:
      
      uint32_t dfselect;
      uint32_t gfselect;
      uint32_t guest_features[2];
      struct {
          uint16_t num;
          bool enabled;
          uint32_t desc[2];
          uint32_t avail[2];
          uint32_t used[2];
      } vqs[VIRTIO_QUEUE_MAX];
      
      This will confuse driver if migrating during initialization. Solves
      this issue by:
      
      - introduce transport specific callbacks to load and store extra
        virtqueue states.
      - add a new subsection for virtio to migrate transport specific modern
        device state.
      - implement pci specific callbacks.
      - add a new property for virtio-pci for whether or not to migrate
        extra state.
      - compat the migration for 2.4 and elder machine types
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      a6df8adf
  13. 19 10月, 2015 1 次提交
    • P
      kvm: Pass PCI device pointer to MSI routing functions · dc9f06ca
      Pavel Fedin 提交于
      In-kernel ITS emulation on ARM64 will require to supply requester IDs.
      These IDs can now be retrieved from the device pointer using new
      pci_requester_id() function.
      
      This patch adds pci_dev pointer to KVM GSI routing functions and makes
      callers passing it.
      
      x86 architecture does not use requester IDs, but hw/i386/kvm/pci-assign.c
      also made passing PCI device pointer instead of NULL for consistency with
      the rest of the code.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Message-Id: <ce081423ba2394a4efc30f30708fca07656bc500.1444916432.git.p.fedin@samsung.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      dc9f06ca
  14. 09 10月, 2015 1 次提交
    • M
      virtio-input: Fix device introspection on non-Linux hosts · c6047e96
      Markus Armbruster 提交于
      When CONFIG_LINUX is off, devices "virtio-keyboard-device",
      "virtio-mouse-device", "virtio-tablet-device" and
      "virtio-input-host-device" aren't compiled in, yet
      "virtio-keyboard-pci", "virtio-mouse-pci", "virtio-tablet-pci" and
      "virtio-input-host-pci" still are.  Attempts to introspect them crash,
      e.g.
      
          $ qemu-system-x86_64 -device virtio-tablet-pci,help
          **
          ERROR:/work/armbru/qemu/qom/object.c:333:object_initialize_with_type: assertion failed: (type != NULL)
      
      Broken in commit 710e2d90 and commit 006a5ede.
      
      Fix by compiling the "virtio-FOO-pci" exactly when compiling the
      "virtio-FOO-device": compile "virtio-keyboard-device",
      "virtio-mouse-device", "virtio-tablet-device" regardless of
      CONFIG_LINUX, and compile "virtio-input-host-pci" only for
      CONFIG_LINUX.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-Id: <1444320700-26260-3-git-send-email-armbru@redhat.com>
      c6047e96
  15. 01 10月, 2015 1 次提交
  16. 11 9月, 2015 1 次提交
  17. 07 9月, 2015 1 次提交
  18. 27 7月, 2015 2 次提交
  19. 13 7月, 2015 1 次提交
  20. 08 7月, 2015 2 次提交
  21. 07 7月, 2015 1 次提交
  22. 23 6月, 2015 3 次提交
  23. 11 6月, 2015 5 次提交