]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] kvm: vmx: handle triple faults by returning EXIT_REASON_SHUTDOWN to userspace
authorAvi Kivity <avi@qumranet.com>
Mon, 12 Feb 2007 08:54:36 +0000 (00:54 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:40 +0000 (09:48 -0800)
Just like svm.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/kvm/vmx.c
drivers/kvm/vmx.h

index 5cc1a6ec0174a841a41c18a106a4f9bb6cba5d90..e152caa9d9f933345524da51ceb3dbed0430f351 100644 (file)
@@ -1375,6 +1375,11 @@ static int handle_external_interrupt(struct kvm_vcpu *vcpu,
        return 1;
 }
 
+static int handle_triple_fault(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
+{
+       kvm_run->exit_reason = KVM_EXIT_SHUTDOWN;
+       return 0;
+}
 
 static int get_io_count(struct kvm_vcpu *vcpu, u64 *count)
 {
@@ -1635,6 +1640,7 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
                                      struct kvm_run *kvm_run) = {
        [EXIT_REASON_EXCEPTION_NMI]           = handle_exception,
        [EXIT_REASON_EXTERNAL_INTERRUPT]      = handle_external_interrupt,
+       [EXIT_REASON_TRIPLE_FAULT]            = handle_triple_fault,
        [EXIT_REASON_IO_INSTRUCTION]          = handle_io,
        [EXIT_REASON_CR_ACCESS]               = handle_cr,
        [EXIT_REASON_DR_ACCESS]               = handle_dr,
index 4c0ab151836ae5374c4fd61efc685b03838c38e3..d0dc93df411b2dd940054539cbafab15a049edaa 100644 (file)
@@ -180,6 +180,7 @@ enum vmcs_field {
 
 #define EXIT_REASON_EXCEPTION_NMI       0
 #define EXIT_REASON_EXTERNAL_INTERRUPT  1
+#define EXIT_REASON_TRIPLE_FAULT        2
 
 #define EXIT_REASON_PENDING_INTERRUPT   7