From patchwork Wed Jun 2 14:26:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 103815 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o52ERErK002801 for ; Wed, 2 Jun 2010 14:27:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757718Ab0FBO1M (ORCPT ); Wed, 2 Jun 2010 10:27:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27619 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755500Ab0FBO1L (ORCPT ); Wed, 2 Jun 2010 10:27:11 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o52ERAQi003467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Jun 2010 10:27:11 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o52ER9HY021218; Wed, 2 Jun 2010 10:27:09 -0400 Received: from amt.cnet (vpn-9-197.rdu.redhat.com [10.11.9.197]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o52ER8qV032673; Wed, 2 Jun 2010 10:27:08 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 3F26068A8F6; Wed, 2 Jun 2010 11:26:28 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o52EQQtk023101; Wed, 2 Jun 2010 11:26:26 -0300 Date: Wed, 2 Jun 2010 11:26:26 -0300 From: Marcelo Tosatti To: kvm Cc: Gleb Natapov Subject: KVM: read apic->irr with ioapic lock held Message-ID: <20100602142626.GA23058@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 02 Jun 2010 14:27:15 +0000 (UTC) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 3bc4fdb..1149c60 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c @@ -193,12 +193,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;