From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LffNV-00066c-3W for qemu-devel@nongnu.org; Fri, 06 Mar 2009 14:06:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LffNT-00065c-AO for qemu-devel@nongnu.org; Fri, 06 Mar 2009 14:06:36 -0500 Received: from [199.232.76.173] (port=51594 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LffNT-00065S-2h for qemu-devel@nongnu.org; Fri, 06 Mar 2009 14:06:35 -0500 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:51171 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LffNS-00016z-HU for qemu-devel@nongnu.org; Fri, 06 Mar 2009 14:06:34 -0500 Received: from [10.0.66.9] ([10.0.66.9] verified) by fe02-cgp.akado.ru (CommuniGate Pro SMTP 5.1.16) with ESMTP id 46044603 for qemu-devel@nongnu.org; Fri, 06 Mar 2009 22:06:32 +0300 Date: Fri, 6 Mar 2009 22:06:38 +0300 (MSK) From: malc Subject: Re: [Qemu-devel] [RFC][PATCH] Fix race condition on access to env->interrupt_request In-Reply-To: <20090306173143.GA13368@volta.aurel32.net> Message-ID: References: <20090306173143.GA13368@volta.aurel32.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, 6 Mar 2009, Aurelien Jarno wrote: > env->interrupt_request is accessed as the bit level from both main code > and signal handler, making a race condition possible even on CISC CPU. > This causes freeze of QEMU under high load when running the dyntick > clock. > > The patch below move the bit corresponding to CPU_INTERRUPT_EXIT in a > separate variable, declared as volatile sig_atomic_t, so it should be > work even on RISC CPU. > > We may want to move the cpu_interrupt(env, CPU_INTERRUPT_EXIT) case in > its own function and get rid of CPU_INTERRUPT_EXIT. That can be done > later, I wanted to keep the patch short for easier review. > > Signed-off-by: Aurelien Jarno > Looks good. -- mailto:av1474@comtv.ru