12
#include "qemu/osdep.h"
16
#include "kvm/kvm_s390x.h"
17
#include "target/s390x/kvm/pv.h"
18
#include "hw/s390x/s390-pci-bus.h"
19
#include "hw/s390x/s390-pci-kvm.h"
20
#include "hw/s390x/s390-pci-inst.h"
21
#include "hw/s390x/s390-pci-vfio.h"
22
#include "cpu_models.h"
24
bool s390_pci_kvm_interp_allowed(void)
26
return kvm_s390_get_zpci_op() && !s390_is_pv();
29
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist)
32
struct kvm_s390_zpci_op args = {
34
.op = KVM_S390_ZPCIOP_REG_AEN,
35
.u.reg_aen.ibv = fib->aibv,
36
.u.reg_aen.sb = fib->aisb,
37
.u.reg_aen.noi = FIB_DATA_NOI(fib->data),
38
.u.reg_aen.isc = FIB_DATA_ISC(fib->data),
39
.u.reg_aen.sbo = FIB_DATA_AISBO(fib->data),
40
.u.reg_aen.flags = (assist) ? 0 : KVM_S390_ZPCIOP_REGAEN_HOST
47
rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
55
int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev)
59
struct kvm_s390_zpci_op args = {
61
.op = KVM_S390_ZPCIOP_DEREG_AEN
72
if (!s390_pci_get_host_fh(pbdev, &args.fh)) {
76
rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);