From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCDeK-00087N-Uc for qemu-devel@nongnu.org; Mon, 26 Mar 2012 13:24:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCDeD-0008Sn-4S for qemu-devel@nongnu.org; Mon, 26 Mar 2012 13:24:08 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:59136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCDeC-0008S1-Vs for qemu-devel@nongnu.org; Mon, 26 Mar 2012 13:24:01 -0400 Received: by iafj26 with SMTP id j26so10174123iaf.4 for ; Mon, 26 Mar 2012 10:23:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1332767238-22730-1-git-send-email-cedric.vincent@st.com> References: <1332767238-22730-1-git-send-email-cedric.vincent@st.com> Date: Mon, 26 Mar 2012 18:23:58 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?Q?C=C3=A9dric_VINCENT?= Cc: Riku Voipio , qemu-devel , Aurelien Jarno 2012/3/26 C=C3=A9dric VINCENT : > This reverts commit fd4bab10 "target-sh4: optimize exceptions": [cc'ing Aurelien as the author of that commit] > the function cpu_restore_state() isn't expected to be called in user-mode= , Is this really true? host_signal_handler() calls cpu_signal_handler() calls handle_cpu_signala) calls cpu_restore_state() so hopefully it's OK to be called in at least *some* situations... > as a consequence it isn't protected from race conditions. =C2=A0For > 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]. Can you explain a bit further what the race condition is that occurs here? NB the whole tb_lock thing is broken anyway. thanks -- PMM