qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 319de6: target-ppc: Correct KVM synchronizati


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 319de6: target-ppc: Correct KVM synchronization for ppc_ha...
Date: Fri, 27 May 2016 03:00:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 319de6fe6ea4b68288267bacc4574a605341f8fe
      
https://github.com/qemu/qemu/commit/319de6fe6ea4b68288267bacc4574a605341f8fe
  Author: David Gibson <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M target-ppc/mmu-hash64.c

  Log Message:
  -----------
  target-ppc: Correct KVM synchronization for ppc_hash64_set_external_hpt()

ppc_hash64_set_external_hpt() was added in e5c0d3c "target-ppc: Add helpers
for updating a CPU's SDR1 and external HPT".  This helper contains a
cpu_synchronize_state() since it may need to push state back to KVM
afterwards.

This turns out to break things when it is used in the reset path, which is
the only current user.  It appears that kvm_vcpu_dirty is not being set
early in the reset path, so the cpu_synchronize_state() is clobbering state
set up by the early part of the cpu reset path with stale state from KVM.

This may require some changes to the generic cpu reset path to fix
properly, but as a short term fix we can just remove the
cpu_synchronize_state() from ppc_hash64_set_external_hpt(), and require any
non-reset path callers to do that manually.

Reported-by: Laurent Vivier <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 24f9cd951d1a8eda1ce1e2cf97a26ca169040331
      
https://github.com/qemu/qemu/commit/24f9cd951d1a8eda1ce1e2cf97a26ca169040331
  Author: Richard Henderson <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M target-ppc/translate.c

  Log Message:
  -----------
  target-ppc: Use movcond in isel

Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 63ae0915f8ec9746d17a25c27f64cf65550627ab
      
https://github.com/qemu/qemu/commit/63ae0915f8ec9746d17a25c27f64cf65550627ab
  Author: Richard Henderson <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M target-ppc/translate.c

  Log Message:
  -----------
  target-ppc: Use 32-bit rotate instead of deposit + 64-bit rotate

A 32-bit rotate insn is more common on hosts than a deposit insn,
and if the host has neither the result is truely horrific.

At the same time, tidy up the temporaries within these functions,
drop the over-use of "likely", drop some checks for identity that
will also be checked by tcg-op.c functions, and special case mask
without rotate within rlwinm.

Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: a7b2c8b90ad4b26b0152ff254f3f091ca198a972
      
https://github.com/qemu/qemu/commit/a7b2c8b90ad4b26b0152ff254f3f091ca198a972
  Author: Richard Henderson <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M target-ppc/translate.c

  Log Message:
  -----------
  target-ppc: Cleanups to rldinm, rldnm, rldimi

Mirror the cleanups just done to rlwinm, rlwnm and rlwimi.
This adds use of deposit to rldimi.

Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 8836630f5d2df198dca2da9a1f1fb2d2a0c310a0
      
https://github.com/qemu/qemu/commit/8836630f5d2df198dca2da9a1f1fb2d2a0c310a0
  Author: Thomas Huth <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M hw/net/spapr_llan.c

  Log Message:
  -----------
  hw/net/spapr_llan: Delay flushing of the RX queue while adding new RX buffers

Currently, the spapr-vlan device is trying to flush the RX queue
after each RX buffer that has been added by the guest via the
H_ADD_LOGICAL_LAN_BUFFER hypercall. In case the receive buffer pool
was empty before, we only pass single packets to the guest this
way. This can cause very bad performance if a sender is trying
to stream fragmented UDP packets to the guest. For example when
using the UDP_STREAM test from netperf with UDP packets that are
much bigger than the MTU size, almost all UDP packets are dropped
in the guest since the chances are quite high that at least one of
the fragments got lost on the way.

When flushing the receive queue, it's much better if we'd have
a bunch of receive buffers available already, so that fragmented
packets can be passed to the guest in one go. To do this, the
spapr_vlan_receive() function should return 0 instead of -1 if there
are no more receive buffers available, so that receive_disabled = 1
gets temporarily set for the receive queue, and we have to delay
the queue flushing at the end of h_add_logical_lan_buffer() a little
bit by using a timer, so that the guest gets a chance to add multiple
RX buffers before we flush the queue again.

This improves the UDP_STREAM test with the spapr-vlan device a lot:
Running
 netserver -p 44444 -L <guestip> -f -D -4
in the guest, and
 netperf -p 44444 -L <hostip> -H <guestip> -t UDP_STREAM -l 60 -- -m 16384
in the host, I get the following values _without_ this patch:

Socket  Message  Elapsed      Messages
Size    Size     Time         Okay Errors   Throughput
bytes   bytes    secs            #      #   10^6bits/sec

229376   16384   60.00     1738970      0    3798.83
229376           60.00          23              0.05

That "0.05" means that almost all UDP packets got lost/discarded
at the receiving side.
With this patch applied, the value look much better:

Socket  Message  Elapsed      Messages
Size    Size     Time         Okay Errors   Throughput
bytes   bytes    secs            #      #   10^6bits/sec

229376   16384   60.00     1789104      0    3908.35
229376           60.00       22818             49.85

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 5c29dd8c28c3c7718cc37b38c5171b3caf629928
      
https://github.com/qemu/qemu/commit/5c29dd8c28c3c7718cc37b38c5171b3caf629928
  Author: Thomas Huth <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M hw/net/spapr_llan.c

  Log Message:
  -----------
  hw/net/spapr_llan: Provide counter with dropped rx frames to the guest

The last 8 bytes of the receive buffer list page (that has been supplied
by the guest with the H_REGISTER_LOGICAL_LAN call) contain a counter
for frames that have been dropped because there was no suitable receive
buffer available. This patch introduces code to use this field to
provide the information about dropped rx packets to the guest.
There it can be queried with "ethtool -S eth0 | grep rx_no_buffer".

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 8afc22a20fba6aa078e4e7a625d16d78da768323
      
https://github.com/qemu/qemu/commit/8afc22a20fba6aa078e4e7a625d16d78da768323
  Author: Zhou Jie <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  Added negative check for get_image_size()

This patch adds check for negative return value from get_image_size(),
where it is missing. It avoids unnecessary two function calls.

Signed-off-by: Zhou Jie <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 41264b385c2b324fea026204e5de9bef980733b1
      
https://github.com/qemu/qemu/commit/41264b385c2b324fea026204e5de9bef980733b1
  Author: Greg Kurz <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M include/sysemu/kvm.h
    M kvm-all.c
    M target-ppc/translate_init.c

  Log Message:
  -----------
  PPC/KVM: early validation of vcpu id

The KVM API restricts vcpu ids to be < KVM_CAP_MAX_VCPUS. On PowerPC
targets, depending on the number of threads per core in the host and
in the guest, some topologies do generate higher vcpu ids actually.
When this happens, QEMU bails out with the following error:

kvm_init_vcpu failed: Invalid argument

The KVM_CREATE_VCPU ioctl has several EINVAL return paths, so it is
not possible to fully disambiguate.

This patch adds a check in the code that computes vcpu ids, so that
we can detect the error earlier, and print a friendlier message instead
of calling KVM_CREATE_VCPU with an obviously bogus vcpu id.

Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 5dd5238c0b5cc42d347128227f124fe31b05832d
      
https://github.com/qemu/qemu/commit/5dd5238c0b5cc42d347128227f124fe31b05832d
  Author: Jianjun Duan <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M hw/ppc/spapr.c
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr: ensure device trees are always associated with DRC

There are possible racing situations involving hotplug events and
guest migration. For cases where a hotplug event is migrated, or
the guest is in the process of fetching device tree at the time of
migration, we need to ensure the device tree is created and
associated with the corresponding DRC for devices that were
hotplugged on the source, but 'coldplugged' on the target.

Signed-off-by: Jianjun Duan <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: eded5bac3b2fa51f6165030b0e8ed718247af188
      
https://github.com/qemu/qemu/commit/eded5bac3b2fa51f6165030b0e8ed718247af188
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr_pci: Use correct DMA LIOBN when composing the device tree

The user could have picked LIOBN via the CLI but the device tree
rendering code would still use the value derived from the PHB index
(which is the default fallback if LIOBN is not set in the CLI).

This replaces SPAPR_PCI_LIOBN() with the actual DMA LIOBN value.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: f94819d6012fbc2a6022eeacd65608e58dacbada
      
https://github.com/qemu/qemu/commit/f94819d6012fbc2a6022eeacd65608e58dacbada
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M target-ppc/kvm_ppc.h

  Log Message:
  -----------
  spapr_iommu: Finish renaming vfio_accel to need_vfio

6a81dd17 "spapr_iommu: Rename vfio_accel parameter" renamed vfio_accel
flag everywhere but one spot was missed.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: fec5d3a1cd8fea7d70778f8b408589d75c88c3e7
      
https://github.com/qemu/qemu/commit/fec5d3a1cd8fea7d70778f8b408589d75c88c3e7
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M hw/ppc/spapr_iommu.c
    M trace-events

  Log Message:
  -----------
  spapr_iommu: Move table allocation to helpers

At the moment presence of vfio-pci devices on a bus affect the way
the guest view table is allocated. If there is no vfio-pci on a PHB
and the host kernel supports KVM acceleration of H_PUT_TCE, a table
is allocated in KVM. However, if there is vfio-pci and we do yet not
KVM acceleration for these, the table has to be allocated by
the userspace. At the moment the table is allocated once at boot time
but next patches will reallocate it.

This moves kvmppc_create_spapr_tce/g_malloc0 and their counterparts
to helpers.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: b4daafbd13826dfa9d2596fb0f31f1453611189f
      
https://github.com/qemu/qemu/commit/b4daafbd13826dfa9d2596fb0f31f1453611189f
  Author: David Gibson <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add David Gibson as ppc maintainer

I've been de facto co-maintainer of all ppc target related code for some
time.  Alex Graf isworking on other things and doesn't have a whole lot of
time for qemu ppc maintainership.  So, update the MAINTAINERS file to
reflect this.

Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
Acked-by: Mark Cave-Ayland <address@hidden>


  Commit: 34c99d7b93c9181aa8c426300beca130b2b19e39
      
https://github.com/qemu/qemu/commit/34c99d7b93c9181aa8c426300beca130b2b19e39
  Author: Peter Maydell <address@hidden>
  Date:   2016-05-27 (Fri, 27 May 2016)

  Changed paths:
    M MAINTAINERS
    M hw/net/spapr_llan.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_iommu.c
    M hw/ppc/spapr_pci.c
    M include/sysemu/kvm.h
    M kvm-all.c
    M target-ppc/kvm_ppc.h
    M target-ppc/mmu-hash64.c
    M target-ppc/translate.c
    M target-ppc/translate_init.c
    M trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160527' into 
staging

ppc patch queue for 2016-05-27 (first pull for qemu-2.7)

I'm back from holidays now, and have re-collated the ppc patch queue.
This is a first pull request against the qemu-2.7 branch, mostly
consisting of patches which were posted before the 2.6 freeze, but
weren't suitable for late inclusion in the 2.6 branch.

 * Assorted bugfixes and cleanups
 * Some preliminary patches towards dynamic DMA windows and CPU hotplug
 * Significant performance impovement for the spapr-llan device
 * Added myself to MAINTAINERS for ppc (overdue)

# gpg: Signature made Fri 27 May 2016 04:04:15 BST using RSA key ID 20D9B392
# gpg: Good signature from "David Gibson <address@hidden>"
# gpg:                 aka "David Gibson (Red Hat) <address@hidden>"
# gpg:                 aka "David Gibson (ozlabs.org) <address@hidden>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.7-20160527:
  MAINTAINERS: Add David Gibson as ppc maintainer
  spapr_iommu: Move table allocation to helpers
  spapr_iommu: Finish renaming vfio_accel to need_vfio
  spapr_pci: Use correct DMA LIOBN when composing the device tree
  spapr: ensure device trees are always associated with DRC
  PPC/KVM: early validation of vcpu id
  Added negative check for get_image_size()
  hw/net/spapr_llan: Provide counter with dropped rx frames to the guest
  hw/net/spapr_llan: Delay flushing of the RX queue while adding new RX buffers
  target-ppc: Cleanups to rldinm, rldnm, rldimi
  target-ppc: Use 32-bit rotate instead of deposit + 64-bit rotate
  target-ppc: Use movcond in isel
  target-ppc: Correct KVM synchronization for ppc_hash64_set_external_hpt()

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/84cfc756d158...34c99d7b93c9

reply via email to

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