Commit 988ad74f authored by Avi Kivity's avatar Avi Kivity Committed by Linus Torvalds

[PATCH] kvm: vmx: handle triple faults by returning EXIT_REASON_SHUTDOWN to userspace

Just like svm.
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e119d117
...@@ -1375,6 +1375,11 @@ static int handle_external_interrupt(struct kvm_vcpu *vcpu, ...@@ -1375,6 +1375,11 @@ static int handle_external_interrupt(struct kvm_vcpu *vcpu,
return 1; 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) 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, ...@@ -1635,6 +1640,7 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
struct kvm_run *kvm_run) = { struct kvm_run *kvm_run) = {
[EXIT_REASON_EXCEPTION_NMI] = handle_exception, [EXIT_REASON_EXCEPTION_NMI] = handle_exception,
[EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt, [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt,
[EXIT_REASON_TRIPLE_FAULT] = handle_triple_fault,
[EXIT_REASON_IO_INSTRUCTION] = handle_io, [EXIT_REASON_IO_INSTRUCTION] = handle_io,
[EXIT_REASON_CR_ACCESS] = handle_cr, [EXIT_REASON_CR_ACCESS] = handle_cr,
[EXIT_REASON_DR_ACCESS] = handle_dr, [EXIT_REASON_DR_ACCESS] = handle_dr,
......
...@@ -180,6 +180,7 @@ enum vmcs_field { ...@@ -180,6 +180,7 @@ enum vmcs_field {
#define EXIT_REASON_EXCEPTION_NMI 0 #define EXIT_REASON_EXCEPTION_NMI 0
#define EXIT_REASON_EXTERNAL_INTERRUPT 1 #define EXIT_REASON_EXTERNAL_INTERRUPT 1
#define EXIT_REASON_TRIPLE_FAULT 2
#define EXIT_REASON_PENDING_INTERRUPT 7 #define EXIT_REASON_PENDING_INTERRUPT 7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment