| 1 | /* |
| 2 | * s390 PCI KVM interfaces |
| 3 | * |
| 4 | * Copyright 2022 IBM Corp. |
| 5 | * Author(s): Matthew Rosato <mjrosato@linux.ibm.com> |
| 6 | * |
| 7 | * This work is licensed under the terms of the GNU GPL, version 2 or (at |
| 8 | * your option) any later version. See the COPYING file in the top-level |
| 9 | * directory. |
| 10 | */ |
| 11 | |
| 12 | #ifndef HW_S390_PCI_KVM_H |
| 13 | #define HW_S390_PCI_KVM_H |
| 14 | |
| 15 | #include "hw/s390x/s390-pci-bus.h" |
| 16 | #include "hw/s390x/s390-pci-inst.h" |
| 17 | #include "system/kvm.h" |
| 18 | |
| 19 | #ifdef CONFIG_KVM |
| 20 | static inline void s390_pcihost_kvm_realize(void) |
| 21 | { |
| 22 | kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled(); |
| 23 | } |
| 24 | |
| 25 | bool s390_pci_kvm_interp_allowed(void); |
| 26 | int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist); |
| 27 | int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev); |
| 28 | #else |
| 29 | static inline void s390_pcihost_kvm_realize(void) {} |
| 30 | static inline bool s390_pci_kvm_interp_allowed(void) |
| 31 | { |
| 32 | return false; |
| 33 | } |
| 34 | static inline int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, |
| 35 | bool assist) |
| 36 | { |
| 37 | return -EINVAL; |
| 38 | } |
| 39 | static inline int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev) |
| 40 | { |
| 41 | return -EINVAL; |
| 42 | } |
| 43 | #endif |
| 44 | |
| 45 | #endif |