From patchwork Thu Feb 9 17:08:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 9565203 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3162F601C3 for ; Thu, 9 Feb 2017 17:09:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F7C72853F for ; Thu, 9 Feb 2017 17:09:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 120EA28542; Thu, 9 Feb 2017 17:09:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 959672853F for ; Thu, 9 Feb 2017 17:09:46 +0000 (UTC) Received: from localhost ([::1]:39122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbsE5-0006QC-JU for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Feb 2017 12:09:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbsDL-0006Bq-6b for qemu-devel@nongnu.org; Thu, 09 Feb 2017 12:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbsDI-0002Nh-Nf for qemu-devel@nongnu.org; Thu, 09 Feb 2017 12:08:59 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:38482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbsDI-0002NO-Hw for qemu-devel@nongnu.org; Thu, 09 Feb 2017 12:08:56 -0500 Received: by mail-wm0-x22a.google.com with SMTP id r141so25971819wmg.1 for ; Thu, 09 Feb 2017 09:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GsAStCPpP1ctxg7U8bRW3nIjP1TUftaWQMxancgZdxQ=; b=FLTObVueR72kHiQNWNBUK6D2HC4RgVFWGOGjcl/fQr8UhTypx/ujvhoQ3IFvsEsvKd RMu2DGDgfILC290BX/eXriOgRiqcIGVbLeZVheiOWRfO4tulbQD/eCYMSHYoQ1cT58Zw aPusV0unmhQZKb0yd3BS4TTUbk3sQvaLvSITE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GsAStCPpP1ctxg7U8bRW3nIjP1TUftaWQMxancgZdxQ=; b=uLYXwIY088L/03OdPkT1QDk/vJIRHYB9cDaSK313ngoyHFbWeu7JtR+ENleuw8dKhN CeUWFAwmh6SUg/5IjDK+kevIoxZ4kdQnto+eVgt2q8EaOY/JA30/59TQtIwMaSlHRIA8 rzHr7m/nxcg9B93AC6+mWgKYYCETHl3b2SFkbDZfzm0rDEl7Y2gnTneVXd49ZBifBnOT zzAgk8CZ9IZgvaVW2XagVnugwyE+nXCJQjyv3ytef1jxCd9t80QPKfV6jHlP9E69c+px /hTUtZiWbnpm9cBWBO+A96NMvD7Iie2F3s6psjtSQIqopQbPC8Y4ixYB2BqROFocLCqS PpQQ== X-Gm-Message-State: AMke39l/mew/T0J54R5RWb1yfanonOqGgw6GAcZEp3xPiKZ798dCKz9/YICsiDfJPdKvJbVp X-Received: by 10.28.186.197 with SMTP id k188mr23709483wmf.25.1486660135538; Thu, 09 Feb 2017 09:08:55 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l67sm9783160wmf.1.2017.02.09.09.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 09:08:52 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EB2CA3E2D12; Thu, 9 Feb 2017 17:09:04 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net Date: Thu, 9 Feb 2017 17:08:43 +0000 Message-Id: <20170209170904.5713-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170209170904.5713-1-alex.bennee@linaro.org> References: <20170209170904.5713-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22a Subject: [Qemu-devel] [PATCH v11 03/24] mttcg: Add missing tb_lock/unlock() in cpu_exec_step() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mttcg@listserver.greensocs.com, nikunj@linux.vnet.ibm.com, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, cota@braap.org, serge.fdrv@gmail.com, pbonzini@redhat.com, bobby.prani@gmail.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , bamvor.zhangjian@linaro.org, fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Pranith Kumar The recent patch enabling lock assertions uncovered the missing lock acquisition in cpu_exec_step(). This patch adds them. Signed-off-by: Pranith Kumar Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- cpu-exec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu-exec.c b/cpu-exec.c index 57583f16a0..97ff37eb73 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -233,14 +233,18 @@ static void cpu_exec_step(CPUState *cpu) uint32_t flags; cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); + tb_lock(); tb = tb_gen_code(cpu, pc, cs_base, flags, 1 | CF_NOCACHE | CF_IGNORE_ICOUNT); tb->orig_tb = NULL; + tb_unlock(); /* execute the generated code */ trace_exec_tb_nocache(tb, pc); cpu_tb_exec(cpu, tb); + tb_lock(); tb_phys_invalidate(tb, -1); tb_free(tb); + tb_unlock(); } void cpu_exec_step_atomic(CPUState *cpu)