diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index dbcff38dfcc3..491eda308289 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -155,11 +155,16 @@ void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long addr, | |||
155 | u32 error_code) | 155 | u32 error_code) |
156 | { | 156 | { |
157 | ++vcpu->stat.pf_guest; | 157 | ++vcpu->stat.pf_guest; |
158 | if (vcpu->arch.exception.pending && vcpu->arch.exception.nr == PF_VECTOR) { | 158 | if (vcpu->arch.exception.pending) { |
159 | printk(KERN_DEBUG "kvm: inject_page_fault:" | 159 | if (vcpu->arch.exception.nr == PF_VECTOR) { |
160 | " double fault 0x%lx\n", addr); | 160 | printk(KERN_DEBUG "kvm: inject_page_fault:" |
161 | vcpu->arch.exception.nr = DF_VECTOR; | 161 | " double fault 0x%lx\n", addr); |
162 | vcpu->arch.exception.error_code = 0; | 162 | vcpu->arch.exception.nr = DF_VECTOR; |
163 | vcpu->arch.exception.error_code = 0; | ||
164 | } else if (vcpu->arch.exception.nr == DF_VECTOR) { | ||
165 | /* triple fault -> shutdown */ | ||
166 | set_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests); | ||
167 | } | ||
163 | return; | 168 | return; |
164 | } | 169 | } |
165 | vcpu->arch.cr2 = addr; | 170 | vcpu->arch.cr2 = addr; |
@@ -2676,6 +2681,11 @@ again: | |||
2676 | r = 0; | 2681 | r = 0; |
2677 | goto out; | 2682 | goto out; |
2678 | } | 2683 | } |
2684 | if (test_and_clear_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests)) { | ||
2685 | kvm_run->exit_reason = KVM_EXIT_SHUTDOWN; | ||
2686 | r = 0; | ||
2687 | goto out; | ||
2688 | } | ||
2679 | } | 2689 | } |
2680 | 2690 | ||
2681 | kvm_inject_pending_timer_irqs(vcpu); | 2691 | kvm_inject_pending_timer_irqs(vcpu); |