diff options
Diffstat (limited to 'target-s390x/kvm.c')
-rw-r--r-- | target-s390x/kvm.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 4d9ac4ad0c..650d3a5da9 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -932,3 +932,22 @@ void kvm_s390_enable_css_support(S390CPU *cpu) void kvm_arch_init_irq_routing(KVMState *s) { } + +int kvm_s390_assign_subch_ioeventfd(int fd, uint32_t sch, int vq, bool assign) +{ + struct kvm_ioeventfd kick = { + .flags = KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY | + KVM_IOEVENTFD_FLAG_DATAMATCH, + .fd = fd, + .datamatch = vq, + .addr = sch, + .len = 8, + }; + if (!kvm_check_extension(kvm_state, KVM_CAP_IOEVENTFD)) { + return -ENOSYS; + } + if (!assign) { + kick.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN; + } + return kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &kick); +} |