From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPsIm-00026t-Pv for qemu-devel@nongnu.org; Thu, 13 Aug 2015 09:12:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPsIh-0000Vv-QK for qemu-devel@nongnu.org; Thu, 13 Aug 2015 09:12:12 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:1938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPsIh-0000Ub-LQ for qemu-devel@nongnu.org; Thu, 13 Aug 2015 09:12:07 -0400 Message-ID: <55CC97A4.6090009@imgtec.com> Date: Thu, 13 Aug 2015 14:12:04 +0100 From: Leon Alrae MIME-Version: 1.0 References: <20150710095643.13280.88767.stgit@PASHA-ISP> <20150710095708.13280.43365.stgit@PASHA-ISP> In-Reply-To: <20150710095708.13280.43365.stgit@PASHA-ISP> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 04/11] target-mips: improve exception handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, rth7680@gmail.com, agraf@suse.de, aurelien@aurel32.net On 10/07/2015 10:57, Pavel Dovgalyuk wrote: > @@ -2364,14 +2363,12 @@ static void gen_st_cond (DisasContext *ctx, uint32_t opc, int rt, > #if defined(TARGET_MIPS64) > case OPC_SCD: > case R6_OPC_SCD: > - save_cpu_state(ctx, 1); > op_st_scd(t1, t0, rt, ctx); > opn = "scd"; > break; > #endif > case OPC_SC: > case R6_OPC_SC: > - save_cpu_state(ctx, 1); > op_st_sc(t1, t0, rt, ctx); > opn = "sc"; > break; Wouldn't we be better off assuming that conditional stores in linux-user always take an exception (we generate fake EXCP_SC exception) and avoid retranslation? After applying these changes I observed significant impact on performance in linux-user multithreaded apps, for instance c11-atomic-exec test before the change took just 2 seconds to finish, whereas now more than 30... Thanks, Leon PS: multithreaded MIPS apps fail horribly in linux-user with this patch as it's much more likely to get bitten by race conditions in translate-all.c. But "translate-all.c thread-safety" patch series seem to fix it.