diff options
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index eafabd5c66b2..ec49d0be7f52 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -316,6 +316,7 @@ struct kvm_assigned_dev_kernel { | |||
316 | #define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9) | 316 | #define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9) |
317 | unsigned long irq_requested_type; | 317 | unsigned long irq_requested_type; |
318 | int irq_source_id; | 318 | int irq_source_id; |
319 | int flags; | ||
319 | struct pci_dev *dev; | 320 | struct pci_dev *dev; |
320 | struct kvm *kvm; | 321 | struct kvm *kvm; |
321 | }; | 322 | }; |
@@ -327,13 +328,16 @@ void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); | |||
327 | int kvm_request_irq_source_id(struct kvm *kvm); | 328 | int kvm_request_irq_source_id(struct kvm *kvm); |
328 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 329 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
329 | 330 | ||
330 | #ifdef CONFIG_DMAR | 331 | #ifdef CONFIG_IOMMU_API |
331 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, | 332 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, |
332 | unsigned long npages); | 333 | unsigned long npages); |
333 | int kvm_iommu_map_guest(struct kvm *kvm, | 334 | int kvm_iommu_map_guest(struct kvm *kvm); |
334 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
335 | int kvm_iommu_unmap_guest(struct kvm *kvm); | 335 | int kvm_iommu_unmap_guest(struct kvm *kvm); |
336 | #else /* CONFIG_DMAR */ | 336 | int kvm_assign_device(struct kvm *kvm, |
337 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
338 | int kvm_deassign_device(struct kvm *kvm, | ||
339 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
340 | #else /* CONFIG_IOMMU_API */ | ||
337 | static inline int kvm_iommu_map_pages(struct kvm *kvm, | 341 | static inline int kvm_iommu_map_pages(struct kvm *kvm, |
338 | gfn_t base_gfn, | 342 | gfn_t base_gfn, |
339 | unsigned long npages) | 343 | unsigned long npages) |
@@ -341,9 +345,7 @@ static inline int kvm_iommu_map_pages(struct kvm *kvm, | |||
341 | return 0; | 345 | return 0; |
342 | } | 346 | } |
343 | 347 | ||
344 | static inline int kvm_iommu_map_guest(struct kvm *kvm, | 348 | static inline int kvm_iommu_map_guest(struct kvm *kvm) |
345 | struct kvm_assigned_dev_kernel | ||
346 | *assigned_dev) | ||
347 | { | 349 | { |
348 | return -ENODEV; | 350 | return -ENODEV; |
349 | } | 351 | } |
@@ -352,7 +354,19 @@ static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | |||
352 | { | 354 | { |
353 | return 0; | 355 | return 0; |
354 | } | 356 | } |
355 | #endif /* CONFIG_DMAR */ | 357 | |
358 | static inline int kvm_assign_device(struct kvm *kvm, | ||
359 | struct kvm_assigned_dev_kernel *assigned_dev) | ||
360 | { | ||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | static inline int kvm_deassign_device(struct kvm *kvm, | ||
365 | struct kvm_assigned_dev_kernel *assigned_dev) | ||
366 | { | ||
367 | return 0; | ||
368 | } | ||
369 | #endif /* CONFIG_IOMMU_API */ | ||
356 | 370 | ||
357 | static inline void kvm_guest_enter(void) | 371 | static inline void kvm_guest_enter(void) |
358 | { | 372 | { |