qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] a6df8a: virtio-pci: fix 1.0 virtqueue migrati


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] a6df8a: virtio-pci: fix 1.0 virtqueue migration
Date: Thu, 12 Nov 2015 08:30:07 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a6df8adf3edbb3062f087e425564df35077e8410
      
https://github.com/qemu/qemu/commit/a6df8adf3edbb3062f087e425564df35077e8410
  Author: Jason Wang <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h
    M hw/virtio/virtio.c
    M include/hw/compat.h
    M include/hw/virtio/virtio-bus.h

  Log Message:
  -----------
  virtio-pci: fix 1.0 virtqueue migration

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 <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>


  Commit: b8aecea23aaccf39da54c77ef248f5fa50dcfbc1
      
https://github.com/qemu/qemu/commit/b8aecea23aaccf39da54c77ef248f5fa50dcfbc1
  Author: Jason Wang <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M memory.c

  Log Message:
  -----------
  memory: don't try to adjust endianness for zero length eventfd

There's no need to adjust endianness for zero length eventfd since the
data wrote was actually ignored by kernel. So skip the adjust in this
case to fix a possible crash when trying to use wildcard mmio eventfd
in ppc.

Cc: Greg Kurz <address@hidden>
Cc: Peter Maydell <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Acked-by: Greg Kurz <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 351082238d5d45d6836ec94eabe3fe7d72b36f46
      
https://github.com/qemu/qemu/commit/351082238d5d45d6836ec94eabe3fe7d72b36f46
  Author: Jason Wang <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M include/sysemu/kvm.h
    M kvm-all.c
    M kvm-stub.c

  Log Message:
  -----------
  KVM: add support for any length io eventfd

Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>


  Commit: bc85ccfdf5cc045588f665c84b5707d7364c8a6c
      
https://github.com/qemu/qemu/commit/bc85ccfdf5cc045588f665c84b5707d7364c8a6c
  Author: Jason Wang <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-pci: use zero length mmio eventfd for 1.0 notification cap when 
possible

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 <address@hidden> for the benchmarking.

Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 9824d2a39d9893ef9bbe71f94efb57da265b73f6
      
https://github.com/qemu/qemu/commit/9824d2a39d9893ef9bbe71f94efb57da265b73f6
  Author: Jason Wang <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h

  Log Message:
  -----------
  virtio-pci: introduce pio notification capability for modern device

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 <address@hidden>
for the benchmarking.

Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 393f04d3ab40d03aa2fde0017ff7f02fc34cbd4e
      
https://github.com/qemu/qemu/commit/393f04d3ab40d03aa2fde0017ff7f02fc34cbd4e
  Author: Jason Wang <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/virtio/virtio-pci.c

  Log Message:
  -----------
  virtio-pci: unbreak queue_enable read

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 <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 2b8819c6eee517c1582983773f8555bb3f9ed645
      
https://github.com/qemu/qemu/commit/2b8819c6eee517c1582983773f8555bb3f9ed645
  Author: Victor Kaplansky <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/virtio/vhost-user.c
    M tests/vhost-user-test.c

  Log Message:
  -----------
  vhost-user: modify SET_LOG_BASE to pass mmap size and offset

Unlike the kernel, vhost-user application accesses log table by
mmaping it to its user space. This change adds two new fields to
VhostUserMsg payload: mmap_size, and mmap_offset and make QEMU to
pass the to vhost-user application in VHOST_USER_SET_LOG_BASE
request.

Signed-off-by: Victor Kaplansky <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 60915dc4691768c4dc62458bb3e16c843fab091d
      
https://github.com/qemu/qemu/commit/60915dc4691768c4dc62458bb3e16c843fab091d
  Author: Yuanhan Liu <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/virtio/vhost-backend.c
    M hw/virtio/vhost-user.c
    M linux-headers/linux/vhost.h
    M tests/vhost-user-bridge.c
    M tests/vhost-user-test.c

  Log Message:
  -----------
  vhost: rename RESET_DEVICE backto RESET_OWNER

This patch basically reverts commit d1f8b30e.

It turned out that it breaks stuff, so revert it:
    http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html

CC: "Michael S. Tsirkin" <address@hidden>
Reported-by: Paolo Bonzini <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 3a12f32229a046f4d4ab0a3a52fb01d2d5a1ab76
      
https://github.com/qemu/qemu/commit/3a12f32229a046f4d4ab0a3a52fb01d2d5a1ab76
  Author: Yuanhan Liu <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/virtio/vhost.c

  Log Message:
  -----------
  vhost: send SET_VRING_ENABLE at start/stop

Send SET_VRING_ENABLE at start/stop, to give the backend
an explicit sign of our state.

Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 1811e64c35fe1d9bce77952937a16c001dc08465
      
https://github.com/qemu/qemu/commit/1811e64c35fe1d9bce77952937a16c001dc08465
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h
    M include/hw/compat.h

  Log Message:
  -----------
  hw/virtio: Add PCIe capability to virtio devices

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: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 4652f1640e029e1f2433fa77ba6af285c7cd923a
      
https://github.com/qemu/qemu/commit/4652f1640e029e1f2433fa77ba6af285c7cd923a
  Author: Greg Kurz <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M hw/9pfs/virtio-9p-device.c

  Log Message:
  -----------
  virtio-9p: add savem handlers

We don't support migration of mounted 9p shares. This is handled by a
migration blocker.

One would expect, however, to be able to migrate if the share is unmounted.
Unfortunately virtio-9p-device does not register savevm handlers at all !
Migration succeeds and leaves the guest with a dangling device...

This patch simply registers migration handlers for virtio-9p-device. Whether
migration is possible or not still depends on the migration blocker.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 8f0da01d189077647adf79618acc3832f77b7918
      
https://github.com/qemu/qemu/commit/8f0da01d189077647adf79618acc3832f77b7918
  Author: Peter Maydell <address@hidden>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/9pfs/virtio-9p-device.c
    M hw/virtio/vhost-backend.c
    M hw/virtio/vhost-user.c
    M hw/virtio/vhost.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h
    M hw/virtio/virtio.c
    M include/hw/compat.h
    M include/hw/virtio/virtio-bus.h
    M include/sysemu/kvm.h
    M kvm-all.c
    M kvm-stub.c
    M linux-headers/linux/vhost.h
    M memory.c
    M tests/vhost-user-bridge.c
    M tests/vhost-user-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio, vhost: fixes for 2.5

This fixes a performance regression with virtio 1,
and makes device stop/start more robust for vhost-user.
virtio devices on pcie bus now have pcie and pm
capability, as required by the PCI Express spec.
migration now works better with virtio 9p.

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Thu 12 Nov 2015 14:40:42 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"

* remotes/mst/tags/for_upstream:
  virtio-9p: add savem handlers
  hw/virtio: Add PCIe capability to virtio devices
  vhost: send SET_VRING_ENABLE at start/stop
  vhost: rename RESET_DEVICE backto RESET_OWNER
  vhost-user: modify SET_LOG_BASE to pass mmap size and offset
  virtio-pci: unbreak queue_enable read
  virtio-pci: introduce pio notification capability for modern device
  virtio-pci: use zero length mmio eventfd for 1.0 notification cap when 
possible
  KVM: add support for any length io eventfd
  memory: don't try to adjust endianness for zero length eventfd
  virtio-pci: fix 1.0 virtqueue migration

Conflicts:
        include/hw/compat.h
[Fixed a trivial merge conflict in compat.h]
Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/17e50a72a3aa...8f0da01d1890

reply via email to

[Prev in Thread] Current Thread [Next in Thread]