diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2008-09-26 03:30:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:51:42 -0500 |
commit | c4abb7c9cde24b7351a47328ef866e6a2bbb1ad0 (patch) | |
tree | 85cef82232898397e645e53334655712af54085f /include | |
parent | 26df99c6c5807115f06d4e1abae397b7f5f3e00c (diff) |
KVM: x86: Support for user space injected NMIs
Introduces the KVM_NMI IOCTL to the generic x86 part of KVM for
injecting NMIs from user space and also extends the statistic report
accordingly.
Based on the original patch by Sheng Yang.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f18b86fa8655..44fd7fa0af2b 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -83,18 +83,22 @@ 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 | ||
87 | #define KVM_EXIT_NMI_WINDOW_OPEN 17 | ||
86 | 88 | ||
87 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 89 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
88 | struct kvm_run { | 90 | struct kvm_run { |
89 | /* in */ | 91 | /* in */ |
90 | __u8 request_interrupt_window; | 92 | __u8 request_interrupt_window; |
91 | __u8 padding1[7]; | 93 | __u8 request_nmi_window; |
94 | __u8 padding1[6]; | ||
92 | 95 | ||
93 | /* out */ | 96 | /* out */ |
94 | __u32 exit_reason; | 97 | __u32 exit_reason; |
95 | __u8 ready_for_interrupt_injection; | 98 | __u8 ready_for_interrupt_injection; |
96 | __u8 if_flag; | 99 | __u8 if_flag; |
97 | __u8 padding2[2]; | 100 | __u8 ready_for_nmi_injection; |
101 | __u8 padding2; | ||
98 | 102 | ||
99 | /* in (pre_kvm_run), out (post_kvm_run) */ | 103 | /* in (pre_kvm_run), out (post_kvm_run) */ |
100 | __u64 cr8; | 104 | __u64 cr8; |
@@ -387,6 +391,7 @@ struct kvm_trace_rec { | |||
387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 | 391 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 |
388 | #endif | 392 | #endif |
389 | #define KVM_CAP_IOMMU 18 | 393 | #define KVM_CAP_IOMMU 18 |
394 | #define KVM_CAP_NMI 19 | ||
390 | 395 | ||
391 | /* | 396 | /* |
392 | * ioctls for VM fds | 397 | * ioctls for VM fds |
@@ -458,6 +463,8 @@ struct kvm_trace_rec { | |||
458 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) | 463 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) |
459 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) | 464 | #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) | 465 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
466 | /* Available with KVM_CAP_NMI */ | ||
467 | #define KVM_NMI _IO(KVMIO, 0x9a) | ||
461 | 468 | ||
462 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 469 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
463 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 470 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |