summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-06-02 11:26:26 -0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-02 10:26:44 -0700
commit624a42cc67a592526c60a93dbcf0a1ed39b58814 (patch)
treec18511f5615aca6d5cc7c2c7e8d6dc44dd04f302
parent9a7c231ca5905895764203e97f87457ae045f2c0 (diff)
downloadlwn-624a42cc67a592526c60a93dbcf0a1ed39b58814.tar.gz
lwn-624a42cc67a592526c60a93dbcf0a1ed39b58814.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> (cherry picked from comit 07dc7263b99e4ddad2b4c69765a428ccb7d48938)
-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 38a2d20b89de..fc4a7e3dd724 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -177,12 +177,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;
mutex_lock(&ioapic->lock);
+ old_irr = ioapic->irr;
if (irq >= 0 && irq < IOAPIC_NUM_PINS) {
entry = ioapic->redirtbl[irq];
level ^= entry.fields.polarity;