From patchwork Thu Jan 19 17:04: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: 91984 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp378972qgi; Thu, 19 Jan 2017 09:09:21 -0800 (PST) X-Received: by 10.55.23.78 with SMTP id i75mr8462918qkh.212.1484845761462; Thu, 19 Jan 2017 09:09:21 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n33si2987733qtb.310.2017.01.19.09.09.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 19 Jan 2017 09:09:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUGD9-0001WE-3f for patch@linaro.org; Thu, 19 Jan 2017 12:09:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUG9E-0007OU-01 for qemu-devel@nongnu.org; Thu, 19 Jan 2017 12:05:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUG9A-0007iI-Ob for qemu-devel@nongnu.org; Thu, 19 Jan 2017 12:05:15 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cUG9A-0007fp-HJ for qemu-devel@nongnu.org; Thu, 19 Jan 2017 12:05:12 -0500 Received: by mail-wm0-x235.google.com with SMTP id r144so2706420wme.1 for ; Thu, 19 Jan 2017 09:05:10 -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=Y2+v1flgVFTMeQ/XkdeqfH3M+QZGMjHF/xurefWed+s=; b=DGFTkKGN1RRdGnL86V0ezyHnzUUr6VAY/qcRdDOpKdsoc1JMiqelLAVTg+4LpY69IU /+CXZDLNCJ4lVs/KDza353AiyVwAKqTWrq4MrB8EYd9BZP1EhOdyoLu2v8eJZl3boh5G yi2IpkgWY5FMuAVNqfYIpHTTP4WJBzCPX5Jr8= 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=Y2+v1flgVFTMeQ/XkdeqfH3M+QZGMjHF/xurefWed+s=; b=tgf4snoKe8SeSWrwogVrkht9olEZAjQoNImLDVZGPKWfeYlGpmJ2ro4gnAa1PVHxa6 +ybgcm8qs47oRe0tUaHErKorxgbWJ9u1OTCzvEfCqH6HSw4cKjziAb7yAG3hfVBP3uwU mNb/9xFjEGPXQ4Y2jVsGz/XNXTV6DfqdmOPbJsN7d7riR+ZvabJA2z1VMqlh6dCedRUy VJ0z0e6S6JVtGYayq9LXG3gypA29IKG37HaRjkdO5QHfi2rJXCkDJ3m3I5ASF8MOYsU6 4YSOP8VbRROnuD8P8AWuRP01+DjBIyLzl9NMb988WKdULbxItkOjgkop26D4F8DGWi/x OT4g== X-Gm-Message-State: AIkVDXLR8XlAzXrdjo6C4foQsSv0deQxRV96kDY4CgMujcDn4jp2y+Q8T56niysxfbfuYNQ5 X-Received: by 10.223.161.194 with SMTP id v2mr8014566wrv.144.1484845509500; Thu, 19 Jan 2017 09:05:09 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u81sm14079347wmu.10.2017.01.19.09.05.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 09:05:08 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D754F3E29F7; Thu, 19 Jan 2017 17:05:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: mttcg@listserver.greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com Date: Thu, 19 Jan 2017 17:04:43 +0000 Message-Id: <20170119170507.16185-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170119170507.16185-1-alex.bennee@linaro.org> References: <20170119170507.16185-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::235 Subject: [Qemu-devel] [PATCH v7 03/27] 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: peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, serge.fdrv@gmail.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , bamvor.zhangjian@linaro.org, rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Pranith Kumar The recent patch enabling lock assertions uncovered the missing lock acquisition in cpu_exec_step(). This patch adds them. CC: Richard Henderson CC: Alex Bennée Signed-off-by: Pranith Kumar --- cpu-exec.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.11.0 Reviewed-by: Richard Henderson diff --git a/cpu-exec.c b/cpu-exec.c index 4188fed3c6..1b8685dc21 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)