From patchwork Mon Jan 2 18:42:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9494023 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 1E0D862AB2 for ; Mon, 2 Jan 2017 18:44:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1057A1FF35 for ; Mon, 2 Jan 2017 18:44:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 033052684F; Mon, 2 Jan 2017 18:44:19 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 7C7D91FF35 for ; Mon, 2 Jan 2017 18:44:18 +0000 (UTC) Received: from localhost ([::1]:58497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO7aj-0001HF-IA for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Jan 2017 13:44:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO7aL-0001GK-V9 for qemu-devel@nongnu.org; Mon, 02 Jan 2017 13:43:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO7aI-0005uC-Tg for qemu-devel@nongnu.org; Mon, 02 Jan 2017 13:43:54 -0500 Received: from mail-yw0-x244.google.com ([2607:f8b0:4002:c05::244]:36001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cO7aI-0005sf-PR for qemu-devel@nongnu.org; Mon, 02 Jan 2017 13:43:50 -0500 Received: by mail-yw0-x244.google.com with SMTP id r204so36288055ywb.3 for ; Mon, 02 Jan 2017 10:43:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GteCr+cMUQSGaNHcT/UePnBsA8VphGo4zVDC0WLCIm4=; b=YyJXKKkyHpPu3LjiKMia6qqXUOcxfK16EyOEUndXEv/xiyLDCfAh8u7Axs5VwwDqer rps93rcD9jSF8+S6kXAjRl8h8EPZEZDB+PC8jkLlhMMaoBPA6KCL7l6Xw9XgtUl/OgqF rFTdfaJzdib4J0V3R3mrT3dyZ32aJ5LnOE3FG6TQsWqjhXHr6nKH+cKky2wggoD/MueC bk8obFOpZQn/yGBgL2VvCzmHwPLBb5p4OkHbhUfDYgq6KaOVUGW6UbbKPUmtUOGAJCGF iVcfQLQax9YVqzs+hmTGP/VGm7rsgN23cJsaHCNLtYyTntWe9zZLLAhlHDZRlG9eWEW2 z4og== 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:mime-version :content-transfer-encoding; bh=GteCr+cMUQSGaNHcT/UePnBsA8VphGo4zVDC0WLCIm4=; b=BdfKmOwoa563PMqAn+j1v1Fkt+5evz62R5n/Btl4rlL2/hpj7jar+kQJQN91kzw3gX o3JIQx6rCjBXnwzpWD3smVnh/wAU2XjHg+gifcrJd/Wd0XA28y0S7TBp9IqfEyDddEZC BDhOzbqlGyrKl0oi/ZBF1oj2GIaXuTqF47e9ritxV2Lbny0bsfDXEheAGhEQ57/udA2I Yf84Q8gdILR8zxe2sRYn+8f6pEYs65QgPA8MkyBKdbzsJM+mBptGdGJCtT1LZkHLPQT+ ZWilAOKk77wbJD1XkInChJfpzj7bxy281i6X9mUKhFG+DJesdMb5MV6YIpMxnL9YNwAE 5+lQ== X-Gm-Message-State: AIkVDXJiQdyBZoiOcwRqLB0ItYm1gr9NzDa8xlPaOn+nLIulldceTMlGYZnME6OVFsVi1Q== X-Received: by 10.13.238.68 with SMTP id x65mr27675834ywe.46.1483382628543; Mon, 02 Jan 2017 10:43:48 -0800 (PST) Received: from localhost.localdomain (c-73-207-178-95.hsd1.ga.comcast.net. [73.207.178.95]) by smtp.gmail.com with ESMTPSA id y133sm27578189ywc.21.2017.01.02.10.43.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 10:43:48 -0800 (PST) From: Pranith Kumar To: Paolo Bonzini , Peter Crosthwaite , Richard Henderson , qemu-devel@nongnu.org (open list:Overall) Date: Mon, 2 Jan 2017 13:42:58 -0500 Message-Id: <20170102184258.2442-1-bobby.prani@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::244 Subject: [Qemu-devel] [PATCH] 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(+) diff --git a/cpu-exec.c b/cpu-exec.c index aa8318d864..ef328087be 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -234,14 +234,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)