1 #ifndef ARCH_X86_KVM_ASSIGNED_DEV_H 2 #define ARCH_X86_KVM_ASSIGNED_DEV_H 3 4 #include <linux/kvm_host.h> 5 6 #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT 7 int kvm_assign_device(struct kvm *kvm, struct pci_dev *pdev); 8 int kvm_deassign_device(struct kvm *kvm, struct pci_dev *pdev); 9 10 int kvm_iommu_map_guest(struct kvm *kvm); 11 int kvm_iommu_unmap_guest(struct kvm *kvm); 12 13 long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, 14 unsigned long arg); 15 16 void kvm_free_all_assigned_devices(struct kvm *kvm); 17 #else kvm_iommu_unmap_guest(struct kvm * kvm)18static inline int kvm_iommu_unmap_guest(struct kvm *kvm) 19 { 20 return 0; 21 } 22 kvm_vm_ioctl_assigned_device(struct kvm * kvm,unsigned ioctl,unsigned long arg)23static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, 24 unsigned long arg) 25 { 26 return -ENOTTY; 27 } 28 kvm_free_all_assigned_devices(struct kvm * kvm)29static inline void kvm_free_all_assigned_devices(struct kvm *kvm) {} 30 #endif /* CONFIG_KVM_DEVICE_ASSIGNMENT */ 31 32 #endif /* ARCH_X86_KVM_ASSIGNED_DEV_H */ 33