aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2009-05-11 04:48:15 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:32:39 -0400
commit890ca9aefa78f7831f8f633cab9e4803636dffe4 (patch)
tree1a66ca576b6b0c396de79214e2262dc218ec5d56 /include
parentaf24a4e4aec77ef16c1971cf4465f767ba946034 (diff)
KVM: Add MCE support
The related MSRs are emulated. MCE capability is exported via extension KVM_CAP_MCE and ioctl KVM_X86_GET_MCE_CAP_SUPPORTED. A new vcpu ioctl command KVM_X86_SETUP_MCE is used to setup MCE emulation such as the mcg_cap. MCE is injected via vcpu ioctl command KVM_X86_SET_MCE. Extended machine-check state (MCG_EXT_P) and CMCI are not implemented. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 3db5d8d37485..7b17141c47c9 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -415,6 +415,9 @@ struct kvm_trace_rec {
415#define KVM_CAP_ASSIGN_DEV_IRQ 29 415#define KVM_CAP_ASSIGN_DEV_IRQ 29
416/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ 416/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */
417#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 417#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
418#ifdef __KVM_HAVE_MCE
419#define KVM_CAP_MCE 31
420#endif
418 421
419#ifdef KVM_CAP_IRQ_ROUTING 422#ifdef KVM_CAP_IRQ_ROUTING
420 423
@@ -454,6 +457,19 @@ struct kvm_irq_routing {
454 457
455#endif 458#endif
456 459
460#ifdef KVM_CAP_MCE
461/* x86 MCE */
462struct kvm_x86_mce {
463 __u64 status;
464 __u64 addr;
465 __u64 misc;
466 __u64 mcg_status;
467 __u8 bank;
468 __u8 pad1[7];
469 __u64 pad2[3];
470};
471#endif
472
457/* 473/*
458 * ioctls for VM fds 474 * ioctls for VM fds
459 */ 475 */
@@ -541,6 +557,10 @@ struct kvm_irq_routing {
541#define KVM_NMI _IO(KVMIO, 0x9a) 557#define KVM_NMI _IO(KVMIO, 0x9a)
542/* Available with KVM_CAP_SET_GUEST_DEBUG */ 558/* Available with KVM_CAP_SET_GUEST_DEBUG */
543#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) 559#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
560/* MCE for x86 */
561#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
562#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
563#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
544 564
545/* 565/*
546 * Deprecated interfaces 566 * Deprecated interfaces