diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2010-06-02 11:26:26 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-02 10:30:06 -0700 |
commit | 957e6faf8748ae85f165283b7b0ecf0044315b8e (patch) | |
tree | 59b263013b61b7537ef5f20d80c62e71d8f3342d /virt | |
parent | 192a2fb14aef04d86caa255312b1f594f89074b9 (diff) |
KVM: read apic->irr with ioapic lock held
Read ioapic->irr inside ioapic->lock protected section.
KVM-Stable-Tag
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
(cherry picked from commit 07dc7263b99e4ddad2b4c69765a428ccb7d48938)
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/ioapic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 7c79c1d76d0c..3500dee9cf2b 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c @@ -192,12 +192,13 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq) 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; |