From nobody Tue Feb 10 10:54:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498040742304809.910427060832; Wed, 21 Jun 2017 03:25:42 -0700 (PDT) Received: from localhost ([::1]:52904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcpQ-000768-Lf for importer@patchew.org; Wed, 21 Jun 2017 06:25:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckJ-0002P5-Nn for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckI-00051R-BG for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:6553) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNckI-0004zB-1d for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:22 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2017 03:20:21 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983450997" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:48 +0800 Message-Id: <1498040401-16361-3-git-send-email-yang.zhong@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498040401-16361-1-git-send-email-yang.zhong@intel.com> References: <1498040401-16361-1-git-send-email-yang.zhong@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 Subject: [Qemu-devel] [PATCH 02/15] vl: add CONFIG_TCG for tcg related code 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: Yang Zhong , anthony.xu@intel.com, qemu-devel@nongnu.org, a.rigo@virtualopensystems.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Need to disable the tcg related code in the vl.c if the disable-tcg option is added into ./configure command. Signed-off-by: Yang Zhong --- cpus.c | 3 ++- vl.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index 14bb8d5..a86ea10 100644 --- a/cpus.c +++ b/cpus.c @@ -170,7 +170,7 @@ bool mttcg_enabled; * implicit memory order requirements which would likely slow things * down a lot. */ - +#ifdef CONFIG_TCG static bool check_tcg_memory_orders_compatible(void) { #if defined(TCG_GUEST_DEFAULT_MO) && defined(TCG_TARGET_DEFAULT_MO) @@ -223,6 +223,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp) mttcg_enabled =3D default_mttcg_enabled(); } } +#endif =20 /* The current number of executed instructions is based on what we * originally budgeted minus the current state of the decrementing diff --git a/vl.c b/vl.c index 59fea15..a01faf9 100644 --- a/vl.c +++ b/vl.c @@ -3738,8 +3738,13 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_no_kvm: +#ifdef CONFIG_TCG olist =3D qemu_find_opts("machine"); qemu_opts_parse_noisily(olist, "accel=3Dtcg", false); +#else + error_report("TCG is disabled"); + exit(1); +#endif break; case QEMU_OPTION_no_kvm_pit: { error_report("warning: ignoring deprecated option"); @@ -3915,10 +3920,15 @@ int main(int argc, char **argv, char **envp) configure_rtc(opts); break; case QEMU_OPTION_tb_size: +#ifdef CONFIG_TCG tcg_tb_size =3D strtol(optarg, NULL, 0); if (tcg_tb_size < 0) { tcg_tb_size =3D 0; } +#else + error_report("TCG is disabled"); + exit(1); +#endif break; case QEMU_OPTION_icount: icount_opts =3D qemu_opts_parse_noisily(qemu_find_opts("ic= ount"), @@ -4457,7 +4467,9 @@ int main(int argc, char **argv, char **envp) qemu_opts_del(icount_opts); } =20 +#ifdef CONFIG_TCG qemu_tcg_configure(accel_opts, &error_fatal); +#endif =20 if (default_net) { QemuOptsList *net =3D qemu_find_opts("net"); --=20 1.9.1