summaryrefslogtreecommitdiffstats
path: root/virt/kvm/ioapic.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-06-02 16:26:26 +0200
committerAvi Kivity <avi@redhat.com>2010-06-10 19:29:03 +0200
commit07dc7263b99e4ddad2b4c69765a428ccb7d48938 (patch)
treea1c5cd9a50362b03c60c93f11ed34739d4f9da0f /virt/kvm/ioapic.c
parentKVM: ia64: Add missing spin_unlock in kvm_arch_hardware_enable() (diff)
downloadlinux-07dc7263b99e4ddad2b4c69765a428ccb7d48938.tar.xz
linux-07dc7263b99e4ddad2b4c69765a428ccb7d48938.zip
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>
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r--virt/kvm/ioapic.c3
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;