mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
s390x/pci: enable for load/store interpretation
If the ZPCI_OP ioctl reports that is is available and usable, then the underlying KVM host will enable load/store intepretation for any guest device without a SHM bit in the guest function handle. For a device that will be using interpretation support, ensure the guest function handle matches the host function handle; this value is re-checked every time the guest issues a SET PCI FN to enable the guest device as it is the only opportunity to reflect function handle changes. By default, unless interpret=off is specified, interpretation support will always be assumed and exploited if the necessary ioctl and features are available on the host kernel. When these are unavailable, we will silently revert to the interception model; this allows existing guest configurations to work unmodified on hosts with and without zPCI interpretation support, allowing QEMU to choose the best support model available. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220902172737.170349-4-mjrosato@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
21fa15298d
commit
dd1d5fd968
8 changed files with 137 additions and 1 deletions
|
@ -18,6 +18,8 @@
|
|||
#include "sysemu/hw_accel.h"
|
||||
#include "hw/s390x/s390-pci-inst.h"
|
||||
#include "hw/s390x/s390-pci-bus.h"
|
||||
#include "hw/s390x/s390-pci-kvm.h"
|
||||
#include "hw/s390x/s390-pci-vfio.h"
|
||||
#include "hw/s390x/tod.h"
|
||||
|
||||
#ifndef DEBUG_S390PCI_INST
|
||||
|
@ -246,6 +248,20 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra)
|
|||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Take this opportunity to make sure we still have an accurate
|
||||
* host fh. It's possible part of the handle changed while the
|
||||
* device was disabled to the guest (e.g. vfio hot reset for
|
||||
* ISM during plug)
|
||||
*/
|
||||
if (pbdev->interp) {
|
||||
/* Take this opportunity to make sure we are sync'd with host */
|
||||
if (!s390_pci_get_host_fh(pbdev, &pbdev->fh) ||
|
||||
!(pbdev->fh & FH_MASK_ENABLE)) {
|
||||
stw_p(&ressetpci->hdr.rsp, CLP_RC_SETPCIFN_FH);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
pbdev->fh |= FH_MASK_ENABLE;
|
||||
pbdev->state = ZPCI_FS_ENABLED;
|
||||
stl_p(&ressetpci->fh, pbdev->fh);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue