[152/205] KVM: read apic->irr with ioapic lock held

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Friday, July 30, 2010 - 10:52 am

2.6.34-stable review patch.  If anyone has any objections, please let us know.

------------------

Read ioapic->irr inside ioapic->lock protected section.

KVM-Stable-Tag
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
(cherry picked from commit 07dc7263b99e4ddad2b4c69765a428ccb7d48938)
---
 virt/kvm/ioapic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -192,12 +192,13 @@ static int ioapic_deliver(struct kvm_ioa
 
 int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)
 {
-	u32 old_irr = ioapic->irr;
+	u32 old_irr;
 	u32 mask = 1 << irq;
 	union kvm_ioapic_redirect_entry entry;
 	int ret = 1;
 
 	spin_lock(&ioapic->lock);
+	old_irr = ioapic->irr;
 	if (irq >= 0 && irq < IOAPIC_NUM_PINS) {
 		entry = ioapic->redirtbl[irq];
 		level ^= entry.fields.polarity;


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[152/205] KVM: read apic->irr with ioapic lock held, Greg KH, (Fri Jul 30, 10:52 am)