From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM: protect concurrent make_all_cpus_request Date: Thu, 18 Jun 2009 11:45:30 +0300 Message-ID: <4A39FEAA.4090100@redhat.com> References: <20090617135347.GC14583@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Andrea Arcangeli To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:53579 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756218AbZFRIpG (ORCPT ); Thu, 18 Jun 2009 04:45:06 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5I8j9VT020211 for ; Thu, 18 Jun 2009 04:45:09 -0400 In-Reply-To: <20090617135347.GC14583@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 06/17/2009 04:53 PM, Marcelo Tosatti wrote: > make_all_cpus_request contains a race condition which can > trigger false request completed status, as follows: > > CPU0 CPU1 > > if (test_and_set_bit(req,&vcpu->requests)) > .... if (test_and_set_bit(req,&vcpu->requests)) > .. return > proceed to smp_call_function_many(wait=1) > > Use a spinlock to serialize concurrent CPUs. > > Applied, thanks. -- error compiling committee.c: too many arguments to function