diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-06 03:53:05 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-06 03:53:05 -0500 |
commit | 3d7a96f5a485b7d06c2379f343d7312af89ec9e2 (patch) | |
tree | 5f097f68eb0f9fd3fa4a10f38672e300e9127b10 /include/linux/kvm_host.h | |
parent | 723cbe0775514853c22dc45005af59c360916af1 (diff) | |
parent | 238c6d54830c624f34ac9cf123ac04aebfca5013 (diff) |
Merge branch 'linus' into tracing/kmemtrace2
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bb92be2153bc..ec49d0be7f52 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/preempt.h> | 17 | #include <linux/preempt.h> |
18 | #include <linux/marker.h> | 18 | #include <linux/marker.h> |
19 | #include <linux/msi.h> | ||
19 | #include <asm/signal.h> | 20 | #include <asm/signal.h> |
20 | 21 | ||
21 | #include <linux/kvm.h> | 22 | #include <linux/kvm.h> |
@@ -306,9 +307,16 @@ struct kvm_assigned_dev_kernel { | |||
306 | int host_busnr; | 307 | int host_busnr; |
307 | int host_devfn; | 308 | int host_devfn; |
308 | int host_irq; | 309 | int host_irq; |
310 | bool host_irq_disabled; | ||
309 | int guest_irq; | 311 | int guest_irq; |
310 | int irq_requested; | 312 | struct msi_msg guest_msi; |
313 | #define KVM_ASSIGNED_DEV_GUEST_INTX (1 << 0) | ||
314 | #define KVM_ASSIGNED_DEV_GUEST_MSI (1 << 1) | ||
315 | #define KVM_ASSIGNED_DEV_HOST_INTX (1 << 8) | ||
316 | #define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9) | ||
317 | unsigned long irq_requested_type; | ||
311 | int irq_source_id; | 318 | int irq_source_id; |
319 | int flags; | ||
312 | struct pci_dev *dev; | 320 | struct pci_dev *dev; |
313 | struct kvm *kvm; | 321 | struct kvm *kvm; |
314 | }; | 322 | }; |
@@ -316,18 +324,20 @@ void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | |||
316 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); | 324 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); |
317 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 325 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
318 | struct kvm_irq_ack_notifier *kian); | 326 | struct kvm_irq_ack_notifier *kian); |
319 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | 327 | void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); |
320 | struct kvm_irq_ack_notifier *kian); | ||
321 | int kvm_request_irq_source_id(struct kvm *kvm); | 328 | int kvm_request_irq_source_id(struct kvm *kvm); |
322 | 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); |
323 | 330 | ||
324 | #ifdef CONFIG_DMAR | 331 | #ifdef CONFIG_IOMMU_API |
325 | 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, |
326 | unsigned long npages); | 333 | unsigned long npages); |
327 | int kvm_iommu_map_guest(struct kvm *kvm, | 334 | int kvm_iommu_map_guest(struct kvm *kvm); |
328 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
329 | int kvm_iommu_unmap_guest(struct kvm *kvm); | 335 | int kvm_iommu_unmap_guest(struct kvm *kvm); |
330 | #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 */ | ||
331 | static inline int kvm_iommu_map_pages(struct kvm *kvm, | 341 | static inline int kvm_iommu_map_pages(struct kvm *kvm, |
332 | gfn_t base_gfn, | 342 | gfn_t base_gfn, |
333 | unsigned long npages) | 343 | unsigned long npages) |
@@ -335,9 +345,7 @@ static inline int kvm_iommu_map_pages(struct kvm *kvm, | |||
335 | return 0; | 345 | return 0; |
336 | } | 346 | } |
337 | 347 | ||
338 | static inline int kvm_iommu_map_guest(struct kvm *kvm, | 348 | static inline int kvm_iommu_map_guest(struct kvm *kvm) |
339 | struct kvm_assigned_dev_kernel | ||
340 | *assigned_dev) | ||
341 | { | 349 | { |
342 | return -ENODEV; | 350 | return -ENODEV; |
343 | } | 351 | } |
@@ -346,7 +354,19 @@ static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | |||
346 | { | 354 | { |
347 | return 0; | 355 | return 0; |
348 | } | 356 | } |
349 | #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 */ | ||
350 | 370 | ||
351 | static inline void kvm_guest_enter(void) | 371 | static inline void kvm_guest_enter(void) |
352 | { | 372 | { |