From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDc41-0007hb-B8 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 09:40:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDc3u-00041W-UZ for qemu-devel@nongnu.org; Fri, 30 Mar 2012 09:40:24 -0400 Received: from eu1sys200aog119.obsmtp.com ([207.126.144.147]:36215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDc3u-00040u-LN for qemu-devel@nongnu.org; Fri, 30 Mar 2012 09:40:18 -0400 Date: Fri, 30 Mar 2012 15:36:01 +0200 From: "cedric.vincent@st.com" Message-ID: <20120330133601.GA3311@gnx2503> References: <1332767238-22730-1-git-send-email-cedric.vincent@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1332767238-22730-1-git-send-email-cedric.vincent@st.com> Content-Language: en-US Subject: Re: [Qemu-devel] [PATCH] sh4-linux-user: fix multi-threading regression. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Peter Maydell Cc: Riku Voipio , Aurelien Jarno On Mon, Mar 26, 2012 at 03:07:18PM +0200, Cedric VINCENT wrote: > This reverts commit fd4bab10 "target-sh4: optimize exceptions": the > function cpu_restore_state() isn't expected to be called in user-mode, > as a consequence it isn't protected from race conditions. For > information, syscalls are exceptions on Linux/SH4. > > There were two possible fixes: either "tb_lock" is acquired/released > around the call to cpu_restore_state() [1] or the commit that > introduced this regression is reverted [2]. I will submit a new version of this patch where the commit fd4bab10 isn't reverted and the call to cpu_restore_state() is protected by tb_lock instead. Actually most of the SH4 FPU helpers may call cpu_restore_state() indirectly, this is the same problem as with helper_trapa(). Regards, Cédric.