s390x/pci: enable adapter event notification for interpreted devices

Use the associated kvm ioctl operation to enable adapter event notification
and forwarding for devices when requested.  This feature will be set up
with or without firmware assist based upon the 'forwarding_assist' setting.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-Id: <20220902172737.170349-6-mjrosato@linux.ibm.com>
[thuth: Rename "forwarding_assist" property to "forwarding-assist"]
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Matthew Rosato 2022-09-02 13:27:34 -04:00 committed by Thomas Huth
parent 15d0e7942d
commit d0bc7091c2
5 changed files with 100 additions and 5 deletions

View file

@ -351,6 +351,7 @@ struct S390PCIBusDevice {
bool pci_unplug_request_processed;
bool unplug_requested;
bool interp;
bool forwarding_assist;
QTAILQ_ENTRY(S390PCIBusDevice) link;
};

View file

@ -12,13 +12,27 @@
#ifndef HW_S390_PCI_KVM_H
#define HW_S390_PCI_KVM_H
#include "hw/s390x/s390-pci-bus.h"
#include "hw/s390x/s390-pci-inst.h"
#ifdef CONFIG_KVM
bool s390_pci_kvm_interp_allowed(void);
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist);
int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev);
#else
static inline bool s390_pci_kvm_interp_allowed(void)
{
return false;
}
static inline int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib,
bool assist)
{
return -EINVAL;
}
static inline int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev)
{
return -EINVAL;
}
#endif
#endif