From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM: read apic->irr with ioapic lock held Date: Wed, 02 Jun 2010 18:12:04 +0300 Message-ID: <4C0674C4.70807@redhat.com> References: <20100602142626.GA23058@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm , Gleb Natapov To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38909 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757959Ab0FBPMF (ORCPT ); Wed, 2 Jun 2010 11:12:05 -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 o52FC5Il002374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Jun 2010 11:12:05 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o52FC46E002652 for ; Wed, 2 Jun 2010 11:12:05 -0400 In-Reply-To: <20100602142626.GA23058@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 06/02/2010 05:26 PM, Marcelo Tosatti wrote: > Read ioapic->irr inside ioapic->lock protected section. > > KVM-Stable-Tag > Signed-off-by: Marcelo Tosatti > > 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; > Yikes. -- error compiling committee.c: too many arguments to function