From patchwork Thu Mar 2 19:53:30 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: 94809 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp324281qgd; Thu, 2 Mar 2017 11:58:55 -0800 (PST) X-Received: by 10.55.150.198 with SMTP id y189mr325488qkd.305.1488484735687; Thu, 02 Mar 2017 11:58: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 b38si7723437qte.119.2017.03.02.11.58.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 02 Mar 2017 11:58: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]:54288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWsH-0003Jv-Dx for patch@linaro.org; Thu, 02 Mar 2017 14:58:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWnH-0007xW-7Z for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjWnG-0002TI-C0 for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:43 -0500 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:34511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjWnG-0002T6-5f for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:42 -0500 Received: by mail-wr0-x234.google.com with SMTP id l37so60262185wrc.1 for ; Thu, 02 Mar 2017 11:53:41 -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=DDm08/obXFO5/zyPEDyy5yaU4fu9phkTVhZl5s7VrQo=; b=ZUBgqa+wN2Ylo+cpvaj00T8VEaiv3qbYSsu8J0VbDw0GtxkzYyE56zol9yDDqtF8N6 zTbNlsfBXxAWR7dE518gWcYSiZcg2pcKX2hEPDpnWpAYKQJTXJIwbDCW7pr6H/wau73r h1HZPtYXcCri2m//FDTQeyAHR05jkNRlyN0GU= 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=DDm08/obXFO5/zyPEDyy5yaU4fu9phkTVhZl5s7VrQo=; b=pfTmSqujpaFTD8B12nR1yEq7i14pZK8omTjgkqdSk6j0+dU4iQlcxU3HGObSKH1KgO Dr/qKygzZOWgqi7HV3FsNMxXIiAXs8P0VjN0yMVmKbbp/rx2H1CxzedWQxmIrlGqtfJO I9AmOc5oLUtj3Yf8LjJZPPDRQglezfkxZ/bJ+knO41dUkUQ1aj3i1ceM2rSoACML5/hl Md9XxSqtIh5c92CDXz47b9Lexc64U3S5KzQ+jLiRpWjP5RGL9oQJWlxdp7GXI8Keu0mG w8PQFoECMarTw59tmbXWH/u8HZmEvJ+UW4fFR8hypa4JBfzrW1Almkr6661zcE7wlohY CkkQ== X-Gm-Message-State: AMke39mGC9udIFl3MU6RfgODtS57xr1h8UIErer9+QWHH4fdAb1GEsAh7XvpxGmY+m+/Wdme X-Received: by 10.223.173.199 with SMTP id w65mr13961566wrc.125.1488484420946; Thu, 02 Mar 2017 11:53:40 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 136sm2800020wmg.12.2017.03.02.11.53.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 11:53:37 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5DE2E3E04B2; Thu, 2 Mar 2017 19:53:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net, pbonzini@redhat.com Date: Thu, 2 Mar 2017 19:53:30 +0000 Message-Id: <20170302195337.31558-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170302195337.31558-1-alex.bennee@linaro.org> References: <20170302195337.31558-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::234 Subject: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert 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 , a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, cota@braap.org, bobby.prani@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While on MTTCG hosts it is very important that updates to cpu->interrupt_request are protected by the BQL not all guests have been converted to the correct locking yet. As a result we are seeing breaking on non-MTTCG enabled guests in production builds. The locking in the guests needs to be fixed but while running single threaded they will continue to work. By moving the asserts to tcg_debug_asserts() they will still be useful during conversion work (much like the existing assert_memory_lock/assert_tb_lock asserts). Signed-off-by: Alex Bennée --- translate-all.c | 2 +- translate-common.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/translate-all.c b/translate-all.c index 9bac061c9b..7ee273410d 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1928,7 +1928,7 @@ void dump_opcount_info(FILE *f, fprintf_function cpu_fprintf) void cpu_interrupt(CPUState *cpu, int mask) { - g_assert(qemu_mutex_iothread_locked()); + tcg_debug_assert(qemu_mutex_iothread_locked()); cpu->interrupt_request |= mask; cpu->tcg_exit_req = 1; } diff --git a/translate-common.c b/translate-common.c index d504dd0d33..24e05c077a 100644 --- a/translate-common.c +++ b/translate-common.c @@ -22,6 +22,7 @@ #include "qom/cpu.h" #include "sysemu/cpus.h" #include "qemu/main-loop.h" +#include "tcg.h" uintptr_t qemu_real_host_page_size; intptr_t qemu_real_host_page_mask; @@ -31,7 +32,7 @@ intptr_t qemu_real_host_page_mask; static void tcg_handle_interrupt(CPUState *cpu, int mask) { int old_mask; - g_assert(qemu_mutex_iothread_locked()); + tcg_debug_assert(qemu_mutex_iothread_locked()); old_mask = cpu->interrupt_request; cpu->interrupt_request |= mask;