From patchwork Thu Mar 9 11:17:04 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: 95096 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp309345qgd; Thu, 9 Mar 2017 03:18:43 -0800 (PST) X-Received: by 10.55.67.66 with SMTP id q63mr12501669qka.136.1489058323916; Thu, 09 Mar 2017 03:18:43 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p189si5404773qkf.269.2017.03.09.03.18.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 09 Mar 2017 03:18:43 -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]:33284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clw5h-0005B0-Dr for patch@linaro.org; Thu, 09 Mar 2017 06:18:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clw4G-0005AJ-R8 for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:17:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clw4C-0006SR-DM for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:17:12 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:34993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clw4C-0006Rl-6y for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:17:08 -0500 Received: by mail-wm0-x229.google.com with SMTP id v186so136671760wmd.0 for ; Thu, 09 Mar 2017 03:17:06 -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=SkTd3CH7l8UHPbuv8BPHdFHw4/IN/vrT/NDTweOjPNk=; b=cQToEygcCB3j/x4Ghzi0K5vdOwLiC3GiC8g7SuV7pXhke13/KNo1gtMY615dGJZXNs LofB9+Aj0kCM/sHk7jxCZT2hMH2FEjY4mCj0FVhsfJxtrDgJK1fxG0hmk5odN7e/FsRU QjVnXcc77X5l/InuhQSJUH6CCZ0DR5Mc6yygc= 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=SkTd3CH7l8UHPbuv8BPHdFHw4/IN/vrT/NDTweOjPNk=; b=WfthanT7eQFNbqtda45aYiMcjXozaAlgPwHpPfdy0RzbuKuZFHAFMuw3j7tiSB6aLB ghvgqJY14ZO4NP5cm6PUugNR4dwzWiCE+ZyBFbQPyEbkZlW9IkMemShHZSS7/GcBnIpl 56wTveOloMLLTV2C7rWty1rrS70W/FQL/tWtbjIMbz8+QG6bMaBXkPnctVpKE0T9f+7c vtbDricZDis2oYad1y5WDMJrbyoNt6DeU+KR1iBg/x4/V58LMBhc1z6IyvLIM1caOmda Xm2NCzkkWVuQwW3eDMqBLKyyIIA9QN0q2GX3N99YW6y5jCPPCdNHRAs4A2qL7JAD7Qw6 pTFA== X-Gm-Message-State: AMke39kNTrgCJykZ1xd2C8ssR5uKt/mciCOEAePtrxBZY2rRvRRluI4d78W0zZG0xzd7z28V X-Received: by 10.28.91.82 with SMTP id p79mr9667348wmb.130.1489058225462; Thu, 09 Mar 2017 03:17:05 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e72sm8430905wma.5.2017.03.09.03.17.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:17:03 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 171253E0145; Thu, 9 Mar 2017 11:17:15 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 9 Mar 2017 11:17:04 +0000 Message-Id: <20170309111714.20394-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170309111714.20394-1-alex.bennee@linaro.org> References: <20170309111714.20394-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::229 Subject: [Qemu-devel] [PULL 01/11] vl/cpus: be smarter with icount and MTTCG 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: Paolo Bonzini , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Peter Crosthwaite Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The sense of the test was inverted. Make it simple, if icount is enabled then we disabled MTTCG by default. If the user tries to force MTTCG upon us then we tell them "no". Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- cpus.c | 7 +++---- vl.c | 7 ++----- 2 files changed, 5 insertions(+), 9 deletions(-) -- 2.11.0 diff --git a/cpus.c b/cpus.c index c857ad2957..6a817fec13 100644 --- a/cpus.c +++ b/cpus.c @@ -181,10 +181,7 @@ static bool check_tcg_memory_orders_compatible(void) static bool default_mttcg_enabled(void) { - QemuOpts *icount_opts = qemu_find_opts_singleton("icount"); - const char *rr = qemu_opt_get(icount_opts, "rr"); - - if (rr || TCG_OVERSIZED_GUEST) { + if (use_icount || TCG_OVERSIZED_GUEST) { return false; } else { #ifdef TARGET_SUPPORTS_MTTCG @@ -202,6 +199,8 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp) if (strcmp(t, "multi") == 0) { if (TCG_OVERSIZED_GUEST) { error_setg(errp, "No MTTCG when guest word size > hosts"); + } else if (use_icount) { + error_setg(errp, "No MTTCG when icount is enabled"); } else { if (!check_tcg_memory_orders_compatible()) { error_report("Guest expects a stronger memory ordering " diff --git a/vl.c b/vl.c index 7f1644a2be..1a95500ac7 100644 --- a/vl.c +++ b/vl.c @@ -4055,8 +4055,6 @@ int main(int argc, char **argv, char **envp) replay_configure(icount_opts); - qemu_tcg_configure(accel_opts, &error_fatal); - machine_class = select_machine(); set_memory_options(&ram_slots, &maxram_size, machine_class); @@ -4423,14 +4421,13 @@ int main(int argc, char **argv, char **envp) if (!tcg_enabled()) { error_report("-icount is not allowed with hardware virtualization"); exit(1); - } else if (qemu_tcg_mttcg_enabled()) { - error_report("-icount does not currently work with MTTCG"); - exit(1); } configure_icount(icount_opts, &error_abort); qemu_opts_del(icount_opts); } + qemu_tcg_configure(accel_opts, &error_fatal); + if (default_net) { QemuOptsList *net = qemu_find_opts("net"); qemu_opts_set(net, NULL, "type", "nic", &error_abort);