From nobody Sat May 4 07:43:05 2024 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 1498040941067743.1361775527716; Wed, 21 Jun 2017 03:29:01 -0700 (PDT) Received: from localhost ([::1]:52916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcsd-0001cH-JJ for importer@patchew.org; Wed, 21 Jun 2017 06:28:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckJ-0002PB-P2 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckG-0004yt-OA for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:52640) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNckG-0004yR-Gw for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:20 -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:19 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983450982" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:47 +0800 Message-Id: <1498040401-16361-2-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 01/15] configure: add the disable-tcg option 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" Add the disable-tcg option into configure and echo CONFIG_TCG=3Dy into $config_target_mak. The default tcg is enabled for all build. If tcg is disabled in the build, only i386|x86_64 softmmu option can be disabled, other softmmu of tagets and users build defaultly enabled the tcg. This operation do not make big change with the older build command. The new configure build command like below (1)./configure tcg is defaultly enabled (2)./configure --disable-tcg tcg is disabled in i386 and x86_64 softmmu build tcg is enabled in others softmmu and all users build (3)./configure --disable-tcg --target-list=3Dx86_64-softmmu, x86_64-linux-u= ser tcg is disabled in x86_64 softmmu build tcg is enabled in x86_64 linux user build Signed-off-by: Yang Zhong --- configure | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/configure b/configure index ff0f8b9..b4d80e5 100755 --- a/configure +++ b/configure @@ -224,6 +224,7 @@ cap_ng=3D"" attr=3D"" libattr=3D"" xfs=3D"" +tcg=3D"yes" =20 vhost_net=3D"no" vhost_scsi=3D"no" @@ -953,6 +954,10 @@ for opt do ;; --enable-hax) hax=3D"yes" ;; + --disable-tcg) tcg=3D"no" + ;; + --enable-tcg) tcg=3D"yes" + ;; --disable-tcg-interpreter) tcg_interpreter=3D"no" ;; --enable-tcg-interpreter) tcg_interpreter=3D"yes" @@ -5117,7 +5122,6 @@ echo "module support $modules" echo "host CPU $cpu" echo "host big endian $bigendian" echo "target list $target_list" -echo "tcg debug enabled $debug_tcg" echo "gprof enabled $gprof" echo "sparse enabled $sparse" echo "strip binaries $strip_opt" @@ -5171,6 +5175,11 @@ echo "Linux AIO support $linux_aio" echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" +echo "TCG support $tcg" +if test "$tcg" =3D "yes" ; then + echo "TCG debug enabled $debug_tcg" + echo "TCG interpreter $tcg_interpreter" +fi echo "HAX support $hax" echo "RDMA support $rdma" echo "TCG interpreter $tcg_interpreter" @@ -6229,6 +6238,7 @@ fi if test "$target_user_only" =3D "yes" ; then echo "CONFIG_USER_ONLY=3Dy" >> $config_target_mak echo "CONFIG_QEMU_INTERP_PREFIX=3D\"$interp_prefix1\"" >> $config_target= _mak + echo "CONFIG_TCG=3Dy" >> $config_target_mak fi if test "$target_linux_user" =3D "yes" ; then echo "CONFIG_LINUX_USER=3Dy" >> $config_target_mak @@ -6248,6 +6258,22 @@ if test "$target_bsd_user" =3D "yes" ; then echo "CONFIG_BSD_USER=3Dy" >> $config_target_mak fi =20 +case "$target_name" in + alpha|arm|armeb|aarch64|cris|hppa|lm32|m68k|microblaze|microblazeel|mips= |mipsel| \ + mipsn32|mipsn32el|mips64|mips64el|moxie|nios2|or1k|ppc|ppcemb|ppc64|ppc6= 4le|ppc64abi32| \ + sh4|sh4eb|sparc|sparc64|sparc32plus|s390x|tilegx|tricore|unicore32|xtens= a|xtensaeb) + if test "$target_softmmu" =3D "yes" ; then + echo "CONFIG_TCG=3Dy" >> $config_target_mak + fi + ;; +esac +case "$target_name" in + i386|x86_64) + if test "$tcg" =3D "yes" -a "$target_softmmu" =3D "yes" ; then + echo "CONFIG_TCG=3Dy" >> $config_target_mak + fi + ;; +esac # generate QEMU_CFLAGS/LDFLAGS for targets =20 cflags=3D"" --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 From nobody Sat May 4 07:43:05 2024 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 1498040889201804.5786158285995; Wed, 21 Jun 2017 03:28:09 -0700 (PDT) Received: from localhost ([::1]:52912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcrn-0000pY-Uz for importer@patchew.org; Wed, 21 Jun 2017 06:28:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckK-0002Q9-LP for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckJ-00052W-Ag for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:24 -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-UY for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:23 -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:22 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451006" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:49 +0800 Message-Id: <1498040401-16361-4-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 03/15] tcg: tcg_handle_interrupt() function 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" Move tcg_handle_interrupt() from translate-common.c to translate-all.c. Signed-off-by: Yang Zhong --- accel/tcg/Makefile.objs | 2 +- accel/tcg/translate-all.c | 30 ++++++++++++++++++++++++ accel/tcg/translate-common.c | 56 ----------------------------------------= ---- cpus.c | 1 + 4 files changed, 32 insertions(+), 57 deletions(-) delete mode 100644 accel/tcg/translate-common.c diff --git a/accel/tcg/Makefile.objs b/accel/tcg/Makefile.objs index f173cd5..70cd474 100644 --- a/accel/tcg/Makefile.objs +++ b/accel/tcg/Makefile.objs @@ -1,3 +1,3 @@ obj-$(CONFIG_SOFTMMU) +=3D tcg-all.o obj-$(CONFIG_SOFTMMU) +=3D cputlb.o -obj-y +=3D cpu-exec.o cpu-exec-common.o translate-all.o translate-common.o +obj-y +=3D cpu-exec.o cpu-exec-common.o translate-all.o diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 7b25a16..bb303e0 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -798,6 +798,33 @@ static void tb_htable_init(void) qht_init(&tcg_ctx.tb_ctx.htable, CODE_GEN_HTABLE_SIZE, mode); } =20 +#ifndef CONFIG_USER_ONLY +/* mask must never be zero, except for A20 change call */ +static void tcg_handle_interrupt(CPUState *cpu, int mask) +{ + int old_mask; + g_assert(qemu_mutex_iothread_locked()); + + old_mask =3D cpu->interrupt_request; + cpu->interrupt_request |=3D mask; + + /* + * If called from iothread context, wake the target cpu in + * case its halted. + */ + if (!qemu_cpu_is_self(cpu)) { + qemu_cpu_kick(cpu); + } else { + cpu->icount_decr.u16.high =3D -1; + if (use_icount && + !cpu->can_do_io + && (mask & ~old_mask) !=3D 0) { + cpu_abort(cpu, "Raised interrupt while not in I/O function"); + } + } +} +#endif + /* Must be called before using the QEMU cpus. 'tb_size' is the size (in bytes) allocated to the translation buffer. Zero means default size. */ @@ -807,6 +834,9 @@ void tcg_exec_init(unsigned long tb_size) page_init(); tb_htable_init(); code_gen_alloc(tb_size); +#ifndef CONFIG_USER_ONLY + cpu_interrupt_handler =3D tcg_handle_interrupt; +#endif #if defined(CONFIG_SOFTMMU) /* There's no guest base to take into account, so go ahead and initialize the prologue now. */ diff --git a/accel/tcg/translate-common.c b/accel/tcg/translate-common.c deleted file mode 100644 index 40fe5a1..0000000 --- a/accel/tcg/translate-common.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Host code generation common components - * - * Copyright (c) 2015 Peter Crosthwaite - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ - -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "qom/cpu.h" -#include "sysemu/cpus.h" -#include "qemu/main-loop.h" - -uintptr_t qemu_real_host_page_size; -intptr_t qemu_real_host_page_mask; - -#ifndef CONFIG_USER_ONLY -/* mask must never be zero, except for A20 change call */ -static void tcg_handle_interrupt(CPUState *cpu, int mask) -{ - int old_mask; - g_assert(qemu_mutex_iothread_locked()); - - old_mask =3D cpu->interrupt_request; - cpu->interrupt_request |=3D mask; - - /* - * If called from iothread context, wake the target cpu in - * case its halted. - */ - if (!qemu_cpu_is_self(cpu)) { - qemu_cpu_kick(cpu); - } else { - cpu->icount_decr.u16.high =3D -1; - if (use_icount && - !cpu->can_do_io - && (mask & ~old_mask) !=3D 0) { - cpu_abort(cpu, "Raised interrupt while not in I/O function"); - } - } -} - -CPUInterruptHandler cpu_interrupt_handler =3D tcg_handle_interrupt; -#endif diff --git a/cpus.c b/cpus.c index a86ea10..6ff3e37 100644 --- a/cpus.c +++ b/cpus.c @@ -76,6 +76,7 @@ int64_t max_advance; /* vcpu throttling controls */ static QEMUTimer *throttle_timer; static unsigned int throttle_percentage; +CPUInterruptHandler cpu_interrupt_handler; =20 #define CPU_THROTTLE_PCT_MIN 1 #define CPU_THROTTLE_PCT_MAX 99 --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498041223663486.34521667019226; Wed, 21 Jun 2017 03:33:43 -0700 (PDT) Received: from localhost ([::1]:52946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcxB-0005j1-FB for importer@patchew.org; Wed, 21 Jun 2017 06:33:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckL-0002RK-NY for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckK-00053w-QP for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:25 -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 1dNckK-0004zB-Hb for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:24 -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:24 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451083" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:50 +0800 Message-Id: <1498040401-16361-5-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 04/15] tcg: change tcg_enabled() 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" Change the tcg_enabled() and make sure user build still enable tcg even x86 softmmu disable tcg. Signed-off-by: Yang Zhong --- accel/tcg/tcg-all.c | 2 +- accel/tcg/translate-all.c | 6 +----- bsd-user/main.c | 1 + include/qemu-common.h | 7 ++++++- linux-user/main.c | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index dba9931..a313d14 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -29,7 +29,7 @@ #include "qom/object.h" =20 int tcg_tb_size; -static bool tcg_allowed =3D true; +bool tcg_allowed; =20 static int tcg_init(MachineState *ms) { diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index bb303e0..4ebf7b0 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -830,6 +830,7 @@ static void tcg_handle_interrupt(CPUState *cpu, int mas= k) size. */ void tcg_exec_init(unsigned long tb_size) { + tcg_allowed =3D true; cpu_gen_init(); page_init(); tb_htable_init(); @@ -844,11 +845,6 @@ void tcg_exec_init(unsigned long tb_size) #endif } =20 -bool tcg_enabled(void) -{ - return tcg_ctx.code_gen_buffer !=3D NULL; -} - /* * Allocate a new translation block. Flush the translation buffer if * too many translation blocks or too much generated code. diff --git a/bsd-user/main.c b/bsd-user/main.c index 04f95dd..276aea7 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -35,6 +35,7 @@ #include "trace/control.h" #include "glib-compat.h" =20 +bool tcg_allowed =3D true; int singlestep; unsigned long mmap_min_addr; unsigned long guest_base; diff --git a/include/qemu-common.h b/include/qemu-common.h index 387ef52..b5adbfa 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -76,8 +76,13 @@ int qemu_openpty_raw(int *aslave, char *pty_name); sendto(sockfd, buf, len, flags, destaddr, addrlen) #endif =20 +extern bool tcg_allowed; void tcg_exec_init(unsigned long tb_size); -bool tcg_enabled(void); +#ifdef CONFIG_TCG +#define tcg_enabled() (tcg_allowed) +#else +#define tcg_enabled() 0 +#endif =20 void cpu_exec_init_all(void); void cpu_exec_step_atomic(CPUState *cpu); diff --git a/linux-user/main.c b/linux-user/main.c index ad03c9e..a11508a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -38,7 +38,7 @@ #include "glib-compat.h" =20 char *exec_path; - +bool tcg_allowed =3D true; int singlestep; static const char *filename; static const char *argv0; --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498041035737636.7124984344416; Wed, 21 Jun 2017 03:30:35 -0700 (PDT) Received: from localhost ([::1]:52927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcuA-00030L-BC for importer@patchew.org; Wed, 21 Jun 2017 06:30:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckN-0002TE-Cu for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckM-00057K-C1 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:27 -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 1dNckM-0004zB-2j for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:26 -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:25 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451092" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:51 +0800 Message-Id: <1498040401-16361-6-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 05/15] tcg: move page_size_init() function 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" translate-all.c will be disabled if tcg is disabled in the build, so page_size_init() function and related variables will be moved to exec.c file. Signed-off-by: Yang Zhong --- accel/tcg/translate-all.c | 18 ------------------ exec.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 4ebf7b0..e4cfdd1 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -112,9 +112,6 @@ typedef struct PageDesc { #define V_L2_BITS 10 #define V_L2_SIZE (1 << V_L2_BITS) =20 -uintptr_t qemu_host_page_size; -intptr_t qemu_host_page_mask; - /* * L1 Mapping properties */ @@ -363,21 +360,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retadd= r) return r; } =20 -void page_size_init(void) -{ - /* NOTE: we can always suppose that qemu_host_page_size >=3D - TARGET_PAGE_SIZE */ - qemu_real_host_page_size =3D getpagesize(); - qemu_real_host_page_mask =3D -(intptr_t)qemu_real_host_page_size; - if (qemu_host_page_size =3D=3D 0) { - qemu_host_page_size =3D qemu_real_host_page_size; - } - if (qemu_host_page_size < TARGET_PAGE_SIZE) { - qemu_host_page_size =3D TARGET_PAGE_SIZE; - } - qemu_host_page_mask =3D -(intptr_t)qemu_host_page_size; -} - static void page_init(void) { page_size_init(); diff --git a/exec.c b/exec.c index 42ad1ea..ee61915 100644 --- a/exec.c +++ b/exec.c @@ -118,6 +118,11 @@ __thread CPUState *current_cpu; 2 =3D Adaptive rate instruction counting. */ int use_icount; =20 +uintptr_t qemu_host_page_size; +intptr_t qemu_host_page_mask; +uintptr_t qemu_real_host_page_size; +intptr_t qemu_real_host_page_mask; + bool set_preferred_target_page_bits(int bits) { /* The target page size is the lowest common denominator for all @@ -3590,3 +3595,18 @@ err: } =20 #endif + +void page_size_init(void) +{ + /* NOTE: we can always suppose that qemu_host_page_size >=3D + TARGET_PAGE_SIZE */ + qemu_real_host_page_size =3D getpagesize(); + qemu_real_host_page_mask =3D -(intptr_t)qemu_real_host_page_size; + if (qemu_host_page_size =3D=3D 0) { + qemu_host_page_size =3D qemu_real_host_page_size; + } + if (qemu_host_page_size < TARGET_PAGE_SIZE) { + qemu_host_page_size =3D TARGET_PAGE_SIZE; + } + qemu_host_page_mask =3D -(intptr_t)qemu_host_page_size; +} --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498040846123555.2552407841126; Wed, 21 Jun 2017 03:27:26 -0700 (PDT) Received: from localhost ([::1]:52910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcr6-0000AO-MH for importer@patchew.org; Wed, 21 Jun 2017 06:27:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckO-0002Ux-SU for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckN-00057p-UP for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:28 -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 1dNckN-0004zB-KJ for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:27 -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:27 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451103" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:52 +0800 Message-Id: <1498040401-16361-7-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 06/15] kvmvapic: remove 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" Since Paolo's below patch has fixed A20 issue commit bbfa326fc8028e275eddf8c9965c2a1b59405b2e target/i386: enable A20 automatically in system management mod The tcg code in kvmvapic.c is NOT useful, those code need remove. Signed-off-by: Yang Zhong --- hw/i386/kvmvapic.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 82a4955..5b7be5a 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -18,7 +18,6 @@ #include "sysemu/kvm.h" #include "hw/i386/apic_internal.h" #include "hw/sysbus.h" -#include "tcg/tcg.h" =20 #define VAPIC_IO_PORT 0x7e =20 @@ -396,13 +395,9 @@ static void patch_call(VAPICROMState *s, X86CPU *cpu, = target_ulong ip, static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong = ip) { CPUState *cs =3D CPU(cpu); - CPUX86State *env =3D &cpu->env; VAPICHandlers *handlers; uint8_t opcode[2]; uint32_t imm32 =3D 0; - target_ulong current_pc =3D 0; - target_ulong current_cs_base =3D 0; - uint32_t current_flags =3D 0; =20 if (smp_cpus =3D=3D 1) { handlers =3D &s->rom_state.up; @@ -410,17 +405,6 @@ static void patch_instruction(VAPICROMState *s, X86CPU= *cpu, target_ulong ip) handlers =3D &s->rom_state.mp; } =20 - if (!kvm_enabled()) { - cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base, - ¤t_flags); - /* Account this instruction, because we will exit the tb. - This is the first instruction in the block. Therefore - there is no need in restoring CPU state. */ - if (use_icount) { - --cs->icount_decr.u16.low; - } - } - pause_all_vcpus(); =20 cpu_memory_rw_debug(cs, ip, opcode, sizeof(opcode), 0); @@ -455,14 +439,6 @@ static void patch_instruction(VAPICROMState *s, X86CPU= *cpu, target_ulong ip) } =20 resume_all_vcpus(); - - if (!kvm_enabled()) { - /* Both tb_lock and iothread_mutex will be reset when - * longjmps back into the cpu_exec loop. */ - tb_lock(); - tb_gen_code(cs, current_pc, current_cs_base, current_flags, 1); - cpu_loop_exit_noexc(cs); - } } =20 void vapic_report_tpr_access(DeviceState *dev, CPUState *cs, target_ulong = ip, --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 149804118472687.21477629468507; Wed, 21 Jun 2017 03:33:04 -0700 (PDT) Received: from localhost ([::1]:52938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcwZ-00056k-EJ for importer@patchew.org; Wed, 21 Jun 2017 06:33:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckS-0002Xl-2o for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckP-00058l-ET for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:32 -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 1dNckP-0004zB-6L for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:29 -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:28 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451109" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:53 +0800 Message-Id: <1498040401-16361-8-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 07/15] tcg: move cpu_sync_bndcs_hflags() function 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" Move cpu_sync_bndcs_hflags() function from mpx_helper.c to helper.c because mpx_helper.c need be disabled when tcg is disabled. Signed-off-by: Yang Zhong --- target/i386/helper.c | 34 +++++++++++++++++++++++++++++++++- target/i386/mpx_helper.c | 30 ------------------------------ 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index ef05059..87fd705 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -29,6 +29,36 @@ #include "hw/i386/apic_internal.h" #endif =20 +void cpu_sync_bndcs_hflags(CPUX86State *env) +{ + uint32_t hflags =3D env->hflags; + uint32_t hflags2 =3D env->hflags2; + uint32_t bndcsr; + + if ((hflags & HF_CPL_MASK) =3D=3D 3) { + bndcsr =3D env->bndcs_regs.cfgu; + } else { + bndcsr =3D env->msr_bndcfgs; + } + + if ((env->cr[4] & CR4_OSXSAVE_MASK) + && (env->xcr0 & XSTATE_BNDCSR_MASK) + && (bndcsr & BNDCFG_ENABLE)) { + hflags |=3D HF_MPX_EN_MASK; + } else { + hflags &=3D ~HF_MPX_EN_MASK; + } + + if (bndcsr & BNDCFG_BNDPRESERVE) { + hflags2 |=3D HF2_MPX_PR_MASK; + } else { + hflags2 &=3D ~HF2_MPX_PR_MASK; + } + + env->hflags =3D hflags; + env->hflags2 =3D hflags2; +} + static void cpu_x86_version(CPUX86State *env, int *family, int *model) { int cpuver =3D env->cpuid_version; @@ -1302,10 +1332,12 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAcc= ess access) env->tpr_access_type =3D access; =20 cpu_interrupt(cs, CPU_INTERRUPT_TPR); - } else { + } else if (tcg_enabled()) { cpu_restore_state(cs, cs->mem_io_pc); =20 apic_handle_tpr_access_report(cpu->apic_state, env->eip, access); + } else { + abort(); } } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/i386/mpx_helper.c b/target/i386/mpx_helper.c index 7e44820..ade5d24 100644 --- a/target/i386/mpx_helper.c +++ b/target/i386/mpx_helper.c @@ -24,36 +24,6 @@ #include "exec/exec-all.h" =20 =20 -void cpu_sync_bndcs_hflags(CPUX86State *env) -{ - uint32_t hflags =3D env->hflags; - uint32_t hflags2 =3D env->hflags2; - uint32_t bndcsr; - - if ((hflags & HF_CPL_MASK) =3D=3D 3) { - bndcsr =3D env->bndcs_regs.cfgu; - } else { - bndcsr =3D env->msr_bndcfgs; - } - - if ((env->cr[4] & CR4_OSXSAVE_MASK) - && (env->xcr0 & XSTATE_BNDCSR_MASK) - && (bndcsr & BNDCFG_ENABLE)) { - hflags |=3D HF_MPX_EN_MASK; - } else { - hflags &=3D ~HF_MPX_EN_MASK; - } - - if (bndcsr & BNDCFG_BNDPRESERVE) { - hflags2 |=3D HF2_MPX_PR_MASK; - } else { - hflags2 &=3D ~HF2_MPX_PR_MASK; - } - - env->hflags =3D hflags; - env->hflags2 =3D hflags2; -} - void helper_bndck(CPUX86State *env, uint32_t fail) { if (unlikely(fail)) { --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498040686442672.8041865502717; Wed, 21 Jun 2017 03:24:46 -0700 (PDT) Received: from localhost ([::1]:52896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcoV-0006DV-5U for importer@patchew.org; Wed, 21 Jun 2017 06:24:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckS-0002Xm-2x for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckR-000596-3I for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:32 -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 1dNckQ-0004zB-Q2 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:31 -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:30 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451118" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:54 +0800 Message-Id: <1498040401-16361-9-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 08/15] tcg: make cpu_get_fp80()/cpu_set_fp80() static 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" Move cpu_get_fp80()/cpu_set_fp80() from fpu_helper.c to machine.c because fpu_helper.c will be disabled if tcg is disabled in the build. Signed-off-by: Yang Zhong --- target/i386/cpu.h | 2 -- target/i386/fpu_helper.c | 18 ------------------ target/i386/machine.c | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index de0551f..8b3b535 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1418,8 +1418,6 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigne= d int selector, =20 /* op_helper.c */ /* used for debug or cpu save/restore */ -void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f); -floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper); =20 /* cpu-exec.c */ /* the following helpers are only usable in user mode simulation as diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c index 69ea33a..34fb5fc 100644 --- a/target/i386/fpu_helper.c +++ b/target/i386/fpu_helper.c @@ -1539,24 +1539,6 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, u= int64_t mask) raise_exception_ra(env, EXCP0D_GPF, GETPC()); } =20 -void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f) -{ - CPU_LDoubleU temp; - - temp.d =3D f; - *pmant =3D temp.l.lower; - *pexp =3D temp.l.upper; -} - -floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper) -{ - CPU_LDoubleU temp; - - temp.l.upper =3D upper; - temp.l.lower =3D mant; - return temp.d; -} - /* MMX/SSE */ /* XXX: optimize by storing fptt and fptags in the static cpu state */ =20 diff --git a/target/i386/machine.c b/target/i386/machine.c index 8c7a822..53587ae 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -142,6 +142,24 @@ typedef struct x86_FPReg_tmp { uint16_t tmp_exp; } x86_FPReg_tmp; =20 +static void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f) +{ + CPU_LDoubleU temp; + + temp.d =3D f; + *pmant =3D temp.l.lower; + *pexp =3D temp.l.upper; +} + +static floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper) +{ + CPU_LDoubleU temp; + + temp.l.upper =3D upper; + temp.l.lower =3D mant; + return temp.d; +} + static void fpreg_pre_save(void *opaque) { x86_FPReg_tmp *tmp =3D opaque; --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498041290446232.11390676788017; Wed, 21 Jun 2017 03:34:50 -0700 (PDT) Received: from localhost ([::1]:52949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcyF-0007JJ-8k for importer@patchew.org; Wed, 21 Jun 2017 06:34:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckW-0002bH-JH for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckS-0005AH-L9 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:36 -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 1dNckS-0004zB-DV for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:32 -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:31 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451156" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:55 +0800 Message-Id: <1498040401-16361-10-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 09/15] tcg: add the tcg-stub.c file into accel/stubs/ 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" If tcg is disabled, the functions in tcg-stub.c file will be called. Signed-off-by: Yang Zhong --- accel/stubs/Makefile.objs | 1 + accel/stubs/tcg-stub.c | 103 ++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 104 insertions(+) create mode 100644 accel/stubs/tcg-stub.c diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs index bd5794f..fdfbf73 100644 --- a/accel/stubs/Makefile.objs +++ b/accel/stubs/Makefile.objs @@ -1 +1,2 @@ obj-$(call lnot,$(CONFIG_KVM)) +=3D kvm-stub.o +obj-$(call lnot,$(CONFIG_TCG)) +=3D tcg-stub.o diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c new file mode 100644 index 0000000..12c41dd --- /dev/null +++ b/accel/stubs/tcg-stub.c @@ -0,0 +1,103 @@ +/* + * QEMU TCG accelerator stub + * + * Copyright Red Hat, Inc. 2013 + * + * Author: Paolo Bonzini + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "tcg/tcg.h" +#include "exec/cpu-common.h" +#include "exec/exec-all.h" +#include "translate-all.h" +#include "exec/cpu-all.h" + +void tb_flush(CPUState *cpu) +{ +} + +void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len) +{ +} + +void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end) +{ +} + +void tb_check_watchpoint(CPUState *cpu) +{ +} + +TranslationBlock *tb_gen_code(CPUState *cpu, + target_ulong pc, target_ulong cs_base, + uint32_t flags, int cflags) +{ + return NULL; +} + +void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length) +{ +} + +void tlb_set_dirty(CPUState *cpu, target_ulong vaddr) +{ +} + +bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc) +{ + return false; +} + +void update_fp_status(CPUX86State *env) +{ +} + +void dump_exec_info(FILE *f, fprintf_function cpu_fprintf) +{ +} + +void dump_opcount_info(FILE *f, fprintf_function cpu_fprintf) +{ +} + +void cpu_loop_exit(CPUState *cpu) +{ + abort(); +} + +void cpu_loop_exit_noexc(CPUState *cpu) +{ + abort(); +} + +void raise_exception(CPUX86State *env, int exception_index) +{ + abort(); +} + +void raise_exception_err_ra(CPUX86State *env, int exception_index, + int error_code, uintptr_t retaddr) +{ + abort(); +} + +void x86_cpu_do_interrupt(CPUState *cs) +{ +} + +bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) +{ + return false; +} + +int cpu_exec(CPUState *cpu) +{ + abort(); +} --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498040831369263.09793118798746; Wed, 21 Jun 2017 03:27:11 -0700 (PDT) Received: from localhost ([::1]:52909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcqs-0008Ol-58 for importer@patchew.org; Wed, 21 Jun 2017 06:27:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckV-0002aU-QQ for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckU-0005Af-JH for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:35 -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 1dNckU-0004zB-70 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:34 -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:33 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451174" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:56 +0800 Message-Id: <1498040401-16361-11-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 10/15] tcg: move tb related lock functions 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" Move tb_lock()/tb_unlock()/tb_lock_reset() from tcg.h to translate-all.h. tb_lock()/tb_unlock() need be impelemnted in accel/stubs/tcg-stub.c. Signed-off-by: Yang Zhong --- accel/stubs/tcg-stub.c | 8 ++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/cputlb.c | 1 + accel/tcg/translate-all.h | 3 +++ tcg/tcg.h | 4 ---- trace/control-target.c | 1 - 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 12c41dd..dafb1d0 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -19,6 +19,14 @@ #include "translate-all.h" #include "exec/cpu-all.h" =20 +void tb_lock(void) +{ +} + +void tb_unlock(void) +{ +} + void tb_flush(CPUState *cpu) { } diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 3581618..03b4ea2 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -21,6 +21,7 @@ #include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" +#include "translate-all.h" #include "tcg.h" #include "qemu/atomic.h" #include "sysemu/qtest.h" diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 743776a..dcbea26 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -21,6 +21,7 @@ #include "qemu/main-loop.h" #include "cpu.h" #include "exec/exec-all.h" +#include "translate-all.h" #include "exec/memory.h" #include "exec/address-spaces.h" #include "exec/cpu_ldst.h" diff --git a/accel/tcg/translate-all.h b/accel/tcg/translate-all.h index ba8e4d6..4774f78 100644 --- a/accel/tcg/translate-all.h +++ b/accel/tcg/translate-all.h @@ -23,6 +23,9 @@ =20 =20 /* translate-all.c */ +void tb_lock(void); +void tb_unlock(void); +void tb_lock_reset(void); void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len); void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t en= d, int is_cpu_write_access); diff --git a/tcg/tcg.h b/tcg/tcg.h index 5ec48d1..a5ff00c 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -757,10 +757,6 @@ static inline bool tcg_op_buf_full(void) void *tcg_malloc_internal(TCGContext *s, int size); void tcg_pool_reset(TCGContext *s); =20 -void tb_lock(void); -void tb_unlock(void); -void tb_lock_reset(void); - /* Called with tb_lock held. */ static inline void *tcg_malloc(int size) { diff --git a/trace/control-target.c b/trace/control-target.c index 6266e63..2a5efc7 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -11,7 +11,6 @@ #include "cpu.h" #include "trace-root.h" #include "trace/control.h" -#include "translate-all.h" =20 =20 void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498040993973425.89734036539267; Wed, 21 Jun 2017 03:29:53 -0700 (PDT) Received: from localhost ([::1]:52920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNctU-0002MI-Lf for importer@patchew.org; Wed, 21 Jun 2017 06:29:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckX-0002cU-EF for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckW-0005Ba-F2 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:37 -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 1dNckV-0004zB-UD for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:36 -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:35 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451186" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:57 +0800 Message-Id: <1498040401-16361-12-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 11/15] tcg: split cpu_set_mxcsr()/cpu_set_fpuc() 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" Split the cpu_set_mxcsr()/cpu_set_fpuc() with specific tcg code. tcg_update_mxcsr()/tcg_set_fpuc() need be implemented in tcg-stub.c file if tcg is disabled. Signed-off-by: Yang Zhong --- accel/stubs/tcg-stub.c | 8 ++++++++ target/i386/cpu.h | 15 +++++++++++++-- target/i386/fpu_helper.c | 8 +++----- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index dafb1d0..91625a8 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -75,6 +75,14 @@ void dump_opcount_info(FILE *f, fprintf_function cpu_fpr= intf) { } =20 +void tcg_update_mxcsr(CPUX86State *env) +{ +} + +void tcg_set_fpuc(CPUX86State *env) +{ +} + void cpu_loop_exit(CPUState *cpu) { abort(); diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8b3b535..229b216 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1643,8 +1643,19 @@ static inline int32_t x86_get_a20_mask(CPUX86State *= env) } =20 /* fpu_helper.c */ -void cpu_set_mxcsr(CPUX86State *env, uint32_t val); -void cpu_set_fpuc(CPUX86State *env, uint16_t val); +void tcg_update_mxcsr(CPUX86State *env); +void tcg_set_fpuc(CPUX86State *env); +static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +{ + env->mxcsr =3D mxcsr; + tcg_update_mxcsr(env); +} + +static inline void cpu_set_fpuc(CPUX86State *env, uint16_t fpuc) +{ + env->fpuc =3D fpuc; + tcg_set_fpuc(env); +} =20 /* mem_helper.c */ void helper_lock_init(void); diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c index 34fb5fc..a7550c9 100644 --- a/target/i386/fpu_helper.c +++ b/target/i386/fpu_helper.c @@ -1550,12 +1550,11 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, = uint64_t mask) #define SSE_RC_CHOP 0x6000 #define SSE_FZ 0x8000 =20 -void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +void tcg_update_mxcsr(CPUX86State *env) { + uint32_t mxcsr =3D env->mxcsr; int rnd_type; =20 - env->mxcsr =3D mxcsr; - /* set rounding mode */ switch (mxcsr & SSE_RC_MASK) { default: @@ -1581,9 +1580,8 @@ void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) set_flush_to_zero((mxcsr & SSE_FZ) ? 1 : 0, &env->fp_status); } =20 -void cpu_set_fpuc(CPUX86State *env, uint16_t val) +void tcg_set_fpuc(CPUX86State *env) { - env->fpuc =3D val; update_fp_status(env); } =20 --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498041473090911.4383735081836; Wed, 21 Jun 2017 03:37:53 -0700 (PDT) Received: from localhost ([::1]:52967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNd1D-0001UK-QI for importer@patchew.org; Wed, 21 Jun 2017 06:37:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckb-0002ge-DN for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckX-0005CN-Vj for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:41 -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 1dNckX-0004zB-LN for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:37 -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:37 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451192" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:58 +0800 Message-Id: <1498040401-16361-13-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 12/15] tcg: remove inline definition of flush_icache_range() 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" Remove the inline defintion of flush_icache_range() in tcg/i386/tcg-target.= h. add the flush_icache_range() implementation in tcg-target.inc.c for kvm/tcg and flush_icache_range() implementation in tcg-stub.c for disable-tcg. Signed-off-by: Yang Zhong --- accel/stubs/tcg-stub.c | 4 ++++ tcg/i386/tcg-target.h | 5 ++--- tcg/i386/tcg-target.inc.c | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 91625a8..85b0239 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -83,6 +83,10 @@ void tcg_set_fpuc(CPUX86State *env) { } =20 +void flush_icache_range(uintptr_t start, uintptr_t stop) +{ +} + void cpu_loop_exit(CPUState *cpu) { abort(); diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 73a15f7..7559cb8 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -162,9 +162,8 @@ extern bool have_popcnt; # define TCG_AREG0 TCG_REG_EBP #endif =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ -} +void flush_icache_range(uintptr_t start, uintptr_t stop); + =20 /* This defines the natural memory order supported by this * architecture before guarantees made by various barrier diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 01e3b4e..6572efc 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -2751,3 +2751,7 @@ void tcg_register_jit(void *buf, size_t buf_size) tcg_register_jit_int(buf, buf_size, &debug_frame, sizeof(debug_frame)); } #endif + +void flush_icache_range(uintptr_t start, uintptr_t stop) +{ +} --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498041392282416.7592232412254; Wed, 21 Jun 2017 03:36:32 -0700 (PDT) Received: from localhost ([::1]:52960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNczv-0008Qv-0U for importer@patchew.org; Wed, 21 Jun 2017 06:36:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckb-0002gd-DF for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNcka-0005Dh-2I for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:41 -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 1dNckZ-0004zB-JS for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:39 -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:39 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451197" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:19:59 +0800 Message-Id: <1498040401-16361-14-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 13/15] tcg: disable tcg in CPUX86State struct 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" Add the CONFIG_TCG for CPU_COMMON_TLB in the CPUX86State struct. Signed-off-by: Yang Zhong --- include/exec/cpu-defs.h | 4 +++- target/i386/cpu.h | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 5f4e303..bc8e7f8 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -25,7 +25,9 @@ =20 #include "qemu/host-utils.h" #include "qemu/queue.h" +#ifdef CONFIG_TCG #include "tcg-target.h" +#endif #ifndef CONFIG_USER_ONLY #include "exec/hwaddr.h" #endif @@ -54,7 +56,7 @@ typedef uint64_t target_ulong; #error TARGET_LONG_SIZE undefined #endif =20 -#if !defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* use a fully associative victim tlb of 8 entries */ #define CPU_VTLB_SIZE 8 =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 229b216..d67b601 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -52,7 +52,9 @@ =20 #include "exec/cpu-defs.h" =20 +#ifdef CONFIG_TCG #include "fpu/softfloat.h" +#endif =20 #define R_EAX 0 #define R_ECX 1 @@ -1130,8 +1132,9 @@ typedef struct CPUX86State { =20 /* Fields up to this point are cleared by a CPU reset */ struct {} end_reset_fields; - +#ifdef CONFIG_TCG CPU_COMMON +#endif =20 /* Fields after CPU_COMMON are preserved across CPU reset. */ =20 --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498041132147756.9321271173806; Wed, 21 Jun 2017 03:32:12 -0700 (PDT) Received: from localhost ([::1]:52934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNcvi-0004HJ-Os for importer@patchew.org; Wed, 21 Jun 2017 06:32:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckg-0002j8-7Y for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNcke-0005Fl-TA for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:46 -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 1dNcke-0004zB-HB for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:44 -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:43 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451202" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:20:00 +0800 Message-Id: <1498040401-16361-15-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 14/15] tcg: add the CONFIG_TCG for header 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" Add the CONFIG_TCG for exec-all.h. Since function tlb_set_page_with_attrs() is defined in ./accel/tcg/cputlb.c, which will be disabled if tcg is disabl= ed. This function need be implemented in accel/stubs/tcg-stub.c for disable-tcg. Signed-off-by: Yang Zhong --- accel/stubs/tcg-stub.c | 6 +++++ include/exec/cputlb.h | 2 +- include/exec/exec-all.h | 53 ++++++++++++++++++++++++-----------------= ---- include/exec/helper-proto.h | 2 ++ 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 85b0239..a189493 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -63,6 +63,12 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t searched= _pc) return false; } =20 +void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr, + hwaddr paddr, MemTxAttrs attrs, + int prot, int mmu_idx, target_ulong size) +{ +} + void update_fp_status(CPUX86State *env) { } diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 3f94178..cf296d9 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -19,7 +19,7 @@ #ifndef CPUTLB_H #define CPUTLB_H =20 -#if !defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* cputlb.c */ void tlb_protect_code(ram_addr_t ram_addr); void tlb_unprotect_code(ram_addr_t ram_addr); diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 87ae10b..f5d01eb 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -82,6 +82,34 @@ void cpu_reloading_memory_map(void); * Note that with KVM only one address space is supported. */ void cpu_address_space_init(CPUState *cpu, AddressSpace *as, int asidx); +/** + * tlb_set_page_with_attrs: + * @cpu: CPU to add this TLB entry for + * @vaddr: virtual address of page to add entry for + * @paddr: physical address of the page + * @attrs: memory transaction attributes + * @prot: access permissions (PAGE_READ/PAGE_WRITE/PAGE_EXEC bits) + * @mmu_idx: MMU index to insert TLB entry for + * @size: size of the page in bytes + * + * Add an entry to this CPU's TLB (a mapping from virtual address + * @vaddr to physical address @paddr) with the specified memory + * transaction attributes. This is generally called by the target CPU + * specific code after it has been called through the tlb_fill() + * entry point and performed a successful page table walk to find + * the physical address and attributes for the virtual address + * which provoked the TLB miss. + * + * At most one entry for a given virtual address is permitted. Only a + * single TARGET_PAGE_SIZE region is mapped; the supplied @size is only + * used by tlb_flush_page. + */ +void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr, + hwaddr paddr, MemTxAttrs attrs, + int prot, int mmu_idx, target_ulong size); +#endif + +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* cputlb.c */ /** * tlb_flush_page: @@ -205,31 +233,6 @@ void tlb_flush_by_mmuidx_all_cpus(CPUState *cpu, uint1= 6_t idxmap); * depend on when the guests translation ends the TB. */ void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu, uint16_t idxmap); -/** - * tlb_set_page_with_attrs: - * @cpu: CPU to add this TLB entry for - * @vaddr: virtual address of page to add entry for - * @paddr: physical address of the page - * @attrs: memory transaction attributes - * @prot: access permissions (PAGE_READ/PAGE_WRITE/PAGE_EXEC bits) - * @mmu_idx: MMU index to insert TLB entry for - * @size: size of the page in bytes - * - * Add an entry to this CPU's TLB (a mapping from virtual address - * @vaddr to physical address @paddr) with the specified memory - * transaction attributes. This is generally called by the target CPU - * specific code after it has been called through the tlb_fill() - * entry point and performed a successful page table walk to find - * the physical address and attributes for the virtual address - * which provoked the TLB miss. - * - * At most one entry for a given virtual address is permitted. Only a - * single TARGET_PAGE_SIZE region is mapped; the supplied @size is only - * used by tlb_flush_page. - */ -void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr, - hwaddr paddr, MemTxAttrs attrs, - int prot, int mmu_idx, target_ulong size); /* tlb_set_page: * * This function is equivalent to calling tlb_set_page_with_attrs() diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h index 954bef8..417c7b0 100644 --- a/include/exec/helper-proto.h +++ b/include/exec/helper-proto.h @@ -28,7 +28,9 @@ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), d= h_ctype(t3), \ =20 #include "helper.h" #include "trace/generated-helpers.h" +#ifdef CONFIG_TCG #include "tcg-runtime.h" +#endif =20 #undef DEF_HELPER_FLAGS_0 #undef DEF_HELPER_FLAGS_1 --=20 1.9.1 From nobody Sat May 4 07:43:05 2024 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 1498040979574380.43134467866025; Wed, 21 Jun 2017 03:29:39 -0700 (PDT) Received: from localhost ([::1]:52918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNctG-00029e-5j for importer@patchew.org; Wed, 21 Jun 2017 06:29:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNckg-0002jM-Ez for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNckf-0005G1-KA for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:46 -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 1dNckf-0004zB-5y for qemu-devel@nongnu.org; Wed, 21 Jun 2017 06:20:45 -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:44 -0700 Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52]) by orsmga003.jf.intel.com with ESMTP; 21 Jun 2017 03:20:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,368,1493708400"; d="scan'208";a="983451213" From: Yang Zhong To: pbonzini@redhat.com Date: Wed, 21 Jun 2017 18:20:01 +0800 Message-Id: <1498040401-16361-16-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 15/15] tcg: add the CONFIG_TCG into Makefiles 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" Add the CONFIG_TCG for frontend and backend's files in the related Makefiles. Signed-off-by: Yang Zhong --- Makefile.target | 4 ++-- accel/Makefile.objs | 2 +- target/i386/Makefile.objs | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile.target b/Makefile.target index 0066579..8e185d4 100644 --- a/Makefile.target +++ b/Makefile.target @@ -90,8 +90,8 @@ all: $(PROGS) stap # cpu emulator library obj-y +=3D exec.o obj-y +=3D accel/ -obj-y +=3D tcg/tcg.o tcg/tcg-op.o tcg/optimize.o -obj-y +=3D tcg/tcg-common.o tcg/tcg-runtime.o +obj-$(CONFIG_TCG) +=3D tcg/tcg.o tcg/tcg-op.o tcg/optimize.o +obj-$(CONFIG_TCG) +=3D tcg/tcg-common.o tcg/tcg-runtime.o obj-$(CONFIG_TCG_INTERPRETER) +=3D tcg/tci.o obj-$(CONFIG_TCG_INTERPRETER) +=3D disas/tci.o obj-y +=3D fpu/softfloat.o diff --git a/accel/Makefile.objs b/accel/Makefile.objs index cd5702f..10666ed 100644 --- a/accel/Makefile.objs +++ b/accel/Makefile.objs @@ -1,4 +1,4 @@ obj-$(CONFIG_SOFTMMU) +=3D accel.o obj-y +=3D kvm/ -obj-y +=3D tcg/ +obj-$(CONFIG_TCG) +=3D tcg/ obj-y +=3D stubs/ diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 4fcb7f3..fee6c7e 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -1,6 +1,7 @@ -obj-y +=3D translate.o helper.o cpu.o bpt_helper.o -obj-y +=3D excp_helper.o fpu_helper.o cc_helper.o int_helper.o svm_helper.o -obj-y +=3D smm_helper.o misc_helper.o mem_helper.o seg_helper.o mpx_helper= .o +obj-y +=3D helper.o cpu.o cc_helper.o bpt_helper.o +obj-$(CONFIG_TCG) +=3D translate.o +obj-$(CONFIG_TCG) +=3D excp_helper.o fpu_helper.o int_helper.o svm_helper.o +obj-$(CONFIG_TCG) +=3D smm_helper.o misc_helper.o mem_helper.o seg_helper.= o mpx_helper.o obj-y +=3D gdbstub.o obj-$(CONFIG_SOFTMMU) +=3D machine.o arch_memory_mapping.o arch_dump.o mon= itor.o obj-$(CONFIG_KVM) +=3D kvm.o hyperv.o --=20 1.9.1