From patchwork Mon Feb 6 15:30:53 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: 93439 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1824297obz; Mon, 6 Feb 2017 07:33:55 -0800 (PST) X-Received: by 10.55.142.135 with SMTP id q129mr9419720qkd.83.1486395235390; Mon, 06 Feb 2017 07:33:55 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c7si734925qkg.18.2017.02.06.07.33.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 06 Feb 2017 07:33:55 -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]:49025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1calIg-00071E-PI for patch@linaro.org; Mon, 06 Feb 2017 10:33:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1calG2-0005ip-8t for qemu-devel@nongnu.org; Mon, 06 Feb 2017 10:31:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1calG1-0008SM-3N for qemu-devel@nongnu.org; Mon, 06 Feb 2017 10:31:10 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:36191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1calG0-0008S0-Tt for qemu-devel@nongnu.org; Mon, 06 Feb 2017 10:31:09 -0500 Received: by mail-wm0-x22e.google.com with SMTP id c85so125223694wmi.1 for ; Mon, 06 Feb 2017 07:31:08 -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=FckgN3Wa7XVji30sODJU+C7V7o9UST0i658mwy8ujaylcQx9JVQiCf09Kyj8G+ruiX 2AEwygN13v0X279WdavPUjRJztqqNbqfzcGHR7rp3O5Oe36SWbwID3BognmXq6tDHupW Y61M77IL2KL+U8GCA9q5Q0TrzcHH0twjO1MCA= 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=PkOkKWpdjrssCAIdrd/GtbI+XVEueqqjCORfRUxrGxDZJqR8HoPv1kyeFsHWepTnG9 q7fZQkL5kjBr0P6IaD1l+h4vDy46cojwWocWPGcs1Le7pb485XhT5F6m6kwt2HJ2ho3r hbzH9uMv3bXyNFSY1awZ5Z7brFdC7NkE0AYIbvD2ZCsfF2EiI9hb/FifcbUEUXC7nfJU 2vjW3qOZG/DshN7lZTSwKNZWy9MBZ+22ISD0XkzeRwirlIdWGRzBD1zcnMsl+gUH32Lt ai+es+9DzHlKtET6BMlDiY1lC0cfOm+4DTPxnW3Y0q3plnIt0AOc2/dWMSxc6IGhcja4 +D/w== X-Gm-Message-State: AMke39mMUNk53gmzDyBF9EZxaDlbp5Xk4HzcbHk8IwbH2BgirsPX6/DIVN861RMTmNzTMUvO X-Received: by 10.28.232.91 with SMTP id f88mr8619267wmh.27.1486395067944; Mon, 06 Feb 2017 07:31:07 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c133sm13456891wmd.13.2017.02.06.07.31.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 07:31:05 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id BE8593E1247; Mon, 6 Feb 2017 15:31:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net Date: Mon, 6 Feb 2017 15:30:53 +0000 Message-Id: <20170206153113.27729-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170206153113.27729-1-alex.bennee@linaro.org> References: <20170206153113.27729-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::22e Subject: [Qemu-devel] [PATCH v10 03/23] 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_Benn=C3=A9e?= , bamvor.zhangjian@linaro.org, fred.konrad@greensocs.com 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. Signed-off-by: Pranith Kumar Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- cpu-exec.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.11.0 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)