From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167167566346.08586154143734; Tue, 4 Jul 2017 04:19:27 -0700 (PDT) Received: from localhost ([::1]:40489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLrX-0003jq-1H for importer@patchew.org; Tue, 04 Jul 2017 07:19:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkp-0006Rc-D1 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkl-0001kw-TI for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:27 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:35903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLkl-0001kb-Mu for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:23 -0400 Received: by mail-wr0-x241.google.com with SMTP id 77so46956705wrb.3 for ; Tue, 04 Jul 2017 04:12:23 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=76B0DpQ/q8JSZrU3kdcKsWoCYGCqU9tI4ABz2uHqIIg=; b=cZzlol7bcSoZT7Mj1Ee8B2DaMYnSxCAFbSLaDmG8ldYJbnfScV5YVdtHChxMYT003c NovhZYy+S0AnFXCAYMXrC/ELlUUigIvGVPTkCZn25LUEhLpJ8zkLHUyrCijbMKdsngCl A73eHUD3NVaeObF6SGNBF4d6R9YWFOWUS8v/DRPES2Hj1S1G2Tq2oM8B4fHmUUrVRx3j 0Py32p5rQPDNF7sVZJAg4Z8lqBrfY7nLpty8qtuB1rxt+605hzZV/0zM1h63PdU8g4/F pnd9OiBF0DqLe80QE6s0qGXexFMobAcYCjMdW3MKCXKDnktltkMdB30Q1+uASbbE+nvr G3MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=76B0DpQ/q8JSZrU3kdcKsWoCYGCqU9tI4ABz2uHqIIg=; b=fTIjFSN1jPlBfRVMhQXu0KXJ4oeULVx9dsjwge9KToQoShIKbdyURS3adY4vNRU+2z DpYbUObnXI7vlAtfq/KGBZPHWTQMJZneuppzG/JDzZuRP+M+IbL15QEWWfbWXHR6Vu/7 /9BLRbktesCnFNKK/RlISqOuVVxiNJfv5Lhi5rXZBL+WiKlFBmjfazSHetjAzc8Cvg0S L9EBu2cuQNdRj6P7lGZeav9+s8PKl0Knj+d5AYbOcGGzkg/6rMh98MAtWWmBow/O+lKr UBWlxLGvZf6ye/6GNkvC1ZvXPDowN2Nda0miQ73vh1EC8AzRE9JwIxIkET5QtiyfOdWg piuQ== X-Gm-Message-State: AKS2vOwmSRzOnNg7QlHU1C58xT6z2+5eJHOkBCbFufWWw13sgBZ0u6XD N6OkitsN7O1T9tFmMIw= X-Received: by 10.223.155.150 with SMTP id d22mr33149054wrc.193.1499166742402; Tue, 04 Jul 2017 04:12:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:54 +0200 Message-Id: <1499166735-39360-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH 01/22] configure: factor out list of supported Xen/KVM/HAX targets 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This will be useful when the functions are called, early in the configure process, to filter out targets that do not support hardware acceleration. Reviewed-by: Richard Henderson Reviewed-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- configure | 90 ++++++++++++++++++++++++++++++++++++++---------------------= ---- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/configure b/configure index c571ad1..0f14e79 100755 --- a/configure +++ b/configure @@ -163,6 +163,50 @@ have_backend () { echo "$trace_backends" | grep "$1" >/dev/null } =20 +glob() { + eval test -z '"${1#'"$2"'}"' +} + +supported_hax_target() { + test "$hax" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}" in + i386|x86_64) + return 0 + ;; + esac + return 1 +} + +supported_kvm_target() { + test "$kvm" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | i386:x32 | \ + x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ + mips:mips | mipsel:mips | \ + ppc:ppc | ppcemb:ppc | ppc64:ppc | \ + ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \ + s390x:s390x) + return 0 + ;; + esac + return 1 +} + +supported_xen_target() { + test "$xen" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64) + return 0 + ;; + esac + return 1 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -6178,46 +6222,22 @@ echo "TARGET_ABI_DIR=3D$TARGET_ABI_DIR" >> $config_= target_mak if [ "$HOST_VARIANT_DIR" !=3D "" ]; then echo "HOST_VARIANT_DIR=3D$HOST_VARIANT_DIR" >> $config_target_mak fi -case "$target_name" in - i386|x86_64) - if test "$xen" =3D "yes" -a "$target_softmmu" =3D "yes" ; then - echo "CONFIG_XEN=3Dy" >> $config_target_mak - if test "$xen_pci_passthrough" =3D yes; then + +if supported_xen_target $target; then + echo "CONFIG_XEN=3Dy" >> $config_target_mak + if test "$xen_pci_passthrough" =3D yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=3Dy" >> "$config_target_mak" - fi fi - ;; - *) -esac -case "$target_name" in - aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x|mipsel|mips) - # Make sure the target and host cpus are compatible - if test "$kvm" =3D "yes" -a "$target_softmmu" =3D "yes" -a \ - \( "$target_name" =3D "$cpu" -o \ - \( "$target_name" =3D "ppcemb" -a "$cpu" =3D "ppc" \) -o \ - \( "$target_name" =3D "ppc64" -a "$cpu" =3D "ppc" \) -o \ - \( "$target_name" =3D "ppc" -a "$cpu" =3D "ppc64" \) -o \ - \( "$target_name" =3D "ppcemb" -a "$cpu" =3D "ppc64" \) -o \ - \( "$target_name" =3D "mipsel" -a "$cpu" =3D "mips" \) -o \ - \( "$target_name" =3D "x86_64" -a "$cpu" =3D "i386" \) -o \ - \( "$target_name" =3D "i386" -a "$cpu" =3D "x86_64" \) -o \ - \( "$target_name" =3D "x86_64" -a "$cpu" =3D "x32" \) -o \ - \( "$target_name" =3D "i386" -a "$cpu" =3D "x32" \) \) ; then - echo "CONFIG_KVM=3Dy" >> $config_target_mak - if test "$vhost_net" =3D "yes" ; then +fi +if supported_kvm_target $target; then + echo "CONFIG_KVM=3Dy" >> $config_target_mak + if test "$vhost_net" =3D "yes" ; then echo "CONFIG_VHOST_NET=3Dy" >> $config_target_mak echo "CONFIG_VHOST_NET_TEST_$target_name=3Dy" >> $config_host_mak - fi fi -esac -if test "$hax" =3D "yes" ; then - if test "$target_softmmu" =3D "yes" ; then - case "$target_name" in - i386|x86_64) - echo "CONFIG_HAX=3Dy" >> $config_target_mak - ;; - esac - fi +fi +if supported_hax_target $target; then + echo "CONFIG_HAX=3Dy" >> $config_target_mak fi if test "$target_bigendian" =3D "yes" ; then echo "TARGET_WORDS_BIGENDIAN=3Dy" >> $config_target_mak --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499166997731619.0944599093607; Tue, 4 Jul 2017 04:16:37 -0700 (PDT) Received: from localhost ([::1]:40481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLon-0001Vd-Fq for importer@patchew.org; Tue, 04 Jul 2017 07:16:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkp-0006Rd-D0 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkn-0001le-Aa for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:27 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:35130) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLkn-0001lH-3U for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:25 -0400 Received: by mail-wm0-x22c.google.com with SMTP id w126so192597943wme.0 for ; Tue, 04 Jul 2017 04:12:25 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YhGG6q8zyyd+1vyBsKHqkhSIp/rgqE6/RV4n6CnTfn8=; b=cFgR48JQWXVpf+vlKHb1F+BA4nVKYaDkSgcgkLNPmQCA61b5JIw7+dTyfgvb2Rub3S E4naHAp/UTb8DiQlf5aSD1MfsVIGghe8LdxVmYAS/fLZCwLg3qd5SvmMD751ponOVoRs FRXG26Nt/FopP+59PfUy7waOxmKqYY2j96VQGzYXJ1qIk8+pp/dOqZuHvCBnQGzNVnQN 2tyJ2qPR9bxk9UAceMQPRzbx8HeDG6Gsls7BZXSUCD9jTvRh5SaKnE/JeDxfS7AorUEi yB9RAI1fB0nEg+gbzHwTLv3ZsMeMrPHP3JkTbgt0lKn2w3lROsKBDnbIRwqgM7o/FJmS RVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YhGG6q8zyyd+1vyBsKHqkhSIp/rgqE6/RV4n6CnTfn8=; b=FluyCgsnM8A6U7u+jPArZhRsI6aMondi6VApJeSFFN4GW+qIN5hCcuW4JuezZfOYgx FCRNI+2ARJxj6qq0qMJLKZporsbisGlIbWSKCiiwA0IDgRJcl5bkztbe6bZXZG+YsNvY 5PwB55dlshYweDRPJ219ULCz+ln7RoZkHuLdvyENA1PnVP6/diOd5CM8Mrc9vBGIUq0Y zISTM3FUpuLzkreVB+AcXYsoClS/rRIVkvcUAD3IpqteIe3aoIZbXW+XoCHhYDvTyfr4 Ltmbbw+uJtbcpCftmSzNACCbdxd59BhpXXYif4j5iTx79LlscurUi1VRs7EQbJBojmyk /ZqA== X-Gm-Message-State: AKS2vOzSItagrW/FYbr+gddPPRLWaS1RtyVNh+oKtlQ9CBUVH0VDpwNK vokKhQgVm6xbHUC9+64= X-Received: by 10.28.51.212 with SMTP id z203mr29255019wmz.103.1499166743810; Tue, 04 Jul 2017 04:12:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:55 +0200 Message-Id: <1499166735-39360-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22c Subject: [Qemu-devel] [PATCH 02/22] configure: early test for supported targets 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Check for unsupported targets in target_list, and print an error early in the configuration process. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange --- v2: place ;; on a separate line [Daniel] configure | 70 +++++++++++++++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 0f14e79..ae69e96 100755 --- a/configure +++ b/configure @@ -40,14 +40,18 @@ printf " '%s'" "$0" "$@" >> config.log echo >> config.log echo "#" >> config.log =20 -error_exit() { - echo +print_error() { + (echo echo "ERROR: $1" while test -n "$2"; do echo " $2" shift done - echo + echo) >&2 +} + +error_exit() { + print_error "$@" exit 1 } =20 @@ -207,6 +211,30 @@ supported_xen_target() { return 1 } =20 +supported_target() { + case "$1" in + *-softmmu) + ;; + *-linux-user) + if test "$linux" !=3D "yes"; then + print_error "Target '$target' is only available on a Linux= host" + return 1 + fi + ;; + *-bsd-user) + if test "$bsd" !=3D "yes"; then + print_error "Target '$target' is only available on a BSD h= ost" + return 1 + fi + ;; + *) + print_error "Invalid target name '$target'" + return 1 + ;; + esac + return 0 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -1734,23 +1762,27 @@ if test "$solaris" =3D "yes" ; then fi =20 if test -z "${target_list+xxx}" ; then - target_list=3D"$default_target_list" + for target in $default_target_list; do + supported_target $target 2>/dev/null && \ + target_list=3D"$target_list $target" + done + target_list=3D"${target_list# }" else target_list=3D$(echo "$target_list" | sed -e 's/,/ /g') + for target in $target_list; do + # Check that we recognised the target name; this allows a more + # friendly error message than if we let it fall through. + case " $default_target_list " in + *" $target "*) + ;; + *) + error_exit "Unknown target name '$target'" + ;; + esac + supported_target $target || exit 1 + done fi =20 -# Check that we recognised the target name; this allows a more -# friendly error message than if we let it fall through. -for target in $target_list; do - case " $default_target_list " in - *" $target "*) - ;; - *) - error_exit "Unknown target name '$target'" - ;; - esac -done - # see if system emulation was really requested case " $target_list " in *"-softmmu "*) softmmu=3Dyes @@ -6050,16 +6082,10 @@ case "$target" in target_softmmu=3D"yes" ;; ${target_name}-linux-user) - if test "$linux" !=3D "yes" ; then - error_exit "Target '$target' is only available on a Linux host" - fi target_user_only=3D"yes" target_linux_user=3D"yes" ;; ${target_name}-bsd-user) - if test "$bsd" !=3D "yes" ; then - error_exit "Target '$target' is only available on a BSD host" - fi target_user_only=3D"yes" target_bsd_user=3D"yes" ;; --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167326185731.2451089489393; Tue, 4 Jul 2017 04:22:06 -0700 (PDT) Received: from localhost ([::1]:40503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLu5-0006AW-Un for importer@patchew.org; Tue, 04 Jul 2017 07:22:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkp-0006Rp-If for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLko-0001mK-J7 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:27 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35502) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLko-0001lo-CT for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:26 -0400 Received: by mail-wm0-x243.google.com with SMTP id u23so25602136wma.2 for ; Tue, 04 Jul 2017 04:12:26 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KWh+w09zYzVJggSB950R1d5SwNoaGeuYyRQXxphTzc8=; b=KP6n8sT2bm8gY0/cIHDSi9VibePgwh9PCVtwwVoGKrnW0vBbFAdNm5X0SyV8lgSEH+ Yd+eSWdYs816858wcEQldqILXX0EXJR+jgYERbRuHglXHmxLgbS7wT+iZI5gjChqW5r/ XeWGgTYon1Cfm32/Rv/rhtClnuHZA2YR/g+uxdrL6c4S6fE2529t9QF4CFNftk4OFqN8 FTK23c/OYJ5mVVgWVt0Ohq5a5bjGNKKEIdZaWvKZwaxvpjN2bCSd0bby2SBD9NPzNfde zRFd97GB/S7zN6+B1VieXkz6Hd4uNPNb7zRyemNVCSPIdmNdR6uf9n0O+q7dkWlVpi8k CjHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=KWh+w09zYzVJggSB950R1d5SwNoaGeuYyRQXxphTzc8=; b=byoR6px4E4umHC5s0el88yiupDxqTbxkrk3n5dJTsVla99oGyPlqbE8O1XDAdzcwZ5 d8MUWybFMTNhsy76eZ9URlcDaHA6vcR9Fp5VAzMqJNGSCGr+M0jq7YGXjIxIJgadbHUP P75i4ml787T3cDFBjqho/f0qaXPRLnyV6ZETDZX9VTiOEcA8duQpMKJhdjZbdoCmYG8R dU0dfZZIhSL9AS53YQ+IILya+RffsKexK4oD4UU6Ksh+nzu5vJwKBcOm0DB3nZN6QEyd qeh8++mfp9KvI6L4F9LMRlsCdQzbKWR0YLJXfYEMbiIyEchc/EykX+1EQHCEla0twS7M vi+A== X-Gm-Message-State: AIVw111CCFuVoDkHnkwUvrx7XLXkNlIaTX+zvmUd/lunQIy9Jl1DM0Qa NB+N47vcCpvtO1RAY9Q= X-Received: by 10.28.39.129 with SMTP id n123mr17134140wmn.70.1499166745136; Tue, 04 Jul 2017 04:12:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:56 +0200 Message-Id: <1499166735-39360-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 03/22] configure: add --disable-tcg configure 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, Anthony Liguori , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Anthony Liguori This lets you build without TCG (hardware accelerationor qtest only). When this flag is passed to configure, it will automatically filter out the targ= et list to only those that support KVM or Xen or HAX. Signed-off-by: Anthony Liguori Reviewed-by: Richard Henderson Reviewed-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- configure | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/configure b/configure index ae69e96..806658c 100755 --- a/configure +++ b/configure @@ -232,7 +232,12 @@ supported_target() { return 1 ;; esac - return 0 + test "$tcg" =3D "yes" && return 0 + supported_kvm_target "$1" && return 0 + supported_xen_target "$1" && return 0 + supported_hax_target "$1" && return 0 + print_error "TCG disabled, but hardware accelerator not available for = '$target'" + return 1 } =20 # default parameters @@ -296,6 +301,7 @@ cap_ng=3D"" attr=3D"" libattr=3D"" xfs=3D"" +tcg=3D"yes" =20 vhost_net=3D"no" vhost_scsi=3D"no" @@ -1033,6 +1039,10 @@ for opt do ;; --enable-cap-ng) cap_ng=3D"yes" ;; + --disable-tcg) tcg=3D"no" + ;; + --enable-tcg) tcg=3D"yes" + ;; --disable-spice) spice=3D"no" ;; --enable-spice) spice=3D"yes" @@ -5195,7 +5205,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" @@ -5250,8 +5259,12 @@ echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" echo "HAX support $hax" +echo "TCG support $tcg" +if test "$tcg" =3D "yes" ; then + echo "TCG debug enabled $debug_tcg" + echo "TCG interpreter $tcg_interpreter" +fi echo "RDMA support $rdma" -echo "TCG interpreter $tcg_interpreter" echo "fdt support $fdt" echo "preadv support $preadv" echo "fdatasync $fdatasync" @@ -5694,8 +5707,11 @@ fi if test "$signalfd" =3D "yes" ; then echo "CONFIG_SIGNALFD=3Dy" >> $config_host_mak fi -if test "$tcg_interpreter" =3D "yes" ; then - echo "CONFIG_TCG_INTERPRETER=3Dy" >> $config_host_mak +if test "$tcg" =3D "yes"; then + echo "CONFIG_TCG=3Dy" >> $config_host_mak + if test "$tcg_interpreter" =3D "yes" ; then + echo "CONFIG_TCG_INTERPRETER=3Dy" >> $config_host_mak + fi fi if test "$fdatasync" =3D "yes" ; then echo "CONFIG_FDATASYNC=3Dy" >> $config_host_mak --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167473659497.6343198259847; Tue, 4 Jul 2017 04:24:33 -0700 (PDT) Received: from localhost ([::1]:40516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLwV-000188-7e for importer@patchew.org; Tue, 04 Jul 2017 07:24:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkr-0006TO-4M for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkq-0001nL-4A for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:29 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLkp-0001mf-TM for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:28 -0400 Received: by mail-wr0-x243.google.com with SMTP id 77so46957120wrb.3 for ; Tue, 04 Jul 2017 04:12:27 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=OuHUYfV+8wKZCHeL2l43MHlNNiFtB6doEk7L5nba43M=; b=AZtVsp5Qkd3mprxSe/Fn8ag21mZYZU0LyKb+sZoZKBH+aAX41yA9RV2qdqtDBhuG2F mRLsDuplPEOQ61PJNe803ewWfhAkKGE1lWa74X58EiaCHawdSGIUADbx/NuiPLMQcu6a 4HebpMBDoxEv43DWXQxn57AtAyziT7s1q1QaUqsiG3dqnGffzkuBkOhafE6xKAR/JouJ S+tsf5PwKxDNfgUn8ThAgSJowRY3E71kjnKazmTI6my7OL6kxMcDWq65r3+5Wbex92Xe Bi97CYYWDVOANcg3hzmb95WAPq24mT/0FHLRkdQW6wZpTVO5u96PKxji6kHj9nMxKNtE StEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=OuHUYfV+8wKZCHeL2l43MHlNNiFtB6doEk7L5nba43M=; b=pJhHLupjepeusIj3FvgEQTUUfGSTcKLaFJstKuHuz8lRs+aW6fuMZzySTBaf+mZ8a+ WRx3Zipsg+TBl7TZvBWjh6CnWDcG0BXCpDNu6tm8+mTueS23UDY4Hk/6LEVywZe4lwWb /lNMn39aX1pvgVvjvj1maG86AiS/8hiqJ+MfYz8iXfMg2bOIkSQzbRCsa8JzKk8w7UWH GemDji9xg2Gt+wu93qIs9zRKl1TXct3bCGA+XUeGqmxt/G5cI04EZ5hcyV9UelXVxVjD i1XrkfJS6Qln8CB5LHSDFMNR6C/3vSOUn7g2vD5rNZKr0+wFkgTQiZLjMe5Ylot0R5FC fH1w== X-Gm-Message-State: AKS2vOwB8XcAUI9/jpkwxRJtfuu/22HNPYxK3QkO+gN4nbuNu8xO8lca fUgVstLMYSHZ9LYETm0= X-Received: by 10.223.175.37 with SMTP id z34mr35749810wrc.11.1499166746671; Tue, 04 Jul 2017 04:12:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:57 +0200 Message-Id: <1499166735-39360-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH 04/22] vl: convert -tb-size to qemu_strtoul 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/tcg/tcg-all.c | 2 +- include/sysemu/accel.h | 2 +- vl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index dba9931..e327d90 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -28,7 +28,7 @@ #include "sysemu/sysemu.h" #include "qom/object.h" =20 -int tcg_tb_size; +unsigned long tcg_tb_size; static bool tcg_allowed =3D true; =20 static int tcg_init(MachineState *ms) diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index ecc5c84..5a632ce 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -63,7 +63,7 @@ typedef struct AccelClass { #define ACCEL_GET_CLASS(obj) \ OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL) =20 -extern int tcg_tb_size; +extern unsigned long tcg_tb_size; =20 void configure_accelerator(MachineState *ms); /* Register accelerator specific global properties */ diff --git a/vl.c b/vl.c index 36ff3f4..ea8ef5f 100644 --- a/vl.c +++ b/vl.c @@ -3933,9 +3933,9 @@ int main(int argc, char **argv, char **envp) configure_rtc(opts); break; case QEMU_OPTION_tb_size: - tcg_tb_size =3D strtol(optarg, NULL, 0); - if (tcg_tb_size < 0) { - tcg_tb_size =3D 0; + if (qemu_strtoul(optarg, NULL, 0, &tcg_tb_size) < 0) { + error_report("Invalid argument to -tb-size"); + exit(1); } break; case QEMU_OPTION_icount: --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499166908687336.64740577808686; Tue, 4 Jul 2017 04:15:08 -0700 (PDT) Received: from localhost ([::1]:40471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLnN-0000A5-Vj for importer@patchew.org; Tue, 04 Jul 2017 07:15:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLks-0006Uf-AL for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkr-0001oP-Dq for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:30 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33319) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLkr-0001ne-6o for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:29 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so25559810wmj.0 for ; Tue, 04 Jul 2017 04:12:29 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=DXZ5Z/aTyn5euUH8YY2oqYZU3PTnk1x9dy5J7+OKUQ0=; b=Xem4z5cpzDYB/I//076ILGHufSjv5WEyddTOS1UdLnAI/ghmJx3pFo4bfVZWGFmW5Z oelzyjtZHfgogyy3BEDdq0M9GNbBlc1cGNGoqtCYf0Z+ant7SQKqMamm8/RdlFYqJbVo DEdNjewzWrw/cD3qi6CODN1gFDIHEOw5H4gf73xshpdzXzzz9nqjb6d7AYxcsEQCSOPo FixeDQ8msycHtmxgOnsURQw+huyfDFpkoDtFbKi6aIU5/AdITi9RDaWdpywwUyD6JzI+ YZn/Ldcf/A9pwfppXVzvN/Y9gUp7OCgYuinCGGhKXEomBcsDr/k2qhzCttVEThhzsVep 62bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=DXZ5Z/aTyn5euUH8YY2oqYZU3PTnk1x9dy5J7+OKUQ0=; b=SXfPgCNVRlJ4UvlcSuyqzSRiSr5FZYuxXAkw1k86coNstFqGoheehhnVGVZiiwlpjx RvFUfWcgx/aum0doNW4tmTxu17ywBiOlpKJerLEAqVNBVYmEuY/gobRUwx7Kc8x7ws2V hNSgjfsjxWHEyvcXK5vcb57ayS8ytwplHbkx9+iX74Q1dur3YOXTFRlaflXdpycvFuiR lBih+hRaxlZrHk5h6AbXWUmnbrGbq3QD+0/+BtA/QkpJ+iXESd/zEMxAo7/XjRcZidc1 M7ZLiA5nJiO3ulu3zL8IPqHwFxOTqdEKRnlLg7D/Ghu2y3gVqE2ln+NG/2UBttFwz4Bv jETg== X-Gm-Message-State: AKS2vOxPcelAuFl08BCfqlEC2R/K/MtCWgIsllamMmnjG/ZfAeiIftTP fSl0sGVHOeBOmP1qkL0= X-Received: by 10.28.64.196 with SMTP id n187mr26466638wma.94.1499166748063; Tue, 04 Jul 2017 04:12:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:58 +0200 Message-Id: <1499166735-39360-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 05/22] vl: add tcg_enabled() 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong 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 Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- vl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index ea8ef5f..d17c863 100644 --- a/vl.c +++ b/vl.c @@ -3933,6 +3933,10 @@ int main(int argc, char **argv, char **envp) configure_rtc(opts); break; case QEMU_OPTION_tb_size: + if (!tcg_enabled()) { + error_report("TCG is disabled"); + exit(1); + } if (qemu_strtoul(optarg, NULL, 0, &tcg_tb_size) < 0) { error_report("Invalid argument to -tb-size"); exit(1); @@ -4481,7 +4485,9 @@ int main(int argc, char **argv, char **envp) qemu_opts_del(icount_opts); } =20 - qemu_tcg_configure(accel_opts, &error_fatal); + if (tcg_enabled()) { + qemu_tcg_configure(accel_opts, &error_fatal); + } =20 if (default_net) { QemuOptsList *net =3D qemu_find_opts("net"); --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167063966594.1160099748412; Tue, 4 Jul 2017 04:17:43 -0700 (PDT) Received: from localhost ([::1]:40484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLpu-0002KV-Oq for importer@patchew.org; Tue, 04 Jul 2017 07:17:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkt-0006WF-UN for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkt-0001pE-0h for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:31 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLks-0001oq-PE for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:30 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so25528434wmh.3 for ; Tue, 04 Jul 2017 04:12:30 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0Igbvi3iVTR/PP9rw8Waw/orVboHGUNdUpGLtkxwJTE=; b=HepCVHd6oFoNgsj+H6Q606LucL2fq4uqJZ29jWQnWx3sm82nm6hmgvkREdqv6PSBd1 Eb/vz+3NylUqp+BoxjevDfU5lnZUZY5PuWLFKEXb2eRnxvSkVYBigqiL1huHG3seoqBh rDAfuxLvOD20Lxs5YEd0nJCXTDD6mC4cmWTL1Mx8/pNrCHtX15n94l+68RGpgen19MXt /kA/ex2jQYS7kk9osJt01hs2kBY13SrJlLA91a9+HjC8yrpFYLwoXXzJ0GdyQc7AnqE/ hwml4d8Akgu/N7RUZu+Z8lTbvtfPR2OdSSopoc0Gtgr8jefwb/8sffseZThIAUwIdI6F W9PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=0Igbvi3iVTR/PP9rw8Waw/orVboHGUNdUpGLtkxwJTE=; b=TbdM19mcFhISpREKnBlNvlFPJk8xc47iS9Pb9gavRqI5Pu7niD9G252W4IqEAHEWTP GX16samjfHoR0LUnVKerdNjh4dxvQUSHcWPaqVgkAJfngmHHXKoWQmm9VGFsfHNt9C0S ySRd7ykfQbDu84IhMrdapTm1FHKZKF3HGp8ke8W9+X4n0v/dPrq2vVnK/1/4TAMzQNNG PKp+3YABEgzxmsdUUhSy6ThTVMCC6wtfXyZ7kaucDeEovZGuc+ALkQmWLoBWeokd0goO CNAW9uIwyMBfc9tAWHYky1No1owOl+ijewxnDStBdTBEAgzd96Lx4DXpRl/KQiNoqWQz VZlw== X-Gm-Message-State: AKS2vOzUzOm8rCabZ+TXGWdJRb6XBYFlPDqqP2CIbbjTOefL8QILi7Gf 61Fr6gGVElr+BR66f6M= X-Received: by 10.28.31.203 with SMTP id f194mr17762719wmf.44.1499166749530; Tue, 04 Jul 2017 04:12:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:59 +0200 Message-Id: <1499166735-39360-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 06/22] 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong 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 Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- 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 93fb923..8428fce 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.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499166869940296.1404286173829; Tue, 4 Jul 2017 04:14:29 -0700 (PDT) Received: from localhost ([::1]:40469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLmm-0007xI-Ky for importer@patchew.org; Tue, 04 Jul 2017 07:14:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkv-0006YV-VC for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLku-0001pw-Je for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:33 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLku-0001pT-A2 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:32 -0400 Received: by mail-wm0-x244.google.com with SMTP id p204so25630268wmg.1 for ; Tue, 04 Jul 2017 04:12:32 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=9hJbnIceqewlURC3st+opMa+lJr+ZrNzZ8dWV4pva04=; b=E6Duy5FsEzk0qi+XgypYV1u/sSXO0vcFdZyhQtWoO02yP0FipIe0eiU2zkge5FbsrS YsO0O4UEMl6WkjNXgemMREgHcL5mBg6OACvWP5dZpNgY+AS3fe6BNS7jbjTQg+jslue/ RMoGi6UpIeLyvkqevd5aQMIT+Bgds4oDtzQTojYPsXj0Mq0H9clbq7s3ux2ZNPuVZ8g+ 6R7UDjYrjiiJHcZkhHLUF5uxYwDaGcA5X1WsYp5bi3cw/Uyy+HviyRrgRy0/yb4Bh+7X lyJ5prAhZ+zomsJMhF1di2zqhPnEKkynIKL+hAHeyVuCGJZomHJLmipb4+t0dk7mbKas n+Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=9hJbnIceqewlURC3st+opMa+lJr+ZrNzZ8dWV4pva04=; b=LW0ovIPU6fJWC9CmefJzXmOMp4S6UUURGphYrMQTZ7fJIeJPVqNqxhH6FeeJaCzFFN sk4AWQLdov/ggVQkZcEaRUgtMxcpjuDChNcjA9Xkw+wDfv/c9mwKalom3iwqTX4j5U4m oA4n0ZuISs9DnpuMsQLlKdEi6Kul488belf3uakWQ3OX+ygef5bvfQOImxQJQQVYRCqe rCztVEcZNJepdRp37zK/DQJMSUiNTVTPmBvs366RLC/EPeHaAMlwarDxNSi2tAKduoqz nq3FULuly1Y+9LAhryWcZsw1hslmFrPm0npH4/HjlmVsCRf9vCNtKa4s5WH/iyfSfCo9 qjzQ== X-Gm-Message-State: AKS2vOwUP+9L9Fx2QwLOeNk1nWpWsfbtlppuf8SSBx1hJlMqgxQaQPk7 Unz3Rj2RR5XTwNFG4LM= X-Received: by 10.28.165.199 with SMTP id o190mr17431080wme.57.1499166751025; Tue, 04 Jul 2017 04:12:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:00 +0200 Message-Id: <1499166735-39360-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 07/22] 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Move tcg_handle_interrupt() from translate-common.c to accel/tcg/tcg-all.c. Signed-off-by: Yang Zhong Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/tcg/Makefile.objs | 2 +- accel/tcg/tcg-all.c | 32 +++++++++++++++++++++++++ accel/tcg/translate-common.c | 56 ----------------------------------------= ---- qom/cpu.c | 2 ++ 4 files changed, 35 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/tcg-all.c b/accel/tcg/tcg-all.c index e327d90..c1ccad3 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -27,13 +27,45 @@ #include "sysemu/accel.h" #include "sysemu/sysemu.h" #include "qom/object.h" +#include "qemu-common.h" +#include "qom/cpu.h" +#include "sysemu/cpus.h" +#include "qemu/main-loop.h" =20 unsigned long tcg_tb_size; static bool tcg_allowed =3D true; =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 + static int tcg_init(MachineState *ms) { tcg_exec_init(tcg_tb_size * 1024 * 1024); + cpu_interrupt_handler =3D tcg_handle_interrupt; return 0; } =20 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/qom/cpu.c b/qom/cpu.c index 585419b..1d7aa59 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -31,6 +31,8 @@ #include "hw/qdev-properties.h" #include "trace-root.h" =20 +CPUInterruptHandler cpu_interrupt_handler; + bool cpu_exists(int64_t id) { CPUState *cpu; --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167626264400.67923884317975; Tue, 4 Jul 2017 04:27:06 -0700 (PDT) Received: from localhost ([::1]:40530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLyw-0003J7-Vp for importer@patchew.org; Tue, 04 Jul 2017 07:27:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLl0-0006bu-GW for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkv-0001qm-Mb for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:38 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLkv-0001qD-G5 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:33 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so25528667wmh.3 for ; Tue, 04 Jul 2017 04:12:33 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=20edSnAM7zhhFf15+xC0fohzZw8ZKCZk/WMu639DMCs=; b=RoN44V1ajBjcZhAXvloTtl8xjfnwN/Egn7SFwOGfyABWNdskykNN4AA1o5WMe3sGUX 0LMYETF+RHmWfCPwH5gFXZJ986IL/SkCcc1yhDzmfHsKxIywmZrMai4rm1EM0nq1SV8H 0E8uJTAM26a197/wxCYRumSZIOsNSYXOk8QIyiItCjhwYLHfs/quiFj1xPGS4dqKwIyA uxonWn8BpPrGpbV9LMSoaEHqGZE6KcVmnV/YBFsfRumuojRGAxQAf2E/T7hcPP0XPpPL ULnK1ItDuyGZB8dFYEgMyTpg0H0776bhDr6wvUdT2JATT63nPMV1WLhRYYHIGSRo0jIy 6zgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=20edSnAM7zhhFf15+xC0fohzZw8ZKCZk/WMu639DMCs=; b=gAwg8h1wQHSA6It2OuUrf+uJYokWQ2ZnbpNYW7xLfql1cq+JoVoQYuxXYaopxo1jFV hHAwqlvevDzs0YL/qsNTSyA7K1lCPbf3iAMo6YQajSlJkYHm6530Z2wBA5yn5EsyVVT/ InZZIHOT5s8v/LC5jfP+uU5gXo9aP++1jYbWUNMnrnZ9FPfUBJMyf6iQ8QyDsg49hOdu +zjCbdzaoH1esJXwh2QcnCj8vg0dyVFlNQR1O8B+UQSJ38lVNkZdHEolsJImEgtXWcM3 m51jsJaS5XEZ7BdRrN41xr95mQLXNiYGLhAkaTEPDScezXM9xap8e/tuNzwkTN6lv8la SeBw== X-Gm-Message-State: AKS2vOwxRh7Hav428+aIUPWoXGSUQP6KLL4B9NMhZzPZf6vtsGma5pMb Hw1DSNa2aIp5CUy0SfM= X-Received: by 10.28.228.85 with SMTP id b82mr26551970wmh.65.1499166752358; Tue, 04 Jul 2017 04:12:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:01 +0200 Message-Id: <1499166735-39360-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 08/22] tcg: make tcg_allowed global 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Change the tcg_enabled() and make sure user build still enable tcg even x86 softmmu disable tcg. Signed-off-by: Yang Zhong Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/tcg/cpu-exec-common.c | 2 ++ accel/tcg/tcg-all.c | 1 - accel/tcg/translate-all.c | 6 +----- include/qemu-common.h | 7 ++++++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index e81da27..5b4ae54 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -23,6 +23,8 @@ #include "exec/exec-all.h" #include "exec/memory-internal.h" =20 +bool tcg_allowed; + /* exit the current TB, but without causing any exception to be raised */ void cpu_loop_exit_noexc(CPUState *cpu) { diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index c1ccad3..56dbb56 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -33,7 +33,6 @@ #include "qemu/main-loop.h" =20 unsigned long tcg_tb_size; -static bool tcg_allowed =3D true; =20 #ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 8428fce..4c1d8c9 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -784,6 +784,7 @@ static void tb_htable_init(void) size. */ void tcg_exec_init(unsigned long tb_size) { + tcg_allowed =3D true; cpu_gen_init(); page_init(); tb_htable_init(); @@ -795,11 +796,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/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); --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167003162395.96044514572407; Tue, 4 Jul 2017 04:16:43 -0700 (PDT) Received: from localhost ([::1]:40482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLow-0001am-0T for importer@patchew.org; Tue, 04 Jul 2017 07:16:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLl4-0006f1-2e for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLl3-0001tI-3j for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:41 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLl2-0001st-Sz for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:41 -0400 Received: by mail-wm0-x244.google.com with SMTP id u23so25603576wma.2 for ; Tue, 04 Jul 2017 04:12:40 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lf072s9jOSzfAKoBLji81+wJ8Il622s4vUAYTPthvmo=; b=KE7KaTD0esALn5y2Y272JtSs8wiOuRX6iA+4yG5NSK9R03DZeUbxACSKnK8+CTwk4e NFQfs2K/Z+GXOBCT3tvul6izcCwkVcpsM1XtsdeA3oU722+pDGCdgB4ypOvXLRH3MyJr SUpkLjC9Lr4sIuRB9YFQhlJscnNQW+Akh8AASyPAwAwYYpJ2VCeoyI2HORYf/kY+/ELy WvzfwNX4NEvhw6OFtfnhvgHnqCpgwA9ooN0LeykU1zTyKho4lAokPC0bYycBxKkhRd3w DEXepxpdsoPeYDwPTKdUgewQdL//varpmJXnYrMCtU2Qx3OeH7QFsYu2c4IsI1yzjZbb p4Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lf072s9jOSzfAKoBLji81+wJ8Il622s4vUAYTPthvmo=; b=dhj5CQob3SEvbOJiZa2wo2dB7bt0Pnwsaz/z+cdBIj6ongM2KQs0qOPV9pK0bMjvec pvjWT4y8CbjhTr5GqQGqDjuiXd4VTmV1jyCQOZDic6uNITvYY/VIqG8kmOQD2zpSRqKw bLcFn+joFSi8wfOHikOPPdCJb1FlpdiKypzIumWa4fVPJuepLwL11BkNRyKdecTb4Dag PKt50zESOBXdu9J8KrtOBF3IqUH5geGqMgua9KKHi+FH970BnyqzEjTAnF26NkoQNVVB IdvOa1WEifVdPY0PjnEVIWGzJL8jtTQodlJCklL61V1dPASqzSZ7WH4y5ooQIsvrE/Od US3Q== X-Gm-Message-State: AKS2vOzFU3VnvQFINn+Rco86rnaUhP9bNURbTOseqFUxI2zgpCegBJXr OGJG8VZgLgt8ebLezkI= X-Received: by 10.28.199.200 with SMTP id x191mr17549927wmf.94.1499166759727; Tue, 04 Jul 2017 04:12:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:02 +0200 Message-Id: <1499166735-39360-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 09/22] monitor: disable "info jit" and "info opcount" if !TCG 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/tcg/translate-all.c | 5 +++++ hmp-commands-info.hx | 4 ++++ monitor.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 4c1d8c9..093207a 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1851,6 +1851,11 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fp= rintf) =20 tb_lock(); =20 + if (!tcg_enabled()) { + cpu_fprintf(f, "TCG not enabled\n"); + return; + } + target_code_size =3D 0; max_target_code_size =3D 0; cross_page =3D 0; diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ba98e58..07500ef 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -261,6 +261,7 @@ STEXI Show memory tree. ETEXI =20 +#if defined(CONFIG_TCG) { .name =3D "jit", .args_type =3D "", @@ -268,6 +269,7 @@ ETEXI .help =3D "show dynamic compiler info", .cmd =3D hmp_info_jit, }, +#endif =20 STEXI @item info jit @@ -275,6 +277,7 @@ STEXI Show dynamic compiler info. ETEXI =20 +#if defined(CONFIG_TCG) { .name =3D "opcount", .args_type =3D "", @@ -282,6 +285,7 @@ ETEXI .help =3D "show dynamic compiler opcode counters", .cmd =3D hmp_info_opcount, }, +#endif =20 STEXI @item info opcount diff --git a/monitor.c b/monitor.c index 4031876..d8ac20f 100644 --- a/monitor.c +++ b/monitor.c @@ -1098,6 +1098,7 @@ static void hmp_info_registers(Monitor *mon, const QD= ict *qdict) } } =20 +#ifdef CONFIG_TCG static void hmp_info_jit(Monitor *mon, const QDict *qdict) { if (!tcg_enabled()) { @@ -1113,6 +1114,7 @@ static void hmp_info_opcount(Monitor *mon, const QDic= t *qdict) { dump_opcount_info((FILE *)mon, monitor_fprintf); } +#endif =20 static void hmp_info_history(Monitor *mon, const QDict *qdict) { --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167171556429.24504149138284; Tue, 4 Jul 2017 04:19:31 -0700 (PDT) Received: from localhost ([::1]:40490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLrd-0003q7-5A for importer@patchew.org; Tue, 04 Jul 2017 07:19:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLl5-0006gV-JW for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLl4-0001u2-MF for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:43 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34421) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLl4-0001te-FB for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:42 -0400 Received: by mail-wr0-x241.google.com with SMTP id k67so46853034wrc.1 for ; Tue, 04 Jul 2017 04:12:42 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bsk1zHOy//fwJzlz/CdS8R5/02NWnPphgT9hZFloWcg=; b=mU7l1a2nu4My7MC9h/GuNOikShlMmN8J7G0eUdmS8qgxj8KYglrdilwiAl0aae8wfw LAUBNJdwGx3u+r6s96T2+/itJ0JozvUu3r4HOjBsUjiX7XMCQF/iS0VAoLf+M6P5zzCG Libd7nmhxPvXpqfEgiLzQj8dDzWl5bveLpx/5QFjTYxRXRld8sz4SlXceKiEku5Qn/Mn nkRpdRtCBJrWsoshXFwY8oY/XttStpbzeh6jyJsHoaqnegEpNIbJmOIQ24/lXhEBssdP ckPRR1GXdeZFuzCNaB/YOFNZt4sEz+ItKN42TY1HopbANXxazAZP8otJp3iArIUyrivY GHYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Bsk1zHOy//fwJzlz/CdS8R5/02NWnPphgT9hZFloWcg=; b=EyTu0sFzG6Dnv72i2dTJvGIA74ayrC8gR8rJTsfY0Erp1qC5UgLZK/YLrYbhlpVxdw i/QkgaNmHc58I0dMeRget5jID4PrNSANFD74VVbBF2UhJmFVQZ1Yp/8N0MnDotDzbycy +z3inAl1Uwpjn9nXZkBGxsqi3DpfAlBsK9WsedLExbrE2oBM77e0BYh91tGZJHhmTP4b SWCjC/xs92X1Px9PphZWVprcA3jrPyQ7rYnWxAbEaCFMeYXDE4KH8eI6R/KOxzucRmmM Ie6r7P/pX07Dj2JEeIBDHzW7UTSKf8awhgp+Zo6AinlZE8xzOp41IjUNNtDbIjyhVWsf v5mA== X-Gm-Message-State: AKS2vOyFFBYGrvdqbMsTptgD0KrSXxB15EPm27g/lgk11DEqQhGEzvSA YlQ6B1TDMT/2clhTFFs= X-Received: by 10.223.173.143 with SMTP id w15mr33335115wrc.113.1499166761299; Tue, 04 Jul 2017 04:12:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:03 +0200 Message-Id: <1499166735-39360-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH 10/22] vapic: use 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- hw/i386/kvmvapic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 82a4955..0d9ef77 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -410,7 +410,8 @@ static void patch_instruction(VAPICROMState *s, X86CPU = *cpu, target_ulong ip) handlers =3D &s->rom_state.mp; } =20 - if (!kvm_enabled()) { + if (tcg_enabled()) { + cpu_restore_state(cs, cs->mem_io_pc); cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base, ¤t_flags); /* Account this instruction, because we will exit the tb. @@ -456,7 +457,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU = *cpu, target_ulong ip) =20 resume_all_vcpus(); =20 - if (!kvm_enabled()) { + if (tcg_enabled()) { /* Both tb_lock and iothread_mutex will be reset when * longjmps back into the cpu_exec loop. */ tb_lock(); --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167330818653.4929492817346; Tue, 4 Jul 2017 04:22:10 -0700 (PDT) Received: from localhost ([::1]:40505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLuB-0006G3-IJ for importer@patchew.org; Tue, 04 Jul 2017 07:22:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlA-0006lD-TQ for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLl6-0001uZ-0O for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:48 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35926) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLl5-0001uD-Qo for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:43 -0400 Received: by mail-wr0-x243.google.com with SMTP id 77so46958003wrb.3 for ; Tue, 04 Jul 2017 04:12:43 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EQq/SFRYOcYBKRcm4VFLldysGy5gKplMqhOHmQevMpU=; b=S4C7DOrag71wW9UuTwnWFzO78WBjCUAfXkdpvJFKt5bd5hy6LiJ01NqEI5ohQlGGK4 VZoPrzEX5jGOqUaBINmabdtwxLXARf+Wp6M6pF/VU3j0eJX4etnFXY1lIYhgeqJfPIfd k0tinWvk9mFkauBrWfTTqdxoTqefknXlSkaaspQU6U3C/+2tJQsjK7MZO1Im907scP9Y +5gFDFEgfQ0dEKlRXvO9qt7CNqiMy4neaJR9eJL41A/RP4ai656wizXAJunqfFEw7ClD TIXWkMB2a6nEq5muD/EUBx6X8+3aiQOKcKCGxeJ5oavllq/HffwkbcUzOGIheV4M2aEp C2HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=EQq/SFRYOcYBKRcm4VFLldysGy5gKplMqhOHmQevMpU=; b=F0+Iq7mOcfcEDOAqJ3F+nUq4v5B0kCalKOi2ftQv3HlZSmT9nG6Hvv2FP9edHDVkiU lOvuGG2sMHo1csZUKg8PZ2VEMIdNdCLLI/X3ynmOSy7pMUBbsdMBhNdHpwpAq4cCqAdU YaBHz/hxi7ftRgNotuHARzeO4kVI3sg8zTWbEtQn9S+kuEgtzEX08M6p5LdaEtbl621e wh+xDjv7yTq9iYAebmIEirzfDtPPFUr3avivrrwNUghtVpL5+R39+nPXvSQs/y13G9BU 18t9Bn2tSnkQw6/PTFCK20ClvK1YcEOkJqy5Lhi6fK6oIgOmG+sU3SV1WAmD59ha2UEO 1nuw== X-Gm-Message-State: AKS2vOyDLfduLz+yPDlkp9s/bW1LzMf7XBRh88kM/Ll4fvbUo6eQIJ5z e3j6suSkzj3PI3JciVE= X-Received: by 10.223.141.146 with SMTP id o18mr33828710wrb.110.1499166762627; Tue, 04 Jul 2017 04:12:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:04 +0200 Message-Id: <1499166735-39360-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH 11/22] 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong If tcg is disabled, the functions in tcg-stub.c file will be called. This file is target-independent file, do not include any platform related stub functions into this file. Signed-off-by: Yang Zhong Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- accel/stubs/Makefile.objs | 1 + accel/stubs/tcg-stub.c | 22 ++++++++++++++++++++++ 2 files changed, 23 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..5dd480b --- /dev/null +++ b/accel/stubs/tcg-stub.c @@ -0,0 +1,22 @@ +/* + * 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" + +void tb_flush(CPUState *cpu) +{ +} --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167745709796.343502666015; Tue, 4 Jul 2017 04:29:05 -0700 (PDT) Received: from localhost ([::1]:40547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSM0s-0005XG-Cn for importer@patchew.org; Tue, 04 Jul 2017 07:29:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlB-0006lO-4D for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLl7-0001v4-Qj for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:49 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:34424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLl7-0001uq-Jp for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:45 -0400 Received: by mail-wr0-x244.google.com with SMTP id k67so46853171wrc.1 for ; Tue, 04 Jul 2017 04:12:45 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=MXBqaoNb9QmgtI4rOflxayBmtHf/+RIjwOpLRivnCSs=; b=cfzE4VI1hcZ90DsRqXpbfTYnmKK0GuF/SP03pGnAlOLDg3EKfYgIX1C8JDrD1EvCxU t1872fWTsdsJhDkUoxK4SO89zzAWWYcv+7ZGi1cBikXunQWhVdPOFQt4ApQ3H1RTcuUX y25PqUQj+y1ed9oDXKP9Y3k1M8lpm1Dn7bZG49Xyume3VynKBe46vQMv9LRz8aaGdtTe y83Cn0Vkxau9kkK1FUiPa0Fm1lHBOK4uAQ+Cfr4yTL8ANJ7/4Ggz94mRlFC+MtB/+TNs 7uvcI8B/G5gGAMDNJQ+07vr5PgIvIqvfBlYut21NyVcevnTWZxiuucAOrRWfQ/VL1nHD PCvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=MXBqaoNb9QmgtI4rOflxayBmtHf/+RIjwOpLRivnCSs=; b=i0RW+I9Qrmtqgg2Rf4pJgdFfjixr3A9Th/PmHKutHKeLGc10iVnckxKXVzP8x4859s rG4U4VJ+d2lEgsgMS4zM8uk43tls7K8sliss8cjCZugoipzgci+XhKa8ZT+kdINZs3gU hHS8CafeznMrU6tRn5P+nWjEBOTJOV2tOlOEAVrGSeHX3i99sE/Mvk8Akvl/1X0MN2Gq MBG538IyLKf2Biwf9ExcDeSwaThStG7wFd+naG0xc7PcXmACrYMcDREfUnubVtzW7Omy nVWZQv9ETil8mC9HovL5mIhAv0pQDmA9cFTZ1rneFOXVpfemk3o8kuQschsd10+RC1ch TFRQ== X-Gm-Message-State: AKS2vOy5WG4pzoS3x8Ge9G4wqCJK0dK02QHn+/4/YyKx838k6KzcBsQ0 VrZrWQjolATKAF2xrbI= X-Received: by 10.223.136.116 with SMTP id e49mr37573024wre.14.1499166764345; Tue, 04 Jul 2017 04:12:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:05 +0200 Message-Id: <1499166735-39360-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH 12/22] tcg: move tb_lock out of translate-all.h 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- bsd-user/main.c | 1 - include/exec/exec-all.h | 4 ++++ tcg/tcg.h | 4 ---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 04f95dd..fa9c012 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -25,7 +25,6 @@ #include "qemu/config-file.h" #include "qemu/path.h" #include "qemu/help_option.h" -/* For tb_lock */ #include "cpu.h" #include "exec/exec-all.h" #include "tcg.h" diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 724ec73..0b56432 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -467,6 +467,10 @@ extern uintptr_t tci_tb_ptr; smaller than 4 bytes, so we don't worry about special-casing this. */ #define GETPC_ADJ 2 =20 +void tb_lock(void); +void tb_unlock(void); +void tb_lock_reset(void); + #if !defined(CONFIG_USER_ONLY) =20 struct MemoryRegion *iotlb_to_region(CPUState *cpu, diff --git a/tcg/tcg.h b/tcg/tcg.h index 9e37722..da78721 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -757,10 +757,6 @@ void *tcg_malloc_internal(TCGContext *s, int size); void tcg_pool_reset(TCGContext *s); TranslationBlock *tcg_tb_alloc(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) { --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 149916723022534.24758964595242; Tue, 4 Jul 2017 04:20:30 -0700 (PDT) Received: from localhost ([::1]:40493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLsY-0004gI-DS for importer@patchew.org; Tue, 04 Jul 2017 07:20:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlB-0006lh-E7 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlA-0001w3-Hn for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:49 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:35234) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlA-0001vj-BB for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:48 -0400 Received: by mail-wr0-x241.google.com with SMTP id z45so47110826wrb.2 for ; Tue, 04 Jul 2017 04:12:48 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=vH4u64K9okTGKoyroxUyO9PmGR3YQQB1xU5FIy91JE4=; b=JDNaFRf5iIhbFq3zPGmZQY6cpOQQisi3HN3J3SVK70dTzM5o04Zs+OdWMtUuS3w0ut bQpzx/5fB05xNLzYG+7KdBzJV3wtE1ETsHzxKiPnvCiPdrIkdV2Y7dJFDEB7gm2aLS5y XpudraGpuahAhroAjydTN0JB8yt593Qs0c5NxvFqp6ZbQgKN4QkRCQgPx1mzt6q6hOt4 /nIa11YN7QZeswJX3ef4GSjhJjT1eoQ7lZx4+GCSpr5d9vW+hrOkfobbBSwh2R7ANQcG pJRJPZ6w0gSFqAxSuTvoyutbYAGgnHmF1YVM/NPRHlXT2sKevB+HJmkArzTQjLLvn6Wj VmKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=vH4u64K9okTGKoyroxUyO9PmGR3YQQB1xU5FIy91JE4=; b=WJj51f4J9Nek6RRdDoeB3CHSWA41qmrLYWOczr0R6dMpSyFo850kEkqiKV2CyNvXLB 2HRPvaGoPUF/S85IZzfeMh4MZJVAVfNm8sTAB7f1lUCzXxCes2KElXrL3qgDMA2lstjB n53TE+jQsyurupwm0SqTh2k5fkvmhdlVNPr6388eVZo84kKeio9v8N7AWWvV38XJ+SC1 jZId/lyp37D3tSz0/Wa8AKOm3wQLeDn/ZOljPkyT12Z/x9qppTAqJoPGQAojJUVSsmFq YwAd7AvlOMSDUUn4EONOMFFq6mrFOZdfRUXB1SW1m1y500ARiNhyGs3c9zZ8uluEN7Y4 FDUQ== X-Gm-Message-State: AKS2vOxqkr9cLl6x4omBzzy99/bZzVeOaNn5I/uiV9srUZGyRAai59d/ GImJ/Kh5N3c/1jdOPcU= X-Received: by 10.223.160.174 with SMTP id m43mr28013811wrm.194.1499166767242; Tue, 04 Jul 2017 04:12:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:06 +0200 Message-Id: <1499166735-39360-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH 13/22] exec: elide calls to tb_lock and tb_unlock 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Adding assertions fixes link errors. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exec.c b/exec.c index ee61915..a083ff8 100644 --- a/exec.c +++ b/exec.c @@ -2317,6 +2317,7 @@ static void notdirty_mem_write(void *opaque, hwaddr r= am_addr, { bool locked =3D false; =20 + assert(tcg_enabled()); if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) { locked =3D true; tb_lock(); @@ -2375,6 +2376,7 @@ static void check_watchpoint(int offset, int len, Mem= TxAttrs attrs, int flags) CPUWatchpoint *wp; uint32_t cpu_flags; =20 + assert(tcg_enabled()); if (cpu->watchpoint_hit) { /* We re-entered the check after replacing the TB. Now raise * the debug interrupt so that is will trigger after the @@ -2820,6 +2822,7 @@ static void invalidate_and_set_dirty(MemoryRegion *mr= , hwaddr addr, cpu_physical_memory_range_includes_clean(addr, length, dirty_l= og_mask); } if (dirty_log_mask & (1 << DIRTY_MEMORY_CODE)) { + assert(tcg_enabled()); tb_lock(); tb_invalidate_phys_range(addr, addr + length); tb_unlock(); --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167023390815.3385050719453; Tue, 4 Jul 2017 04:17:03 -0700 (PDT) Received: from localhost ([::1]:40483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLpE-0001ok-W5 for importer@patchew.org; Tue, 04 Jul 2017 07:17:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlD-0006nn-GC for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlC-0001wq-Ak for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:51 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlC-0001wT-1U for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:50 -0400 Received: by mail-wr0-x242.google.com with SMTP id x23so47044496wrb.0 for ; Tue, 04 Jul 2017 04:12:50 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=E16+zcIDQIs+ns5D+7Cg3PbDsgc3AN6uVCj6IopoLbw=; b=t6RSIa9OWpQJX2SfUPd6UkX6xa3JNww9HiTumAg6GdjcL7JUKrKtieb59oA2XuvPY1 ej+VrqI6bJMjXYrIRCxQ6j/f+1ya+g2lrSojQBMj0zuYw8bREGW2GVmi1xasIjzX3grs 9aVLBQ4evV4UbBz6e+5g9Bzx+9IO07D2wfY7EY+A55uQZKYB7fDkfw2oyeoTV0xILNHJ O+9Cstx5S2v/zb5uRbC2Uw+ZThRUxXiLDNobCbYSAXbFDoXX+r9DwKsrGOZ7B4zP50iC kNovj2yO0E08gA8ypfwdqIgjFJ5sIZQm60sKE4EgjalRhzEftkof3wTsE6Cwkmo43ww+ Cd0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=E16+zcIDQIs+ns5D+7Cg3PbDsgc3AN6uVCj6IopoLbw=; b=aobPzSCf3IIPszz6J+A5SdbwQmDdAPO6f2IwcRYM5rrJg3gK0Z1d4WgCqDvSFXPJhR 9AZfLd4axuelPfNxWenTsED7BebXUjFUp9lv2J5wGxUnxp4LKnVxLd6v2HCkzyYHra6/ RTqoHchBiuZ1iD+PNJ57AGyfFiAiPzz3UKiReMU1Gqg3knTTs1AFfz8pitrMsVxq/gia JfRYmwKGLz8IvdGgIkkhVAtzDBTMT6ti8fxBlWXzmCI1dsZDOGFyOrUBNy5X2r41lojI MirF8T5SygTZ7f3ob7lZ2hvn1Q3WtXYcUVHQ5/4kn3cToSlNgatiO2qfXKYt0Mu5nzPu Arog== X-Gm-Message-State: AKS2vOym5NMzyCHaT3a82kEMSu2JnBdCAirFEag4zuIXfdrcnfaq7NgE tpOr/k/D5p2CaVoE+C4= X-Received: by 10.223.131.66 with SMTP id 60mr37070668wrd.54.1499166768785; Tue, 04 Jul 2017 04:12:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:07 +0200 Message-Id: <1499166735-39360-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH 14/22] tcg: add CONFIG_TCG guards in headers 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- v2: do not touch include/exec/helper-proto.h [Richard] include/exec/cpu-defs.h | 4 +++- include/exec/cputlb.h | 2 +- include/exec/exec-all.h | 53 ++++++++++++++++++++++++++-------------------= ---- 3 files changed, 32 insertions(+), 27 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/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 0b56432..2f924f2 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() --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167187486637.6836699994881; Tue, 4 Jul 2017 04:19:47 -0700 (PDT) Received: from localhost ([::1]:40491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLrq-00047t-H8 for importer@patchew.org; Tue, 04 Jul 2017 07:19:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlF-0006pm-Cp for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlE-0001xm-Ak for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:53 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlE-0001xJ-3m for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:52 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so25530346wmh.3 for ; Tue, 04 Jul 2017 04:12:52 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=anTB+p02QRV6Pdjv2ESR0bx0rhD3qa0Zm4SfdUlv98g=; b=KDRTvqDI2Oa6YH2jIeQLT+FU6yZDRglS450yUt4cTFDkHcziHoPiLhLoDyOCrUvUBB H71m1pR7vyoKaDZrd5E4uRPspjMgxHyudHCUADEtvgfzrVDI3TuKiojNHx7Mzknl2lib NLFy4Waz+pkrCzNl973eAm9KYisAECGEXDjEoE2j/TM3q0kKX1/5qQyT+oyuspXjpHv7 ZhiR34cvgVgdIh179UEuiKNQY/nEVymaH9+eyBJC4yMW8xS6IfMmypNk05pbxGo/EYK1 ja1ZZAYyvUMi1GenCYkY7tTnkaAoxn42YceEO6a6i6V5YHH9hrerg7DjIq6JtIX1MqNp M/6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=anTB+p02QRV6Pdjv2ESR0bx0rhD3qa0Zm4SfdUlv98g=; b=CCYlyERaFy55LRYKi7vfpqbdECmvnw4voMX7dEiA5vrkHSn+tfLPHrzq8+eHfQunDe ljROfA9FLVStDb/jWuBIf9DbnDlo0kYoQ9RxtNltbfRO86UO9kddhe4GWIzajsPi/vW1 pFTLC282JMPtQnJYODRgSgdXeMgKWcEilibIUSAPxHJS4FMbdGkZelt+Gff6g/eRrMlr jrNXdkAqL1j9Mezp+4gw4Ctm3qnJ9WlIWZTuHAjGV1tdK7VhPIN14wrKXzTvD8FJLAuS 5G9P1gdBRgqK1fAE1cAO4NMQch2kO4DcMTQfmiBErEsc8dWXuwmCft5S6crsTZoUZtMm CkvA== X-Gm-Message-State: AKS2vOznL/1r5XqJm50mqBIk/ylWsoaHkqJHfZ2WqrXb/QEr57SKLlhG t9a1vC9UIiQFdWjZdvg= X-Received: by 10.28.113.85 with SMTP id m82mr29039289wmc.21.1499166770073; Tue, 04 Jul 2017 04:12:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:08 +0200 Message-Id: <1499166735-39360-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 15/22] 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add the CONFIG_TCG for frontend and backend's files in the related Makefiles. Signed-off-by: Yang Zhong Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- Makefile.target | 4 ++-- accel/Makefile.objs | 2 +- 2 files changed, 3 insertions(+), 3 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/ --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167384226934.4862174589234; Tue, 4 Jul 2017 04:23:04 -0700 (PDT) Received: from localhost ([::1]:40506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLv3-0006yD-O1 for importer@patchew.org; Tue, 04 Jul 2017 07:23:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlF-0006qw-Ko for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlE-0001y1-Mc for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:53 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:34430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlE-0001xS-Fo for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:52 -0400 Received: by mail-wr0-x244.google.com with SMTP id k67so46853472wrc.1 for ; Tue, 04 Jul 2017 04:12:52 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SFXDsECTmpwkzuhWcwQXdZUZPLn/iKBlFgf19Hu7fFM=; b=ApvNOzgeW2R22Cwe5RSovp241+3vZlg15LH1W3WO8/cwGdWYyp7YlkmrACWWt9YoMl TAvut7RWoGGkv5MsyB9WTulPFdxQoDR6dHgzuUjW10in8qDlWaz7tj+FgShd0z08vPOu /rfudrql3q1+oV5t6lGC4sOzyyJVUjdtAr/TcJ+6wa1Ai0qIqXiGlsoz9Xyoc3lZkZdZ OY8HYMnCmUpKRHkFhF2MCnD3oG6O0OgxjntZsrI2vm6jntd1dm1v9njCi7OxoD+dkOtw uzBf6ryBaGdOYQFR9lWqemLpahRFmUFhTRDA7tWAcIY3Z/FIb3rRKcUtgbw0NlpJ5q3Z z9pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=SFXDsECTmpwkzuhWcwQXdZUZPLn/iKBlFgf19Hu7fFM=; b=LwAF0g8aacZtYCZU4GqU+T6SbZf0t7YcNcZt3IOWJJTs8qc5qMKu1+Q1Fqq5r5ATs/ FJxtpCCliy7oYcTFI7n9c/9GPP2FHMbYX5+IF8h0g6BYQ4vLLM9xrr9ZgR3NiMX7gx0x wwI8rqayGU0PX5lsz41Fwz4Fmn7ZR5lpp64E8NMkR8YteqyNC8HYwNttaaq5OCLBGZaB kmKpufB6Q+O2CIu1YyHaxUAXKtsHDxGgJbv2GNSJaHkK7dY/fc43wIX/6MUkQUJFfRQ2 JG9U+yG1MaSuCs8tkoOn4+Vky4jsaCPE4OpyoMLY0TQVtkkwdYAj1yy/sy00F0sxOJyz Cf4Q== X-Gm-Message-State: AKS2vOzFQurHfMhzrH/Py1DAOphYk24kZAjx++QfC9QTjoviTItHhQ55 blDLVDMJ1VOAum3zjCg= X-Received: by 10.223.176.164 with SMTP id i33mr33121612wra.165.1499166771383; Tue, 04 Jul 2017 04:12:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:09 +0200 Message-Id: <1499166735-39360-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH 16/22] target/i386: 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- v2: moved cpu_report_tpr_access hunk later [Richard] target/i386/helper.c | 30 ++++++++++++++++++++++++++++++ target/i386/mpx_helper.c | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index ef05059..4d584b5 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; 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.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167873608832.5619632658653; Tue, 4 Jul 2017 04:31:13 -0700 (PDT) Received: from localhost ([::1]:40562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSM2u-0007gZ-DK for importer@patchew.org; Tue, 04 Jul 2017 07:31:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlK-0006v9-Ft for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlG-000202-9I for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:55 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlG-0001yV-2A for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:54 -0400 Received: by mail-wr0-x244.google.com with SMTP id x23so47044695wrb.0 for ; Tue, 04 Jul 2017 04:12:54 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zX2IbYSjU6uqrXI9Nro5isn+oL2UhpTanO7rZC6CSSo=; b=DNJPa1QwJr+wwtEs2lHbSe8Lq532LU7IbgxUfCe7Icx6dOBc62E6BAI46fF+nq+509 5Nx9uf/COlyRf38kLvJ+uChmGxO8qio74mXQcKpE8rJU9FZTmFo09YNywG8VF/hrUdG2 TeL3/dQ6VRE6MCoxCyua/oR2by/ZKLg8REsQdAm2PlZ2CKc1lM+UibA75lr1sIQ7U0zs sE691Vqp/T9mnwmxM4b6WtNSrSZX2Thflwu3HnzyDtPY7C2LnFyUkKgX/pLQv+r8ZxBh pwUzyZUpwurT2X53MPqrZuf1+dzkNhOVXiTRbQzgSwBRrYpKz73mB4YOfkhdTfFYkQat WLVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=zX2IbYSjU6uqrXI9Nro5isn+oL2UhpTanO7rZC6CSSo=; b=KqVX3AOvrCchFF1XUBiufxcva3iB5TD9fRU1lnuA6StS2tMAN5ioF85S5YdsABIfHJ s3LGh9cUjd2nyu4d47ErDfKEapgspcMvJpTATorZ6UoD0FPYTkfGELcyYdcqAQFCuc0Z Fs1Pq8IloW2Uq/fFENROtfic3zzlC+XNy394rA6uLaNTi17CUUk1mTcG0lpmJfPNBen4 NBCtp1mHakRFMnZmV6QD2oXpdW1NFIk+5cLcyQT9XTay5NHhMboRrchG0TksYfhB6zVt OdV625ushrOfyr8S+6miRJ5LG1kR8sIdzSAq+5ClAXKSRG09xbvswVgqL5oaou7oGxWC kGEQ== X-Gm-Message-State: AKS2vOwh2kX3tveWjoFwf7N6c84s1eEjsI/mHX/lpUoub/sZNusFDWx4 24MST1AzkTLUzlCblr4= X-Received: by 10.223.130.36 with SMTP id 33mr39610463wrb.111.1499166772905; Tue, 04 Jul 2017 04:12:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:10 +0200 Message-Id: <1499166735-39360-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH 17/22] target/i386: 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong 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 Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- 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.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167631758128.4117449548345; Tue, 4 Jul 2017 04:27:11 -0700 (PDT) Received: from localhost ([::1]:40531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLz2-0003OA-CX for importer@patchew.org; Tue, 04 Jul 2017 07:27:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlP-00070K-L4 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlK-00021P-04 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:03 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlJ-00020J-P9 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:57 -0400 Received: by mail-wm0-x241.google.com with SMTP id j85so25562062wmj.0 for ; Tue, 04 Jul 2017 04:12:55 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8s6VzJEQM7UmeRSsAjHmfmz1/ccaSacn9TPCXiYy+B4=; b=mxZlMbiPusEWhhLsUVDSSBNf+gclHT8hQsSmSsrkuMi1c49NN/zvaoJvKXa54++sdn hv3PgBVoVJF0lh5hmAVmdYRO8sWoSD8+pSoM7G3WQmGgqB9QmiLdER+OCxS/c+kJdmN7 IhES+Yv3rPA+HgNgwWm2A3Ltq4dCRO1KHqKTk8eVcRUHbxFWaQFYdWpETCUE0mQrzj5d 7gyPQO3ppKhAOCXxWtA6TQd0YfpdS4nqn4aeCDWC8Xp6vRi+xyW1oF9dh+DBfWC23v8e UAHkn18LatbpIEsQiMphPBSEhbmt5ck827guD0ZTr9poy4S+OaCDxHDCTzlZyOdCTZmB KQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8s6VzJEQM7UmeRSsAjHmfmz1/ccaSacn9TPCXiYy+B4=; b=kqV3HmnCZNwswE19Q3YL9LePlr7o2RhJNUNGdp4SupY2g+T6OL+UriN7AXcE+xPeon ITKV7yP0Ekdtr/MNmOFRUApZPl2yXvDSVcBWyJsXOnrVY/h9zSwlSAdMQdAH6YEL0bh7 X94meQNm8sntHL+28NF311GnMwCL5R15tnjCd5fT3nQNXFXwUz+qZ4ZEurdxeEn0etmT oi1izHPYMqLO8W5M8BblQdOMaJSb2740pWef41pkvnseet3MxCGRxif8PEAXHmVu1uOl BIVHMKNoZfj1+hE8IxQTCo9ix0UV8uw4kSlXqdQt53DXi1F2vio/07L2izC84RfxXdyX Oxbw== X-Gm-Message-State: AKS2vOzPbzvtGjIX4WROp13HbILPa8QMEGPgHWfHWRFl072DrwnnLbj0 NKgluJj20qpXJ062T3s= X-Received: by 10.28.134.11 with SMTP id i11mr27416445wmd.77.1499166774295; Tue, 04 Jul 2017 04:12:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:11 +0200 Message-Id: <1499166735-39360-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 18/22] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Split the cpu_set_mxcsr() and make cpu_set_fpuc() inline with specific tcg code. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- v2: renamed tcg_update_mxcsr [Richard], added missing call to cpu_post_load target/i386/cpu.h | 21 ++++++++++++++++++--- target/i386/fpu_helper.c | 11 ++--------- target/i386/machine.c | 5 ++++- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8b3b535..66a363f 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1594,7 +1594,6 @@ void QEMU_NORETURN raise_interrupt(CPUX86State *nenv,= int intno, int is_int, /* cc_helper.c */ extern const uint8_t parity_table[256]; uint32_t cpu_cc_compute_all(CPUX86State *env1, int op); -void update_fp_status(CPUX86State *env); =20 static inline uint32_t cpu_compute_eflags(CPUX86State *env) { @@ -1643,8 +1642,24 @@ 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 update_fp_status(CPUX86State *env); +void update_mxcsr_status(CPUX86State *env); + +static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +{ + env->mxcsr =3D mxcsr; + if (tcg_enabled()) { + update_mxcsr_status(env); + } +} + +static inline void cpu_set_fpuc(CPUX86State *env, uint16_t fpuc) +{ + env->fpuc =3D fpuc; + if (tcg_enabled()) { + update_fp_status(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..9014b6f 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 update_mxcsr_status(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,12 +1580,6 @@ 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) -{ - env->fpuc =3D val; - update_fp_status(env); -} - void helper_ldmxcsr(CPUX86State *env, uint32_t val) { cpu_set_mxcsr(env, val); diff --git a/target/i386/machine.c b/target/i386/machine.c index 53587ae..e0417fe 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -280,7 +280,10 @@ static int cpu_post_load(void *opaque, int version_id) for(i =3D 0; i < 8; i++) { env->fptags[i] =3D (env->fptag_vmstate >> i) & 1; } - update_fp_status(env); + if (tcg_enabled()) { + update_fp_status(env); + update_mxcsr_status(env); + } =20 cpu_breakpoint_remove_all(cs, BP_CPU); cpu_watchpoint_remove_all(cs, BP_CPU); --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167755813694.6375322134937; Tue, 4 Jul 2017 04:29:15 -0700 (PDT) Received: from localhost ([::1]:40548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSM12-0005kP-Do for importer@patchew.org; Tue, 04 Jul 2017 07:29:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlP-0006zk-1Z for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlK-00021z-PY for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:02 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlK-00021B-Co for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:58 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so25562283wmj.0 for ; Tue, 04 Jul 2017 04:12:57 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=RX6e9DckQclg2+un2Oq8DuxKfHVAGVzASfdkP7hUg6M=; b=e+8AptrmPnc2T1A01oDeIt1vqOmZWKgjHDZqEyE3/WA+qJDzPqw8RczytIXGqFXTrj pxxLoeNorlmMOqTUb2sC2OZpDoexEy/Hr1TLz3/CB432b2ho08icZxnrHz5M0OODS3+0 yKZqgnd9LA1xiFAZZgR7Q/Iz9oMaUzhHAZ2/rbA1voQZ2+PQLYqY4TEpQ6SNOg/WxopO VDjgRxfNAJx28Z/ZppcMHriinDJ5/cC3ZUWieOhgZFem33a0qo3tf1w+a/g64+eXdN8v uOoIggppFvGf1Q7RZ+Pa6hxCvRtJZGb8HKxpLdaTL8Akb4/EKJtg7k2v7dnowi2NCmRP BaBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=RX6e9DckQclg2+un2Oq8DuxKfHVAGVzASfdkP7hUg6M=; b=pEFTith50lIULU2X9SUpKF3mcSdPp586GbT2LM0hCOg+7PgPQQRfbaRWkuWou67bV2 tHUB7ACiM5Oll9b5h+XNzd0VENPMJ6aPGxb79loVQNG3GU+V1f1qRa52VTGzV6jE+F1J iY6smVXprQt8LqvcFFiR7aNnqh86/d9bO0uU0KjKiOaVYigWnjUknKpDhHF1XcMlyR8S b6D1SQNHBwInh/P2z1LbbWql7g2xu0RC5XcLncBEGHiS+OxffrrVGKkHiLXKWlWm7Pt0 TFKHhAO/tJneIJoXYz1yaBzFmrWHVbOZjvfzOyN4iZrCB9cWjGdKkXO8mPVzM5XTwpFA 9YxA== X-Gm-Message-State: AKS2vOyJBjTkdIzfGSbmd9Yar0bxHlKpfNigXUQWneiOQLBXRRACgymJ wxArOyPfZsBEp2m7qaE= X-Received: by 10.28.152.14 with SMTP id a14mr27139013wme.35.1499166776443; Tue, 04 Jul 2017 04:12:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:12 +0200 Message-Id: <1499166735-39360-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 19/22] target/i386: move TLB refill function out of helper.c 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This function calls tlb_set_page_with_attrs, which is not available when TCG is disabled. Move it to excp_helper.c. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/excp_helper.c | 343 ++++++++++++++++++++++++++++++++++++++++++= +++ target/i386/helper.c | 344 +-----------------------------------------= ---- 2 files changed, 344 insertions(+), 343 deletions(-) diff --git a/target/i386/excp_helper.c b/target/i386/excp_helper.c index b769772..cef4449 100644 --- a/target/i386/excp_helper.c +++ b/target/i386/excp_helper.c @@ -136,3 +136,346 @@ void raise_exception_ra(CPUX86State *env, int excepti= on_index, uintptr_t retaddr { raise_interrupt2(env, exception_index, 0, 0, 0, retaddr); } + +#if defined(CONFIG_USER_ONLY) +int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, + int is_write, int mmu_idx) +{ + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; + + /* user mode only emulation */ + is_write &=3D 1; + env->cr[2] =3D addr; + env->error_code =3D (is_write << PG_ERROR_W_BIT); + env->error_code |=3D PG_ERROR_U_MASK; + cs->exception_index =3D EXCP0E_PAGE; + env->exception_is_int =3D 0; + env->exception_next_eip =3D -1; + return 1; +} + +#else + +/* return value: + * -1 =3D cannot handle fault + * 0 =3D nothing more to do + * 1 =3D generate PF fault + */ +int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, + int is_write1, int mmu_idx) +{ + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; + uint64_t ptep, pte; + int32_t a20_mask; + target_ulong pde_addr, pte_addr; + int error_code =3D 0; + int is_dirty, prot, page_size, is_write, is_user; + hwaddr paddr; + uint64_t rsvd_mask =3D PG_HI_RSVD_MASK; + uint32_t page_offset; + target_ulong vaddr; + + is_user =3D mmu_idx =3D=3D MMU_USER_IDX; +#if defined(DEBUG_MMU) + printf("MMU fault: addr=3D%" VADDR_PRIx " w=3D%d u=3D%d eip=3D" TARGET= _FMT_lx "\n", + addr, is_write1, is_user, env->eip); +#endif + is_write =3D is_write1 & 1; + + a20_mask =3D x86_get_a20_mask(env); + if (!(env->cr[0] & CR0_PG_MASK)) { + pte =3D addr; +#ifdef TARGET_X86_64 + if (!(env->hflags & HF_LMA_MASK)) { + /* Without long mode we can only address 32bits in real mode */ + pte =3D (uint32_t)pte; + } +#endif + prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + page_size =3D 4096; + goto do_mapping; + } + + if (!(env->efer & MSR_EFER_NXE)) { + rsvd_mask |=3D PG_NX_MASK; + } + + if (env->cr[4] & CR4_PAE_MASK) { + uint64_t pde, pdpe; + target_ulong pdpe_addr; + +#ifdef TARGET_X86_64 + if (env->hflags & HF_LMA_MASK) { + bool la57 =3D env->cr[4] & CR4_LA57_MASK; + uint64_t pml5e_addr, pml5e; + uint64_t pml4e_addr, pml4e; + int32_t sext; + + /* test virtual address sign extension */ + sext =3D la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47; + if (sext !=3D 0 && sext !=3D -1) { + env->error_code =3D 0; + cs->exception_index =3D EXCP0D_GPF; + return 1; + } + + if (la57) { + pml5e_addr =3D ((env->cr[3] & ~0xfff) + + (((addr >> 48) & 0x1ff) << 3)) & a20_mask; + pml5e =3D x86_ldq_phys(cs, pml5e_addr); + if (!(pml5e & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pml5e & (rsvd_mask | PG_PSE_MASK)) { + goto do_fault_rsvd; + } + if (!(pml5e & PG_ACCESSED_MASK)) { + pml5e |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pml5e_addr, pml5e); + } + ptep =3D pml5e ^ PG_NX_MASK; + } else { + pml5e =3D env->cr[3]; + ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; + } + + pml4e_addr =3D ((pml5e & PG_ADDRESS_MASK) + + (((addr >> 39) & 0x1ff) << 3)) & a20_mask; + pml4e =3D x86_ldq_phys(cs, pml4e_addr); + if (!(pml4e & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pml4e & (rsvd_mask | PG_PSE_MASK)) { + goto do_fault_rsvd; + } + if (!(pml4e & PG_ACCESSED_MASK)) { + pml4e |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pml4e_addr, pml4e); + } + ptep &=3D pml4e ^ PG_NX_MASK; + pdpe_addr =3D ((pml4e & PG_ADDRESS_MASK) + (((addr >> 30) & 0x= 1ff) << 3)) & + a20_mask; + pdpe =3D x86_ldq_phys(cs, pdpe_addr); + if (!(pdpe & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pdpe & rsvd_mask) { + goto do_fault_rsvd; + } + ptep &=3D pdpe ^ PG_NX_MASK; + if (!(pdpe & PG_ACCESSED_MASK)) { + pdpe |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pdpe_addr, pdpe); + } + if (pdpe & PG_PSE_MASK) { + /* 1 GB page */ + page_size =3D 1024 * 1024 * 1024; + pte_addr =3D pdpe_addr; + pte =3D pdpe; + goto do_check_protect; + } + } else +#endif + { + /* XXX: load them when cr3 is loaded ? */ + pdpe_addr =3D ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & + a20_mask; + pdpe =3D x86_ldq_phys(cs, pdpe_addr); + if (!(pdpe & PG_PRESENT_MASK)) { + goto do_fault; + } + rsvd_mask |=3D PG_HI_USER_MASK; + if (pdpe & (rsvd_mask | PG_NX_MASK)) { + goto do_fault_rsvd; + } + ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; + } + + pde_addr =3D ((pdpe & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) <= < 3)) & + a20_mask; + pde =3D x86_ldq_phys(cs, pde_addr); + if (!(pde & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pde & rsvd_mask) { + goto do_fault_rsvd; + } + ptep &=3D pde ^ PG_NX_MASK; + if (pde & PG_PSE_MASK) { + /* 2 MB page */ + page_size =3D 2048 * 1024; + pte_addr =3D pde_addr; + pte =3D pde; + goto do_check_protect; + } + /* 4 KB page */ + if (!(pde & PG_ACCESSED_MASK)) { + pde |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pde_addr, pde); + } + pte_addr =3D ((pde & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) <<= 3)) & + a20_mask; + pte =3D x86_ldq_phys(cs, pte_addr); + if (!(pte & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pte & rsvd_mask) { + goto do_fault_rsvd; + } + /* combine pde and pte nx, user and rw protections */ + ptep &=3D pte ^ PG_NX_MASK; + page_size =3D 4096; + } else { + uint32_t pde; + + /* page directory entry */ + pde_addr =3D ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & + a20_mask; + pde =3D x86_ldl_phys(cs, pde_addr); + if (!(pde & PG_PRESENT_MASK)) { + goto do_fault; + } + ptep =3D pde | PG_NX_MASK; + + /* if PSE bit is set, then we use a 4MB page */ + if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { + page_size =3D 4096 * 1024; + pte_addr =3D pde_addr; + + /* Bits 20-13 provide bits 39-32 of the address, bit 21 is res= erved. + * Leave bits 20-13 in place for setting accessed/dirty bits b= elow. + */ + pte =3D pde | ((pde & 0x1fe000LL) << (32 - 13)); + rsvd_mask =3D 0x200000; + goto do_check_protect_pse36; + } + + if (!(pde & PG_ACCESSED_MASK)) { + pde |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pde_addr, pde); + } + + /* page directory entry */ + pte_addr =3D ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & + a20_mask; + pte =3D x86_ldl_phys(cs, pte_addr); + if (!(pte & PG_PRESENT_MASK)) { + goto do_fault; + } + /* combine pde and pte user and rw protections */ + ptep &=3D pte | PG_NX_MASK; + page_size =3D 4096; + rsvd_mask =3D 0; + } + +do_check_protect: + rsvd_mask |=3D (page_size - 1) & PG_ADDRESS_MASK & ~PG_PSE_PAT_MASK; +do_check_protect_pse36: + if (pte & rsvd_mask) { + goto do_fault_rsvd; + } + ptep ^=3D PG_NX_MASK; + + /* can the page can be put in the TLB? prot will tell us */ + if (is_user && !(ptep & PG_USER_MASK)) { + goto do_fault_protect; + } + + prot =3D 0; + if (mmu_idx !=3D MMU_KSMAP_IDX || !(ptep & PG_USER_MASK)) { + prot |=3D PAGE_READ; + if ((ptep & PG_RW_MASK) || (!is_user && !(env->cr[0] & CR0_WP_MASK= ))) { + prot |=3D PAGE_WRITE; + } + } + if (!(ptep & PG_NX_MASK) && + (mmu_idx =3D=3D MMU_USER_IDX || + !((env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)))) { + prot |=3D PAGE_EXEC; + } + if ((env->cr[4] & CR4_PKE_MASK) && (env->hflags & HF_LMA_MASK) && + (ptep & PG_USER_MASK) && env->pkru) { + uint32_t pk =3D (pte & PG_PKRU_MASK) >> PG_PKRU_BIT; + uint32_t pkru_ad =3D (env->pkru >> pk * 2) & 1; + uint32_t pkru_wd =3D (env->pkru >> pk * 2) & 2; + uint32_t pkru_prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + + if (pkru_ad) { + pkru_prot &=3D ~(PAGE_READ | PAGE_WRITE); + } else if (pkru_wd && (is_user || env->cr[0] & CR0_WP_MASK)) { + pkru_prot &=3D ~PAGE_WRITE; + } + + prot &=3D pkru_prot; + if ((pkru_prot & (1 << is_write1)) =3D=3D 0) { + assert(is_write1 !=3D 2); + error_code |=3D PG_ERROR_PK_MASK; + goto do_fault_protect; + } + } + + if ((prot & (1 << is_write1)) =3D=3D 0) { + goto do_fault_protect; + } + + /* yes, it can! */ + is_dirty =3D is_write && !(pte & PG_DIRTY_MASK); + if (!(pte & PG_ACCESSED_MASK) || is_dirty) { + pte |=3D PG_ACCESSED_MASK; + if (is_dirty) { + pte |=3D PG_DIRTY_MASK; + } + x86_stl_phys_notdirty(cs, pte_addr, pte); + } + + if (!(pte & PG_DIRTY_MASK)) { + /* only set write access if already dirty... otherwise wait + for dirty access */ + assert(!is_write); + prot &=3D ~PAGE_WRITE; + } + + do_mapping: + pte =3D pte & a20_mask; + + /* align to page_size */ + pte &=3D PG_ADDRESS_MASK & ~(page_size - 1); + + /* Even if 4MB pages, we map only one 4KB page in the cache to + avoid filling it too fast */ + vaddr =3D addr & TARGET_PAGE_MASK; + page_offset =3D vaddr & (page_size - 1); + paddr =3D pte + page_offset; + + assert(prot & (1 << is_write1)); + tlb_set_page_with_attrs(cs, vaddr, paddr, cpu_get_mem_attrs(env), + prot, mmu_idx, page_size); + return 0; + do_fault_rsvd: + error_code |=3D PG_ERROR_RSVD_MASK; + do_fault_protect: + error_code |=3D PG_ERROR_P_MASK; + do_fault: + error_code |=3D (is_write << PG_ERROR_W_BIT); + if (is_user) + error_code |=3D PG_ERROR_U_MASK; + if (is_write1 =3D=3D 2 && + (((env->efer & MSR_EFER_NXE) && + (env->cr[4] & CR4_PAE_MASK)) || + (env->cr[4] & CR4_SMEP_MASK))) + error_code |=3D PG_ERROR_I_D_MASK; + if (env->intercept_exceptions & (1 << EXCP0E_PAGE)) { + /* cr2 is not modified in case of exceptions */ + x86_stq_phys(cs, + env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2), + addr); + } else { + env->cr[2] =3D addr; + } + env->error_code =3D error_code; + cs->exception_index =3D EXCP0E_PAGE; + return 1; +} +#endif diff --git a/target/i386/helper.c b/target/i386/helper.c index 4d584b5..bcf9b22 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -722,349 +722,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t ne= w_cr4) cpu_sync_bndcs_hflags(env); } =20 -#if defined(CONFIG_USER_ONLY) - -int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, - int is_write, int mmu_idx) -{ - X86CPU *cpu =3D X86_CPU(cs); - CPUX86State *env =3D &cpu->env; - - /* user mode only emulation */ - is_write &=3D 1; - env->cr[2] =3D addr; - env->error_code =3D (is_write << PG_ERROR_W_BIT); - env->error_code |=3D PG_ERROR_U_MASK; - cs->exception_index =3D EXCP0E_PAGE; - env->exception_is_int =3D 0; - env->exception_next_eip =3D -1; - return 1; -} - -#else - -/* return value: - * -1 =3D cannot handle fault - * 0 =3D nothing more to do - * 1 =3D generate PF fault - */ -int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, - int is_write1, int mmu_idx) -{ - X86CPU *cpu =3D X86_CPU(cs); - CPUX86State *env =3D &cpu->env; - uint64_t ptep, pte; - int32_t a20_mask; - target_ulong pde_addr, pte_addr; - int error_code =3D 0; - int is_dirty, prot, page_size, is_write, is_user; - hwaddr paddr; - uint64_t rsvd_mask =3D PG_HI_RSVD_MASK; - uint32_t page_offset; - target_ulong vaddr; - - is_user =3D mmu_idx =3D=3D MMU_USER_IDX; -#if defined(DEBUG_MMU) - printf("MMU fault: addr=3D%" VADDR_PRIx " w=3D%d u=3D%d eip=3D" TARGET= _FMT_lx "\n", - addr, is_write1, is_user, env->eip); -#endif - is_write =3D is_write1 & 1; - - a20_mask =3D x86_get_a20_mask(env); - if (!(env->cr[0] & CR0_PG_MASK)) { - pte =3D addr; -#ifdef TARGET_X86_64 - if (!(env->hflags & HF_LMA_MASK)) { - /* Without long mode we can only address 32bits in real mode */ - pte =3D (uint32_t)pte; - } -#endif - prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; - page_size =3D 4096; - goto do_mapping; - } - - if (!(env->efer & MSR_EFER_NXE)) { - rsvd_mask |=3D PG_NX_MASK; - } - - if (env->cr[4] & CR4_PAE_MASK) { - uint64_t pde, pdpe; - target_ulong pdpe_addr; - -#ifdef TARGET_X86_64 - if (env->hflags & HF_LMA_MASK) { - bool la57 =3D env->cr[4] & CR4_LA57_MASK; - uint64_t pml5e_addr, pml5e; - uint64_t pml4e_addr, pml4e; - int32_t sext; - - /* test virtual address sign extension */ - sext =3D la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47; - if (sext !=3D 0 && sext !=3D -1) { - env->error_code =3D 0; - cs->exception_index =3D EXCP0D_GPF; - return 1; - } - - if (la57) { - pml5e_addr =3D ((env->cr[3] & ~0xfff) + - (((addr >> 48) & 0x1ff) << 3)) & a20_mask; - pml5e =3D x86_ldq_phys(cs, pml5e_addr); - if (!(pml5e & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pml5e & (rsvd_mask | PG_PSE_MASK)) { - goto do_fault_rsvd; - } - if (!(pml5e & PG_ACCESSED_MASK)) { - pml5e |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pml5e_addr, pml5e); - } - ptep =3D pml5e ^ PG_NX_MASK; - } else { - pml5e =3D env->cr[3]; - ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; - } - - pml4e_addr =3D ((pml5e & PG_ADDRESS_MASK) + - (((addr >> 39) & 0x1ff) << 3)) & a20_mask; - pml4e =3D x86_ldq_phys(cs, pml4e_addr); - if (!(pml4e & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pml4e & (rsvd_mask | PG_PSE_MASK)) { - goto do_fault_rsvd; - } - if (!(pml4e & PG_ACCESSED_MASK)) { - pml4e |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pml4e_addr, pml4e); - } - ptep &=3D pml4e ^ PG_NX_MASK; - pdpe_addr =3D ((pml4e & PG_ADDRESS_MASK) + (((addr >> 30) & 0x= 1ff) << 3)) & - a20_mask; - pdpe =3D x86_ldq_phys(cs, pdpe_addr); - if (!(pdpe & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pdpe & rsvd_mask) { - goto do_fault_rsvd; - } - ptep &=3D pdpe ^ PG_NX_MASK; - if (!(pdpe & PG_ACCESSED_MASK)) { - pdpe |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pdpe_addr, pdpe); - } - if (pdpe & PG_PSE_MASK) { - /* 1 GB page */ - page_size =3D 1024 * 1024 * 1024; - pte_addr =3D pdpe_addr; - pte =3D pdpe; - goto do_check_protect; - } - } else -#endif - { - /* XXX: load them when cr3 is loaded ? */ - pdpe_addr =3D ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & - a20_mask; - pdpe =3D x86_ldq_phys(cs, pdpe_addr); - if (!(pdpe & PG_PRESENT_MASK)) { - goto do_fault; - } - rsvd_mask |=3D PG_HI_USER_MASK; - if (pdpe & (rsvd_mask | PG_NX_MASK)) { - goto do_fault_rsvd; - } - ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; - } - - pde_addr =3D ((pdpe & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) <= < 3)) & - a20_mask; - pde =3D x86_ldq_phys(cs, pde_addr); - if (!(pde & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pde & rsvd_mask) { - goto do_fault_rsvd; - } - ptep &=3D pde ^ PG_NX_MASK; - if (pde & PG_PSE_MASK) { - /* 2 MB page */ - page_size =3D 2048 * 1024; - pte_addr =3D pde_addr; - pte =3D pde; - goto do_check_protect; - } - /* 4 KB page */ - if (!(pde & PG_ACCESSED_MASK)) { - pde |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pde_addr, pde); - } - pte_addr =3D ((pde & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) <<= 3)) & - a20_mask; - pte =3D x86_ldq_phys(cs, pte_addr); - if (!(pte & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pte & rsvd_mask) { - goto do_fault_rsvd; - } - /* combine pde and pte nx, user and rw protections */ - ptep &=3D pte ^ PG_NX_MASK; - page_size =3D 4096; - } else { - uint32_t pde; - - /* page directory entry */ - pde_addr =3D ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & - a20_mask; - pde =3D x86_ldl_phys(cs, pde_addr); - if (!(pde & PG_PRESENT_MASK)) { - goto do_fault; - } - ptep =3D pde | PG_NX_MASK; - - /* if PSE bit is set, then we use a 4MB page */ - if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { - page_size =3D 4096 * 1024; - pte_addr =3D pde_addr; - - /* Bits 20-13 provide bits 39-32 of the address, bit 21 is res= erved. - * Leave bits 20-13 in place for setting accessed/dirty bits b= elow. - */ - pte =3D pde | ((pde & 0x1fe000LL) << (32 - 13)); - rsvd_mask =3D 0x200000; - goto do_check_protect_pse36; - } - - if (!(pde & PG_ACCESSED_MASK)) { - pde |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pde_addr, pde); - } - - /* page directory entry */ - pte_addr =3D ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & - a20_mask; - pte =3D x86_ldl_phys(cs, pte_addr); - if (!(pte & PG_PRESENT_MASK)) { - goto do_fault; - } - /* combine pde and pte user and rw protections */ - ptep &=3D pte | PG_NX_MASK; - page_size =3D 4096; - rsvd_mask =3D 0; - } - -do_check_protect: - rsvd_mask |=3D (page_size - 1) & PG_ADDRESS_MASK & ~PG_PSE_PAT_MASK; -do_check_protect_pse36: - if (pte & rsvd_mask) { - goto do_fault_rsvd; - } - ptep ^=3D PG_NX_MASK; - - /* can the page can be put in the TLB? prot will tell us */ - if (is_user && !(ptep & PG_USER_MASK)) { - goto do_fault_protect; - } - - prot =3D 0; - if (mmu_idx !=3D MMU_KSMAP_IDX || !(ptep & PG_USER_MASK)) { - prot |=3D PAGE_READ; - if ((ptep & PG_RW_MASK) || (!is_user && !(env->cr[0] & CR0_WP_MASK= ))) { - prot |=3D PAGE_WRITE; - } - } - if (!(ptep & PG_NX_MASK) && - (mmu_idx =3D=3D MMU_USER_IDX || - !((env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)))) { - prot |=3D PAGE_EXEC; - } - if ((env->cr[4] & CR4_PKE_MASK) && (env->hflags & HF_LMA_MASK) && - (ptep & PG_USER_MASK) && env->pkru) { - uint32_t pk =3D (pte & PG_PKRU_MASK) >> PG_PKRU_BIT; - uint32_t pkru_ad =3D (env->pkru >> pk * 2) & 1; - uint32_t pkru_wd =3D (env->pkru >> pk * 2) & 2; - uint32_t pkru_prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; - - if (pkru_ad) { - pkru_prot &=3D ~(PAGE_READ | PAGE_WRITE); - } else if (pkru_wd && (is_user || env->cr[0] & CR0_WP_MASK)) { - pkru_prot &=3D ~PAGE_WRITE; - } - - prot &=3D pkru_prot; - if ((pkru_prot & (1 << is_write1)) =3D=3D 0) { - assert(is_write1 !=3D 2); - error_code |=3D PG_ERROR_PK_MASK; - goto do_fault_protect; - } - } - - if ((prot & (1 << is_write1)) =3D=3D 0) { - goto do_fault_protect; - } - - /* yes, it can! */ - is_dirty =3D is_write && !(pte & PG_DIRTY_MASK); - if (!(pte & PG_ACCESSED_MASK) || is_dirty) { - pte |=3D PG_ACCESSED_MASK; - if (is_dirty) { - pte |=3D PG_DIRTY_MASK; - } - x86_stl_phys_notdirty(cs, pte_addr, pte); - } - - if (!(pte & PG_DIRTY_MASK)) { - /* only set write access if already dirty... otherwise wait - for dirty access */ - assert(!is_write); - prot &=3D ~PAGE_WRITE; - } - - do_mapping: - pte =3D pte & a20_mask; - - /* align to page_size */ - pte &=3D PG_ADDRESS_MASK & ~(page_size - 1); - - /* Even if 4MB pages, we map only one 4KB page in the cache to - avoid filling it too fast */ - vaddr =3D addr & TARGET_PAGE_MASK; - page_offset =3D vaddr & (page_size - 1); - paddr =3D pte + page_offset; - - assert(prot & (1 << is_write1)); - tlb_set_page_with_attrs(cs, vaddr, paddr, cpu_get_mem_attrs(env), - prot, mmu_idx, page_size); - return 0; - do_fault_rsvd: - error_code |=3D PG_ERROR_RSVD_MASK; - do_fault_protect: - error_code |=3D PG_ERROR_P_MASK; - do_fault: - error_code |=3D (is_write << PG_ERROR_W_BIT); - if (is_user) - error_code |=3D PG_ERROR_U_MASK; - if (is_write1 =3D=3D 2 && - (((env->efer & MSR_EFER_NXE) && - (env->cr[4] & CR4_PAE_MASK)) || - (env->cr[4] & CR4_SMEP_MASK))) - error_code |=3D PG_ERROR_I_D_MASK; - if (env->intercept_exceptions & (1 << EXCP0E_PAGE)) { - /* cr2 is not modified in case of exceptions */ - x86_stq_phys(cs, - env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2), - addr); - } else { - env->cr[2] =3D addr; - } - env->error_code =3D error_code; - cs->exception_index =3D EXCP0E_PAGE; - return 1; -} - +#if !defined(CONFIG_USER_ONLY) hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { X86CPU *cpu =3D X86_CPU(cs); --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167482068994.8742175139155; Tue, 4 Jul 2017 04:24:42 -0700 (PDT) Received: from localhost ([::1]:40517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLwc-0001DH-Kd for importer@patchew.org; Tue, 04 Jul 2017 07:24:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlP-0006zf-0t for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlL-000229-4k for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:02 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:34439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlK-00021X-Ua for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:59 -0400 Received: by mail-wr0-x242.google.com with SMTP id k67so46853801wrc.1 for ; Tue, 04 Jul 2017 04:12:58 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=LrOV44fuvyh0uJw0WN1/XkuPMarMyPE0HVT+YlC4EXc=; b=mpdsx51ulxQRwPdJeeUAdc/c5ZAI/cWgk+coUlaC/Jzr+qXZD92JtfV1VBj4fqEoQi s+LoKPKgXYDxDYdmaJpTXmiryKcA8O5pjPcO7sT3EmW/w2l5071K2KSN8XVJZTcUdqyB f/nRnsZCqzhnaY/GZGkoYeMepkxwQei55sSa6NB7yqo2gtszEcJwAPaLmRsdTUBGeFUB Wa1jHRQMLzm/2ld58SXVZ31FYzF/Jq0UEy6QTcmn2yqx1xTPis4bX0xJCTM0jbkTwTwA OYhgI8EdAoLCKXRp2MClFcYMxVmMa7wtAoqTxlwnetO69UwZb17K7l/mKpilG74CoR0n 3Ahg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=LrOV44fuvyh0uJw0WN1/XkuPMarMyPE0HVT+YlC4EXc=; b=QQmJ6CYc4BstyLgTBH4rDqjeKEHwjgO7IfEvGpo2FTdJeMc0uxSWuzmUv57EVv792n DwKtja7fcYWuKXaKQOMFQaEe+jHV90ZpWFriImPpbjWc6hhZqxqxPNjuCGd06fVNJtFL teqIdblWVj9O2ERb8ryGEmDk0rxJ5Euz2SObOcaqdoICIGf43rKTeRGyEBH6CmyG3PGi fWTzGUS0zASCvhCbh2KYYqZ8F12xAUqaNxVWkVBymdPfvYq4MlW4xPBDlZe9PReL3yJb d7srmFuXQCIEA9KqB41SfmPkGdZ6VX0pERp6pgT1tZUA/Zf0C9los6LUrp+IgqDS2RM/ tr+w== X-Gm-Message-State: AKS2vOydtbJ5asClzYOIgSPNRMQ9SUn9lpIXflhWOT2jIa+93zPDy9YS yLmTjUwuVBPZR5cHhBk= X-Received: by 10.223.163.15 with SMTP id c15mr33319165wrb.71.1499166777829; Tue, 04 Jul 2017 04:12:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:13 +0200 Message-Id: <1499166735-39360-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH 20/22] target/i386: add the tcg_enabled() in target/i386/ 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add the tcg_enabled() where the x86 target needs to disable TCG-specific code. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- v2: do not touch bpt_helper.c, adjust caller in machine.c [Richard] target/i386/cpu.c | 4 +++- target/i386/cpu.h | 8 +++++++- target/i386/helper.c | 2 +- target/i386/machine.c | 10 +++++----- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 642519a..c571772 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4040,8 +4040,10 @@ static void x86_cpu_common_class_init(ObjectClass *o= c, void *data) cc->class_by_name =3D x86_cpu_class_by_name; cc->parse_features =3D x86_cpu_parse_featurestr; cc->has_work =3D x86_cpu_has_work; +#ifdef CONFIG_TCG cc->do_interrupt =3D x86_cpu_do_interrupt; cc->cpu_exec_interrupt =3D x86_cpu_exec_interrupt; +#endif cc->dump_state =3D x86_cpu_dump_state; cc->get_crash_info =3D x86_cpu_get_crash_info; cc->set_pc =3D x86_cpu_set_pc; @@ -4070,7 +4072,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) cc->gdb_core_xml_file =3D "i386-32bit.xml"; cc->gdb_num_core_regs =3D 41; #endif -#ifndef CONFIG_USER_ONLY +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) cc->debug_excp_handler =3D breakpoint_handler; #endif cc->cpu_exec_enter =3D x86_cpu_exec_enter; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 66a363f..cef7dbe 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 @@ -1597,7 +1599,11 @@ uint32_t cpu_cc_compute_all(CPUX86State *env1, int o= p); =20 static inline uint32_t cpu_compute_eflags(CPUX86State *env) { - return env->eflags | cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MA= SK); + uint32_t eflags =3D env->eflags; + if (tcg_enabled()) { + eflags |=3D cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK); + } + return eflags; } =20 /* NOTE: the translator must set DisasContext.cc_op to CC_OP_EFLAGS diff --git a/target/i386/helper.c b/target/i386/helper.c index bcf9b22..f63eb3d 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -990,7 +990,7 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAccess = 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); diff --git a/target/i386/machine.c b/target/i386/machine.c index e0417fe..eab3372 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -281,16 +281,16 @@ static int cpu_post_load(void *opaque, int version_id) env->fptags[i] =3D (env->fptag_vmstate >> i) & 1; } if (tcg_enabled()) { + target_ulong dr7; update_fp_status(env); update_mxcsr_status(env); - } =20 - cpu_breakpoint_remove_all(cs, BP_CPU); - cpu_watchpoint_remove_all(cs, BP_CPU); - { + cpu_breakpoint_remove_all(cs, BP_CPU); + cpu_watchpoint_remove_all(cs, BP_CPU); + /* Indicate all breakpoints disabled, as they are, then let the helper re-enable them. */ - target_ulong dr7 =3D env->dr[7]; + dr7 =3D env->dr[7]; env->dr[7] =3D dr7 & ~(DR7_GLOBAL_BP_MASK | DR7_LOCAL_BP_MASK); cpu_x86_update_dr7(env, dr7); } --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499168008127715.9681400684409; Tue, 4 Jul 2017 04:33:28 -0700 (PDT) Received: from localhost ([::1]:40592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSM54-0000rL-0q for importer@patchew.org; Tue, 04 Jul 2017 07:33:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlP-0006ze-0Q for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlM-00022g-Go for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:02 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlM-00022M-9T for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:00 -0400 Received: by mail-wm0-x244.google.com with SMTP id u23so25605245wma.2 for ; Tue, 04 Jul 2017 04:13:00 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=C/KTVQmYtBuCb07V871o44rhGvwIQU4jT5GZL3Kr8w4=; b=iTKbCSqcRZfVO3CIdahuIGCsglMk1Oq4XWAnXdy5rHvqwATFTvMwF6H4kYrnIzC/l3 yWRV0qLxqbnq8nDG+15Et1h0TOESw577bjeBKd3eD3l3xkzvU9WVGq6OcBJhiZRMDxIU jYQhpESbHBHUjvJuG6H/BDQM6P3bDPmvtb1XVvHgRYk/LQalhw/vokYzkee7FWTGaVj0 nRuepmhvf/c/QopjNM82w+DAd0sx+FwiyBDhx71zFRq0BZf/TpSs2bGp/kGDGXlFdeAr LksNQIsnZ4Q+/vfnENPhm178+NeTEKhNHBNAl1O300eYgV94wcQaS0tgQK63aRDmNrSg O3Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=C/KTVQmYtBuCb07V871o44rhGvwIQU4jT5GZL3Kr8w4=; b=DJ7OPxVV7YxG3g7ZA74Gra/53Dy8IVdf2GnfHjID94BayUX4l/U6R+V6Yz3IRwmu7M S1EA9dHI4GVHwsK+wxXuDnMTg95guMySxfeRyOchLTEHAlqPoJKFxFMYFwEoT5O4x2li /0EyfZqeDcrMllwgopctOj0jsfTwitU9CaWpWA3T9AXtUN9Ol0SowdqSWTJFLjivSijs +sHDhdXFd1g0cP63Ww3ImYQwanEQbGNgqeFKbY85+yi8q30JLxDACYE3n+FXUUDBmTkp SLhgqjFUuuZpudNyaPOy/lealcP0P6XNe4w64mreZJNezWZV1i4u3feRfpfrDuGmdPTE j3HA== X-Gm-Message-State: AIVw111sebcCV44keBKnehQTIh3Uw4uJQnImUJG4RXwGi1YG6RCwojI9 bG+5FDeiGnsn1Wrk3NY= X-Received: by 10.28.45.197 with SMTP id t188mr4760057wmt.78.1499166779162; Tue, 04 Jul 2017 04:12:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:14 +0200 Message-Id: <1499166735-39360-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 21/22] target/i386: 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add the CONFIG_TCG for frontend and backend's files in the related Makefiles. Signed-off-by: Yang Zhong Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- v2: compile out bpt_helper.c [Richard] target/i386/Makefile.objs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 4fcb7f3..fcc18a0 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -1,7 +1,9 @@ -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 obj-y +=3D gdbstub.o +obj-$(CONFIG_TCG) +=3D translate.o +obj-$(CONFIG_TCG) +=3D bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o +obj-$(CONFIG_TCG) +=3D int_helper.o mem_helper.o misc_helper.o mpx_helper.o +obj-$(CONFIG_TCG) +=3D seg_helper.o smm_helper.o svm_helper.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 obj-$(call lnot,$(CONFIG_KVM)) +=3D kvm-stub.o --=20 1.8.3.1 From nobody Sun May 5 09:37:16 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; dkim=fail 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 1499167403802422.77904578902394; Tue, 4 Jul 2017 04:23:23 -0700 (PDT) Received: from localhost ([::1]:40510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLvN-0007Ot-Gd for importer@patchew.org; Tue, 04 Jul 2017 07:23:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLlR-00072X-Mq for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLlN-00023i-KQ for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:05 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33928) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLlN-00022y-Df for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:13:01 -0400 Received: by mail-wm0-x244.google.com with SMTP id p204so25633069wmg.1 for ; Tue, 04 Jul 2017 04:13:01 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6q6YENuSAjvTbBBUEQAeAhfYnj18ugxJR3XpKkyXqtI=; b=uEmHCPmbyt2TmMhcOGvcHukfWpHfXp7btoPpFAfPw4D2RNdsGkjAKpbiWXGe+rg0Yn iY85w441XR1RRiw9KwLgduU4Nwqo8DU/awdA6U8/tP3kHXrW1i7p/cMR12CONtXdaR9T XvNVwitxcLhPDqtXuEhXFITuVPlfoGu3qajljQ08wEJ81bMZqy9dBtFeA3TeE7+aOzX3 HqHxvf1voKO1smk+Ln0//Szkqn21lKbORKvZPAhzeBy+mc2okznNwZ93tkCt0/OUSgAG 9CacVzgs3jR1gs8emGsouD9f618SsqmqxijURRJ2tFH4B6PFcXvfPf87yWOHkO8Kkh2c kfNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=6q6YENuSAjvTbBBUEQAeAhfYnj18ugxJR3XpKkyXqtI=; b=rP49UBRAvkgYBWx4OtQMVLErBUfYp2+4MQyFiwB88P2AFLeeZ/aS+Ci7QgIyT99Uja SzBOV2u0QrbtPKdmfVO8G2MUGQoYA3OZzV8k66oYASz06ecipsXHUIPp35tSWUU3wMXi oWZVe1Tiwt5BxrSsWkaEOfsUCAhECScEKdyzw5PxmuFxPdiVUumXImvitViuBnLHKkGB 4Hz60MCScE5TxIRstSfgKMk5ni7nge2Epuks0HCEgiDZpjyr71DTrplTdbeLH8sGU1/y 2e3I8pz2lSPpy0XtI6IfeLESYPtdkBsIb5E89tpSf+JYlkITxPD+kJz9KynyOsJeFXC+ wybQ== X-Gm-Message-State: AKS2vOxp0GUPz36PPFx+w8TYGbsSCosnoSMQ0VKXl6rqPR7uPHg0jpmp v65dUiVsTgHFS6zrdws= X-Received: by 10.28.150.136 with SMTP id y130mr24827308wmd.108.1499166780316; Tue, 04 Jul 2017 04:13:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:12:15 +0200 Message-Id: <1499166735-39360-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 22/22] configure: warn on untested --disable-tcg 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@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" --disable-tcg will almost certainly fail to compile on non-x86 platforms, so issue a warning. Reviewed-by: Richard Henderson Reviewed-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index 806658c..3109836 100755 --- a/configure +++ b/configure @@ -1771,6 +1771,13 @@ if test "$solaris" =3D "yes" ; then fi fi =20 +if test "$tcg" =3D no; then + case "$cpu" in + i386 | x86_64) ;; + *) echo "WARNING: --disable-tcg not supported on this host, compil= ation may fail" ;; + esac +fi + if test -z "${target_list+xxx}" ; then for target in $default_target_list; do supported_target $target 2>/dev/null && \ --=20 1.8.3.1