assigned-dev.h 859 B

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