summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorMarcelo Tosatti2010-05-04 04:04:27 +0200
committerAvi Kivity2010-05-19 10:36:33 +0200
commitf1d86e469b60f9e1afed5c17a6e723c2c9c55ceb (patch)
tree6a0714f44067f2991d4b6910f646ccc691bd3deb /arch/x86/kvm/x86.c
parentKVM: VMX: Atomically switch efer if EPT && !EFER.NX (diff)
downloadkernel-qcow2-linux-f1d86e469b60f9e1afed5c17a6e723c2c9c55ceb.tar.gz
kernel-qcow2-linux-f1d86e469b60f9e1afed5c17a6e723c2c9c55ceb.tar.xz
kernel-qcow2-linux-f1d86e469b60f9e1afed5c17a6e723c2c9c55ceb.zip
KVM: x86: properly update ready_for_interrupt_injection
The recent changes to emulate string instructions without entering guest mode exposed a bug where pending interrupts are not properly reflected in ready_for_interrupt_injection. The result is that userspace overwrites a previously queued interrupt, when irqchip's are emulated in userspace. Fix by always updating state before returning to userspace. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6b2ce1d2d748..dff08e527ec7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4653,7 +4653,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
}
srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
- post_kvm_run_save(vcpu);
vapic_exit(vcpu);
@@ -4703,6 +4702,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
r = __vcpu_run(vcpu);
out:
+ post_kvm_run_save(vcpu);
if (vcpu->sigset_active)
sigprocmask(SIG_SETMASK, &sigsaved, NULL);