From patchwork Thu Mar 2 19:53:27 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: 94807 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp323680qgd; Thu, 2 Mar 2017 11:57:07 -0800 (PST) X-Received: by 10.237.59.213 with SMTP id s21mr18831056qte.146.1488484627822; Thu, 02 Mar 2017 11:57:07 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y30si7722381qtb.55.2017.03.02.11.57.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 02 Mar 2017 11:57:07 -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]:54277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWqX-0001fL-GU for patch@linaro.org; Thu, 02 Mar 2017 14:57:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWnG-0007xC-Nt for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjWnE-0002Sv-T2 for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:42 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:34717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjWnE-0002Rr-Mc for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:40 -0500 Received: by mail-wm0-x233.google.com with SMTP id 196so4752098wmm.1 for ; Thu, 02 Mar 2017 11:53:38 -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=UhmLm1oe/5yjFnYNjzVo/Ap2UjT2ZyYmvQDSrziyhVc=; b=Hdj/xZXZODGUIKQLZbuZ0dRNIfkVlwmyr6MIpjHhOYgZx7FNTYv0XXLyDlGyx4PyXo UBhqYgFbEg4gVZrhrBu8d1465Qbo0s6WQJAXnx9f643caBRFG7yukjJSFIv9+qzb36uE TT/bMRvJy4c9VM525ZcGINitDCPcNEjePfYCM= 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=UhmLm1oe/5yjFnYNjzVo/Ap2UjT2ZyYmvQDSrziyhVc=; b=EIDW+TX1ZWQBun0j/z93x9w9DYyXPXHG7WGDFkgMzNOT71O0HV9aEqv2amjajrZbuK mV0bcr2jKI3wx7IIvTWKueLn5V/XB7yEay705icI7nAhlkw4AIBUsMzeUf+QdHsQbVVm 3YTS69jKm3rnlY6ZmUAu6CCiFpeXHr3O5QBZGGTxUu7TodkD/VGcOq57wjNnl18noQLQ eYx+sY5BP/RuJrcUrIu2ulx+ij+Tc6B6QD03e9p9qV2GZdS7djh4012WxJVXaD03yoqn bIAB/hZfHb/aRwhHE5uXsBcvfgYMyEmE4UG1My6+Ddj5HeWntLOZx9mnF7ZA1C63dmLt Cyzg== X-Gm-Message-State: AMke39madWBszc3tNU7lCAxO4MsmyRkjmzEFQG+PLBIZAcvza4Obe0Yc2FCzLhWABrTDW1sB X-Received: by 10.28.152.212 with SMTP id a203mr4907wme.7.1488484417940; Thu, 02 Mar 2017 11:53:37 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d6sm28357217wmd.6.2017.03.02.11.53.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 11:53:34 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 295283E02AD; 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:27 +0000 Message-Id: <20170302195337.31558-2-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: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::233 Subject: [Qemu-devel] [PATCH v2 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: 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" 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 8200ac6b75..e9aab9f70f 100644 --- a/cpus.c +++ b/cpus.c @@ -185,10 +185,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 @@ -206,6 +203,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 e10a27bdd6..bbbf1baadf 100644 --- a/vl.c +++ b/vl.c @@ -4025,8 +4025,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); @@ -4393,14 +4391,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);