qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e2c6cd: s390/kvm: fix diag318 propagation and


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] e2c6cd: s390/kvm: fix diag318 propagation and reset functi...
Date: Thu, 19 Nov 2020 04:10:13 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e2c6cd567422bfa563be026b9741a1854aecdc06
      
https://github.com/qemu/qemu/commit/e2c6cd567422bfa563be026b9741a1854aecdc06
  Author: Collin Walling <walling@linux.ibm.com>
  Date:   2020-11-18 (Wed, 18 Nov 2020)

  Changed paths:
    M hw/s390x/s390-virtio-ccw.c
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/kvm-stub.c
    M target/s390x/kvm.c
    M target/s390x/kvm_s390x.h

  Log Message:
  -----------
  s390/kvm: fix diag318 propagation and reset functionality

The Control Program Name Code (CPNC) portion of the diag318
info must be set within the SIE block of each VCPU in the
configuration. The handler will iterate through each VCPU
and dirty the diag318_info reg to be synced with KVM on a
subsequent sync_regs call.

Additionally, the diag318 info resets must be handled via
userspace. As such, QEMU will reset this value for each
VCPU during a modified clear, load normal, and load clear
reset event.

Fixes: fabdada9357b ("s390: guest support for diagnose 0x318")
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Message-Id: <20201113221022.257054-1-walling@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Janosch Frank <frankja@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: e67ad058e45aa8b23e9b94e793b9fcf66e70ebb0
      
https://github.com/qemu/qemu/commit/e67ad058e45aa8b23e9b94e793b9fcf66e70ebb0
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-18 (Wed, 18 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c

  Log Message:
  -----------
  s390x/pci: Unregister listeners before destroying IOMMU address space

Hot-unplugging a vfio-pci device on s390x causes a QEMU crash:

qemu-system-s390x: ../softmmu/memory.c:2772:
 do_address_space_destroy: Assertion `QTAILQ_EMPTY(&as->listeners)' failed.

In s390, the IOMMU address space is freed during device unplug but the
associated vfio-pci device may not yet be finalized and therefore may
still have a listener registered to the IOMMU address space.

Commit a2166410ad74 ("spapr_pci: Unregister listeners before destroying
the IOMMU address space") previously resolved this issue for spapr_pci.
We are now seeing this in s390x; it would seem the possibility for this
issue was already present but based on a bisect commit 2d24a6466154
("device-core: use RCU for list of children of a bus") has now changed
the timing such that it is now readily reproducible.

Add logic to ensure listeners are removed before destroying the address
space.

Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1605562955-21152-1-git-send-email-mjrosato@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: a4e2fff1b104f2b235ea2673968d0b0383f541dc
      
https://github.com/qemu/qemu/commit/a4e2fff1b104f2b235ea2673968d0b0383f541dc
  Author: Cornelia Huck <cohuck@redhat.com>
  Date:   2020-11-18 (Wed, 18 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-pci-inst.c
    M hw/s390x/s390-pci-vfio.c
    M include/hw/s390x/s390-pci-clp.h

  Log Message:
  -----------
  s390x/pci: fix endianness issues

The zPCI group and function structures are big endian. However, we do
not consistently store them as big endian locally, and are missing some
conversions.

Let's just store the structures as host endian instead and convert to
big endian when actually handling the instructions retrieving the data.

Also fix the layout of ClpReqQueryPciGrp: g is actually only 8 bit. This
also fixes accesses on little endian hosts, and makes accesses on big
endian hosts consistent.

Fixes: 28dc86a07299 ("s390x/pci: use a PCI Group structure")
Fixes: 9670ee752727 ("s390x/pci: use a PCI Function structure")
Fixes: 1e7552ff5c34 ("s390x/pci: get zPCI function info from host")
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201118104202.1301363-1-cohuck@redhat.com>


  Commit: ff85db769ffd431f86d263d5e954e809a83be92f
      
https://github.com/qemu/qemu/commit/ff85db769ffd431f86d263d5e954e809a83be92f
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-11-19 (Thu, 19 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-pci-inst.c
    M hw/s390x/s390-pci-vfio.c
    M hw/s390x/s390-virtio-ccw.c
    M include/hw/s390x/s390-pci-clp.h
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/kvm-stub.c
    M target/s390x/kvm.c
    M target/s390x/kvm_s390x.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20201119' into staging

s390x fixes:
- fix propagation and reset for the new diag318 call
- fix hot-unplug for vfio-pci devices
- fix endianness issues in zPCI (regression fix)

# gpg: Signature made Thu 19 Nov 2020 10:15:58 GMT
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20201119:
  s390x/pci: fix endianness issues
  s390x/pci: Unregister listeners before destroying IOMMU address space
  s390/kvm: fix diag318 propagation and reset functionality

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/3d275bd17c7b...ff85db769ffd



reply via email to

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