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: 93045 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2459708qgi; Wed, 1 Feb 2017 07:08:21 -0800 (PST) X-Received: by 10.55.136.2 with SMTP id k2mr3057431qkd.310.1485961701372; Wed, 01 Feb 2017 07:08: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 m90si14617050qtd.98.2017.02.01.07.08.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 01 Feb 2017 07:08: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]:51440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYwWC-00089k-UZ for patch@linaro.org; Wed, 01 Feb 2017 10:08:20 -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_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: 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_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. 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 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)