aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2008-06-06 15:37:36 -0400
committerAvi Kivity <avi@qumranet.com>2008-06-24 05:16:59 -0400
commit06e05645661211b9eaadaf6344c335d2e80f0ba2 (patch)
tree8846d2a5052aec44141e811c0a76fdb39c2e77ca /arch/x86/kvm/x86.c
parentd4acf7e7abe45457e751525a2a4d5b693dfdd597 (diff)
KVM: close timer injection race window in __vcpu_run
If a timer fires after kvm_inject_pending_timer_irqs() but before local_irq_disable() the code will enter guest mode and only inject such timer interrupt the next time an unrelated event causes an exit. It would be simpler if the timer->pending irq conversion could be done with IRQ's disabled, so that the above problem cannot happen. For now introduce a new vcpu requests bit to cancel guest entry. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b90744a1dc3a..b08812d6b34c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2774,6 +2774,7 @@ again:
2774 } 2774 }
2775 } 2775 }
2776 2776
2777 clear_bit(KVM_REQ_PENDING_TIMER, &vcpu->requests);
2777 kvm_inject_pending_timer_irqs(vcpu); 2778 kvm_inject_pending_timer_irqs(vcpu);
2778 2779
2779 preempt_disable(); 2780 preempt_disable();