From patchwork Mon Feb 13 12:09:56 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: 93853 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1065160qgi; Mon, 13 Feb 2017 04:15:15 -0800 (PST) X-Received: by 10.200.54.178 with SMTP id a47mr21888958qtc.132.1486988115402; Mon, 13 Feb 2017 04:15:15 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a126si7067206qkd.322.2017.02.13.04.15.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 13 Feb 2017 04:15:15 -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]:56182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdFXE-0000sJ-La for patch@linaro.org; Mon, 13 Feb 2017 07:15:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdFSI-0005Aw-7z for qemu-devel@nongnu.org; Mon, 13 Feb 2017 07:10:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdFSF-0002Vs-VY for qemu-devel@nongnu.org; Mon, 13 Feb 2017 07:10:06 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:37104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdFSF-0002Ve-PQ for qemu-devel@nongnu.org; Mon, 13 Feb 2017 07:10:03 -0500 Received: by mail-wm0-x236.google.com with SMTP id v77so91990253wmv.0 for ; Mon, 13 Feb 2017 04:10:03 -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=cFHVaXOsqXY0bjh76gQ0IMVfO712zwPhztUjiMlX4T1BglfR6oy7BhL5M+fDpLdfTA ucHaOX+MfkEq/tlzBATv4q8+Zl9/e+NuhpcOS3Es6pSDXQPrkDk6x7NYaaQsdr/jnak+ KXN2dcdywG26oL1YfvkrQ43LX5MQt32qOXfek= 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=TbkXJMS8JXSwpMLolYPvTOBfYI38IG6uNHIq1bkNYdQgym9qnsaKnX+08HkRWszrvY xWCQXXC+3ETo26f5RO2itt+RUwXrUHW5/hLHbpq/MPISmyhQY0qwRpr7Deb0yWKCe0Tr Wt1GDEv6X7Ys1YRpvA6xuOBFpAiDuSfZM774C+PckWPoQ0Ub19liciVBVyJxTAzbuDIw JqKRII9YscUfChXx39l2UPrQmgCu1QXTzcp8dOqNStfoeuX7PaECDUmqJE+6eTJLnvF7 tcx5xQ5Z21RUMwNN/OTCZae3VtEaURHxUQ7p9SoGetis4kuDhdObihYz8rMs+ej1jsl4 cx/Q== X-Gm-Message-State: AMke39mlE7/aRPxmkUhzbziPUi31bccNfQOLcr9x/aO6O+POhyzFjKrgStGAg+gteBJ5XY5P X-Received: by 10.28.24.5 with SMTP id 5mr17820871wmy.1.1486987802790; Mon, 13 Feb 2017 04:10:02 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w69sm5099567wmw.22.2017.02.13.04.09.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 04:10:00 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 579B63E0A9A; Mon, 13 Feb 2017 12:10:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net Date: Mon, 13 Feb 2017 12:09:56 +0000 Message-Id: <20170213121017.12907-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170213121017.12907-1-alex.bennee@linaro.org> References: <20170213121017.12907-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::236 Subject: [Qemu-devel] [PATCH v12 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_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)