diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 42160b031fcd..11cfd897aac6 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -223,13 +223,6 @@ void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code) | |||
223 | } | 223 | } |
224 | EXPORT_SYMBOL_GPL(kvm_queue_exception_e); | 224 | EXPORT_SYMBOL_GPL(kvm_queue_exception_e); |
225 | 225 | ||
226 | static void __queue_exception(struct kvm_vcpu *vcpu) | ||
227 | { | ||
228 | kvm_x86_ops->queue_exception(vcpu, vcpu->arch.exception.nr, | ||
229 | vcpu->arch.exception.has_error_code, | ||
230 | vcpu->arch.exception.error_code); | ||
231 | } | ||
232 | |||
233 | /* | 226 | /* |
234 | * Load the pae pdptrs. Return true is they are all valid. | 227 | * Load the pae pdptrs. Return true is they are all valid. |
235 | */ | 228 | */ |
@@ -3491,9 +3484,16 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu) | |||
3491 | kvm_x86_ops->update_cr8_intercept(vcpu, tpr, max_irr); | 3484 | kvm_x86_ops->update_cr8_intercept(vcpu, tpr, max_irr); |
3492 | } | 3485 | } |
3493 | 3486 | ||
3494 | static void inject_pending_irq(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | 3487 | static void inject_pending_event(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) |
3495 | { | 3488 | { |
3496 | /* try to reinject previous events if any */ | 3489 | /* try to reinject previous events if any */ |
3490 | if (vcpu->arch.exception.pending) { | ||
3491 | kvm_x86_ops->queue_exception(vcpu, vcpu->arch.exception.nr, | ||
3492 | vcpu->arch.exception.has_error_code, | ||
3493 | vcpu->arch.exception.error_code); | ||
3494 | return; | ||
3495 | } | ||
3496 | |||
3497 | if (vcpu->arch.nmi_injected) { | 3497 | if (vcpu->arch.nmi_injected) { |
3498 | kvm_x86_ops->set_nmi(vcpu); | 3498 | kvm_x86_ops->set_nmi(vcpu); |
3499 | return; | 3499 | return; |
@@ -3574,10 +3574,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
3574 | goto out; | 3574 | goto out; |
3575 | } | 3575 | } |
3576 | 3576 | ||
3577 | if (vcpu->arch.exception.pending) | 3577 | inject_pending_event(vcpu, kvm_run); |
3578 | __queue_exception(vcpu); | ||
3579 | else | ||
3580 | inject_pending_irq(vcpu, kvm_run); | ||
3581 | 3578 | ||
3582 | /* enable NMI/IRQ window open exits if needed */ | 3579 | /* enable NMI/IRQ window open exits if needed */ |
3583 | if (vcpu->arch.nmi_pending) | 3580 | if (vcpu->arch.nmi_pending) |