diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm.h | 18 | ||||
-rw-r--r-- | include/linux/kvm_host.h | 12 |
2 files changed, 27 insertions, 3 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f18b86fa8655..35525ac63337 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -83,6 +83,7 @@ struct kvm_irqchip { | |||
83 | #define KVM_EXIT_S390_SIEIC 13 | 83 | #define KVM_EXIT_S390_SIEIC 13 |
84 | #define KVM_EXIT_S390_RESET 14 | 84 | #define KVM_EXIT_S390_RESET 14 |
85 | #define KVM_EXIT_DCR 15 | 85 | #define KVM_EXIT_DCR 15 |
86 | #define KVM_EXIT_NMI 16 | ||
86 | 87 | ||
87 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 88 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
88 | struct kvm_run { | 89 | struct kvm_run { |
@@ -387,6 +388,14 @@ struct kvm_trace_rec { | |||
387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 | 388 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 |
388 | #endif | 389 | #endif |
389 | #define KVM_CAP_IOMMU 18 | 390 | #define KVM_CAP_IOMMU 18 |
391 | #if defined(CONFIG_X86) | ||
392 | #define KVM_CAP_DEVICE_MSI 20 | ||
393 | #endif | ||
394 | /* Bug in KVM_SET_USER_MEMORY_REGION fixed: */ | ||
395 | #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 | ||
396 | #if defined(CONFIG_X86) | ||
397 | #define KVM_CAP_USER_NMI 22 | ||
398 | #endif | ||
390 | 399 | ||
391 | /* | 400 | /* |
392 | * ioctls for VM fds | 401 | * ioctls for VM fds |
@@ -458,6 +467,8 @@ struct kvm_trace_rec { | |||
458 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) | 467 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) |
459 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) | 468 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
460 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 469 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
470 | /* Available with KVM_CAP_NMI */ | ||
471 | #define KVM_NMI _IO(KVMIO, 0x9a) | ||
461 | 472 | ||
462 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 473 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
463 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 474 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |
@@ -500,10 +511,17 @@ struct kvm_assigned_irq { | |||
500 | __u32 guest_irq; | 511 | __u32 guest_irq; |
501 | __u32 flags; | 512 | __u32 flags; |
502 | union { | 513 | union { |
514 | struct { | ||
515 | __u32 addr_lo; | ||
516 | __u32 addr_hi; | ||
517 | __u32 data; | ||
518 | } guest_msi; | ||
503 | __u32 reserved[12]; | 519 | __u32 reserved[12]; |
504 | }; | 520 | }; |
505 | }; | 521 | }; |
506 | 522 | ||
507 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 523 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
508 | 524 | ||
525 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) | ||
526 | |||
509 | #endif | 527 | #endif |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bb92be2153bc..eafabd5c66b2 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,8 +307,14 @@ 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; |
312 | struct pci_dev *dev; | 319 | struct pci_dev *dev; |
313 | struct kvm *kvm; | 320 | struct kvm *kvm; |
@@ -316,8 +323,7 @@ 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); | 323 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); |
317 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 324 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
318 | struct kvm_irq_ack_notifier *kian); | 325 | struct kvm_irq_ack_notifier *kian); |
319 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | 326 | 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); | 327 | int kvm_request_irq_source_id(struct kvm *kvm); |
322 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 328 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
323 | 329 | ||