diff mbox

[09/12] Fix missing spin_lock in PIT timer.

Message ID 1259678201-11203-10-git-send-email-clalance@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Lalancette Dec. 1, 2009, 2:36 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index dc6eff4..ece7e12 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -606,10 +606,13 @@  void kvm_pit_reset(struct kvm_pit *pit)
 static void pit_mask_notifer(struct kvm_irq_mask_notifier *kimn, bool mask)
 {
 	struct kvm_pit *pit = container_of(kimn, struct kvm_pit, mask_notifier);
+	unsigned long flags;
 
 	if (!mask) {
+		spin_lock_irqsave(&pit->pit_state.inject_lock, flags);
 		atomic_set(&pit->pit_state.pit_timer.pending, 0);
 		pit->pit_state.irq_ack = 1;
+		spin_unlock_irqrestore(&pit->pit_state.inject_lock, flags);
 	}
 }