From patchwork Wed Feb 1 15:05:31 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: 9549897 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 41FB860415 for ; Wed, 1 Feb 2017 15:06:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30B0827E3E for ; Wed, 1 Feb 2017 15:06:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2487427F2B; Wed, 1 Feb 2017 15:06:31 +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 8DF0727E3E for ; Wed, 1 Feb 2017 15:06:30 +0000 (UTC) Received: from localhost ([::1]:51433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYwUO-00071B-LG for patchwork-qemu-devel@patchwork.kernel.org; Wed, 01 Feb 2017 10:06:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYwTu-000711-8E for qemu-devel@nongnu.org; Wed, 01 Feb 2017 10:05:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYwTr-0008BI-Rx for qemu-devel@nongnu.org; Wed, 01 Feb 2017 10:05:58 -0500 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:38316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYwTr-0008B7-LX for qemu-devel@nongnu.org; Wed, 01 Feb 2017 10:05:55 -0500 Received: by mail-wm0-x22d.google.com with SMTP id r141so42510712wmg.1 for ; Wed, 01 Feb 2017 07:05:55 -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=9rwdq3Xh9IfDoaq313pwMZMfOiptU3X+EOJS0QMym6c=; b=jATXNQxubNNHEkKbIZkdprOLQUDW4taZFhYQ5sKnsMapIrUtMio+2xuO4YEk/4EM7R cEqXGzLttJmxAyLAj6lwJ6J+jKG/N/74odwGufQJhHdRt1gNbDqFd2LE4eye4ONlhnYr csOcnOpLOk7ZzUgGAyEolyt77Vs+59FXvxFZE= 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=9rwdq3Xh9IfDoaq313pwMZMfOiptU3X+EOJS0QMym6c=; b=OcrDs7xuivDtKnzR8aTO1Xn3COi6EKQeTP+aVQrKQsXHCf6K/th05Q6PF6zctO3XL8 xoEJDYHIduMMqO4U3HgU+5PEHMO/yoihaXvuJRIvrwjt2rAoGNI9hkKJBC8f3aqISgF5 bmVmfHUJgfmU1O0HdvvzCDOS7cRIxA2M/syaYpKEBEWzQpr5hU2iv0kIi4DL9FGZ2gNQ /tSoFrrQsWtNPMEW9bfAbKb4u3PX9T5u8Nn5uZ0R7hKGZmQZtKuLZhQR0IGviuDTa6Eu 48mHACTVSh8ygl4xQR88m8iW+SrBWWM/0vcecPxFs76zFS2bI1TjA4plo4MOY3VAh2gK 9yzA== X-Gm-Message-State: AIkVDXK39+3xuxHNOeu3rqddIKPXa9mUclLalfSfTqpIF5Jw0dEUPqJtoecYKHmFp7dY/po0 X-Received: by 10.28.143.204 with SMTP id r195mr3318940wmd.32.1485961554547; Wed, 01 Feb 2017 07:05:54 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h75sm34497329wrh.37.2017.02.01.07.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 07:05:51 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 822E33E0AD5; Wed, 1 Feb 2017 15:05:53 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=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: Wed, 1 Feb 2017 15:05:31 +0000 Message-Id: <20170201150553.9381-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170201150553.9381-1-alex.bennee@linaro.org> References: <20170201150553.9381-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::22d Subject: [Qemu-devel] [PATCH v9 03/25] 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, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, serge.fdrv@gmail.com, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , bamvor.zhangjian@linaro.org, rth@twiddle.net 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 fa08c733da..dbbfe11175 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)