From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUKwj-0001aV-FA for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUKwg-0006e9-1M for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:35:53 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:42478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUKwf-0006dv-Ek for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:35:49 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0F7FA20F78 for ; Tue, 25 Aug 2015 16:35:48 -0400 (EDT) Date: Tue, 25 Aug 2015 16:36:12 -0400 From: "Emilio G. Cota" Message-ID: <20150825203612.GB29063@flamenco> References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-23-git-send-email-cota@braap.org> <55DA6EDC.1080603@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DA6EDC.1080603@redhat.com> Subject: Re: [Qemu-devel] [RFC 22/38] cpu: update interrupt_request atomically List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@greensocs.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, alex.bennee@linaro.org, Frederic Konrad On Sun, Aug 23, 2015 at 18:09:48 -0700, Paolo Bonzini wrote: > On 23/08/2015 17:23, Emilio G. Cota wrote: > > Signed-off-by: Emilio G. Cota > > --- > > cpu-exec.c | 9 ++++++--- > > exec.c | 2 +- > > hw/openrisc/cputimer.c | 2 +- > > qom/cpu.c | 4 ++-- > > target-arm/helper-a64.c | 2 +- > > target-arm/helper.c | 2 +- > > target-i386/helper.c | 2 +- > > target-i386/seg_helper.c | 14 +++++++------- > > target-i386/svm_helper.c | 4 ++-- > > target-openrisc/interrupt_helper.c | 2 +- > > target-openrisc/sys_helper.c | 2 +- > > target-ppc/excp_helper.c | 8 ++++---- > > target-ppc/helper_regs.h | 2 +- > > target-s390x/helper.c | 2 +- > > target-unicore32/softmmu.c | 2 +- > > translate-all.c | 4 ++-- > > 16 files changed, 33 insertions(+), 30 deletions(-) > > Is this needed if you have patch 23 anyway? Sorry, this should have been in the commit log. This patch is needed as is. One real risk this is protecting against is the call of cpu_interrupt(cpu_foo) when the calling thread is not cpu_foo's thread--this write to interrupt_request might race with other writes, e.g. another call to cpu_interrupt from another thread, or the clearing of interrupt_request by cpu_foo. Patch 23 fixes another issue--bootup hangs without it. The amount of code wrapped by the iothread lock can be reduced, though. Will fix. Thanks, Emilio