From nobody Tue May 7 09:01:39 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 1499099817847547.7758911399845; Mon, 3 Jul 2017 09:36:57 -0700 (PDT) Received: from localhost ([::1]:36275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4LF-0001J6-JL for importer@patchew.org; Mon, 03 Jul 2017 12:36:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4JU-0008OY-3b for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4JQ-0007HR-UU for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:04 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4JQ-0007HF-OJ for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:00 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so21509972wmj.0 for ; Mon, 03 Jul 2017 09:35: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 r5sm4867459wmr.9.2017.07.03.09.34.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:34: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=nDEfuZ3rCjn27T+9nOh6J4uoC74yL4LBCk4kYEp5BGs=; b=hmGXvhlf74se2OMNlQWcrKOxV4sawr1bAgtu8khmOLWpZKmaOMZOzfMKD3FcIoIxt1 fZxPzbCATUn2CEqhDb+wNePXjk0RH55xCDGKkMjsmw3yW12eRzqyAlZLMQXOplDhU5SL 8fTEB+V++BDX0eiuUrqLmpk25URgQKIuUHFWmMPX4uymnjtSkftZhscRJucJTMK5IBkj ksoWvFOSRtm+QbShvjtKMGxybXUUddYkRxOZxOqWEtNcBbmn1MA1HHnpOyvnTZZJtwdx 97peau8/jPIJweS/ymAH/bnG/dvaDwdGJfBkTWyWbFUnW5qBgtSt8ogZWOnRYi9F7uG6 H69Q== 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=nDEfuZ3rCjn27T+9nOh6J4uoC74yL4LBCk4kYEp5BGs=; b=OEFqbYMuIQpaw5pCKzkMLUwxaCAP3ZSIRFk9daKwX+AMFoWeKIy+am0RCYEY0NnarE FKWcoL9BukUU59t2X/7clIEq4JyDYusB0Hne2vEQy098We7QkDSPXNE8VWk4UcqSl/kk WYPcgpQ0emxdFz4/DQrGD48P8+Od2bASb563hYX8KblwFL8XG50PEC38JDbSBXdUW0/s Q+6WhsbYl/M2RxE/iS9gGYC++W/3PdXNsSEIHfv6rVqW+yOfAqbjFTpDRXIo5yPWyWTO 1Wqms0cxEnRS4ejNH0N8A885O48DJrSw75CaOD/Y26UEFyBP/TE3xV8u8f7fCJKIVAm4 bMXg== X-Gm-Message-State: AIVw110NnOuhOLm6xvFNeWI+TclVCBQsOwNq7fJrp/sZNQwvdg41Hpj1 hA5VyVtoLODWB96sC24= X-Received: by 10.28.131.130 with SMTP id f124mr5624757wmd.25.1499099699373; Mon, 03 Jul 2017 09:34:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:32 +0200 Message-Id: <1499099693-22903-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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. Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499099812424244.4901073639835; Mon, 3 Jul 2017 09:36:52 -0700 (PDT) Received: from localhost ([::1]:36274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4LD-0001Gr-1l for importer@patchew.org; Mon, 03 Jul 2017 12:36:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4JU-0008OZ-3p for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4JS-0007JG-40 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:04 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4JR-0007Hh-TY for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:02 -0400 Received: by mail-wm0-x244.google.com with SMTP id y5so21469462wmh.3 for ; Mon, 03 Jul 2017 09:35: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 r5sm4867459wmr.9.2017.07.03.09.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:34: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=4iUu8KuUFNH07lIaBwU7yaIz/PFfBbJ9/W0L9BSOrJ4=; b=rS0N329/Jtr/AM5RAD942iaVdCDpmEZ49tOThV4sFWZKjbmDvNumeVh+r5da2jUPe+ NfRySCERvP5WnFpEmQFn5co8gToQStB6OQ9/i3vHmjpwwinEZPVh1B9CNrrXcZKQk+xi ER9a+bA4xrdvFHFp9ymKf93TNgyrHD8rtm5lXTbop6bKBH+i2BkVKadTfASiDSIXlM0/ 8XClVSO/Ql9MN8XQqsI7kxujLhEpM4KLqPgA4RZSul1N8l/SE3BGlWM/7pid7KbKb/el R1zLutW+0MVDXODowFWFlNzUEbcxVTobDaSkiBPAK4ef2cTF0jApAjr5c0pM9+BQmb/F J9pQ== 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=4iUu8KuUFNH07lIaBwU7yaIz/PFfBbJ9/W0L9BSOrJ4=; b=hHPgnmwttzD7NEZ7vdWhKQtZczb79UiKbDaXDob8RtHG+Kl64D8DMGr2A2A+lABRfY fJ7mb7YLUrLj3djf3uS8dxBCaS41HrrIbHrolP+4qC1DohnZGbQ8natA7Afn6YWsJyyu T27fvxSzEfwQSkW4EsyUTyHuZ83INQ486R1NnUB5XdycgVrobq3N8YkBLlVE0JghgNpW k8KKO7B5K2w/w+RQjQJJRHbZ4jxU4E2C1xJpGeOBa4+OzxrdgBp0mtQ2VflKBYh3o1Uu r/QG6TNC0VsJUv+Qd06DDqAK+vir39DCoyPnpKL6rmbYkAl917vemqrGOMpxRfFfORSb 1gTA== X-Gm-Message-State: AIVw111cF+lSbyvCjkBHNRDxgkMKep4lKdD/5bLLnSB36tCDlxsRdXyN 6Yr7NmQuaFovk4cEEq8= X-Received: by 10.28.88.3 with SMTP id m3mr10487775wmb.28.1499099700708; Mon, 03 Jul 2017 09:35:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:33 +0200 Message-Id: <1499099693-22903-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 65 ++++++++++++++++++++++++++++++++++++++++++-----------------= ---- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 0f14e79..6d1a6a9 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,25 @@ supported_xen_target() { return 1 } =20 +supported_target() { + case "$1" in + ${target_name}-softmmu) ;; + ${target_name}-linux-user) + if test "$linux" !=3D "yes"; then + print_error "Target '$target' is only available on a Linux= host" + return 1 + fi + ;; + ${target_name}-bsd-user) + if test "$bsd" !=3D "yes"; then + print_error "Target '$target' is only available on a BSD h= ost" + return 1 + fi + ;; + esac + return 0 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -1734,23 +1757,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 +6077,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 Tue May 7 09:01:39 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 1499099963223174.26548654644967; Mon, 3 Jul 2017 09:39:23 -0700 (PDT) Received: from localhost ([::1]:36284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Nd-0003S0-OS for importer@patchew.org; Mon, 03 Jul 2017 12:39:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4JV-0008P9-4m for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4JT-0007K4-JG for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:05 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4JT-0007JY-Cw for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:03 -0400 Received: by mail-wm0-x244.google.com with SMTP id y5so21469588wmh.3 for ; Mon, 03 Jul 2017 09:35:03 -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 r5sm4867459wmr.9.2017.07.03.09.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35:01 -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=La+gLKDSrd76Xe/oPlA/rZrGyzXp0nyrFYtOKbsx098=; b=Ccr8TNBMyaQLqcdEeItAjR68P3+SC5UtZN1AV1rexMbbDu+EdkzP79oJcku4XrxMet 2QCGyuQ8IXkjg//EuNKbjQcJ8abiJotF51xsahqvQy/oAzqqoeSbBG5sqXVY7B/1yIjA c3rXe6xLo66rK7rVt4Rtp0d2xD1xn9IWtoTYJAu9pK24xDHTEpZjlzJvdpGZXgcu5dwy t7ylIl4+2h4k3+so4pWR1XGBFLq0pMYSyLHRMMMcZ+u/t/x6tozhc9sZNo9APa4ZHWru 93y5qHCm0s4d89iBZi/0oKsloT44nTRBFPJV/TEt5Pl2Vv0o55x0G7NHHVM5eZ//8Mdt gBKA== 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=La+gLKDSrd76Xe/oPlA/rZrGyzXp0nyrFYtOKbsx098=; b=jkrm3vm3jEMgVllIAN/dmmE6ocBctDrmdfx79OxFj+OlN0DWuG+jgV0RnxWB/rLvWk fZW50zZfx8+nIS0kITCgJ6stRyEVMdwst9PMV8rIPAwGbmRaQanNz0H3H5kZeJPFQ8Zr ek541/p5vcRHf9igwdxZPB4uobKqWbytqUyHfQu9LH9pS5W6XXUYAmIf8JEeUrAwjG4A +60wuFqHe11cLWjJuxGBupPwxpy7eDjJgOAlk8oNZ2aSOC/Pgh3aWkp3XyG3LGwchh3o tZpX/A5kG+Pf82UHArkrE8KQWuc40lLRzuu3mRkzvL8ycfsWgYyS6mAVgzUvPaTWMzwB wdbw== X-Gm-Message-State: AKS2vOwGm4ufTmYV7MPySJipaAoTjhuUV7w9UTCvlk+xtMZyF7BTLSDY x2FNkPeBewP5DIFCZ9I= X-Received: by 10.28.35.201 with SMTP id j192mr24185691wmj.26.1499099702171; Mon, 03 Jul 2017 09:35:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:34 +0200 Message-Id: <1499099693-22903-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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" 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 Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange Reviewed-by: Richard Henderson --- configure | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 6d1a6a9..cc8f5e3 100755 --- a/configure +++ b/configure @@ -227,7 +227,12 @@ supported_target() { fi ;; 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 @@ -291,6 +296,7 @@ cap_ng=3D"" attr=3D"" libattr=3D"" xfs=3D"" +tcg=3D"yes" =20 vhost_net=3D"no" vhost_scsi=3D"no" @@ -1028,6 +1034,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" @@ -5190,7 +5200,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" @@ -5245,8 +5254,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" @@ -5689,8 +5702,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 Tue May 7 09:01:39 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 1499099853561319.321838907907; Mon, 3 Jul 2017 09:37:33 -0700 (PDT) Received: from localhost ([::1]:36277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Lq-0001p3-LV for importer@patchew.org; Mon, 03 Jul 2017 12:37:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Jl-0000JP-Uw for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4Ji-0007c7-Pn for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:21 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:33891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4Ji-0007ba-Js for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:18 -0400 Received: by mail-wr0-x241.google.com with SMTP id k67so45051580wrc.1 for ; Mon, 03 Jul 2017 09:35:18 -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 r5sm4867459wmr.9.2017.07.03.09.35.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35:02 -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=iyI85Rr3w3QgTK9/UlFMQnuSXhYVQD7h7+X6uOal+3I=; b=M3t94EN0YTQ1slsocbXIPUYMjMwPuxB4PiyVYQMlCwEvOeiYlEDCIDewD8w/zXPdtw 51tb/9A4zrnOXEC2urn3qd5J0XMJd9QR0XPhNqxWAfF8MKcaTd0fQ6JVXHTB8dSqZUB1 PQIFNPv8lgPh6AnVNH6j1OwG5IH1nkQv1/v7uTnPYhqPpyldogQ7437LIiANE/1Nktq5 3+8e5gFUqpkTJ2U79hMvdK2Y0iNKH1mr8yUcPywBNR1sI4XwiyOjElBw6vZrcZTCYhTV G5jysJe6MTlGB+i+XrsK63yz8yXh5hYC0aJESWBdAKTvcoY1wbOaTqN15QqSwsKqsDKp RPQA== 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=iyI85Rr3w3QgTK9/UlFMQnuSXhYVQD7h7+X6uOal+3I=; b=IaPIhLtqdjJ6fjA3JnkK86uDaBd0+qHeP/S1ntJMRGnONi92jilKMhTCjaTJkkusMF 4DkKCcO+3/uow8zD2wjxwcEEWOL2/8P94NLobeKwgklBc1ttXZMrcvIJtEfWKXScMz/3 uSg9CKBpqXD6L4BOI3VoI1b8NvRGDfUpVmep4tDCJH4cUUxoo18nydpmZ/kzz5jLg1Mb TudsNglYHXTZO6V7uQOtAFLeCQiV01Co+53E9qQH9/bp4dls80a1yCq26ICXnX4Glbfd i0LmA+AhDlpJc+BsXAADD0hXqRqm9e0WwjPoEyzBUvALNIZnos4ucPZNcdNgq6zJzS8d Kp7Q== X-Gm-Message-State: AKS2vOwR8CPo/BWiAEglL9rsawDVvBIDg1Le6WiQyTa2szNOGlHqJBu1 lz5+o1J5ntrtzqEoOig= X-Received: by 10.223.166.8 with SMTP id k8mr35058081wrc.172.1499099717348; Mon, 03 Jul 2017 09:35:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:35 +0200 Message-Id: <1499099693-22903-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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" Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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..611ddfe 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 Tue May 7 09:01:39 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 1499100002431350.89263035816055; Mon, 3 Jul 2017 09:40:02 -0700 (PDT) Received: from localhost ([::1]:36286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4OG-0003yM-6E for importer@patchew.org; Mon, 03 Jul 2017 12:40:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Jl-0000JM-UC for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4Jk-0007ca-1J for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:21 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:36327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4Jj-0007cJ-Qj for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:19 -0400 Received: by mail-wr0-x243.google.com with SMTP id 77so45152867wrb.3 for ; Mon, 03 Jul 2017 09:35:19 -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 r5sm4867459wmr.9.2017.07.03.09.35.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35:17 -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=Cd32L8zBQfzI2FIJl3MS6cweqi3P0X0I/SPGzz97Vpw=; b=PmxRmjKQU6xLnLXaM7MI5vBvKLTTHMjDWLTCMAFlAHPHhb0OjTm01dm0aqXqZF2ooH F76Ph84rfSZs0k4Fw6PIrKADkDk3oifIBWd7W5keu669DlQuWUrkwC38AfQV6gQQqMR5 Vf3l+ACMRksidW9+Dj5b8mE5Fexhpy9UVUl0Q+sx7mbiNF8lZHb1SIhj7Uti5JAvcrWW C9b4ibE9oUvBbPOE/IOo3tUsS+AY0+5tCFOjS9sNinNhebMPcozOv36RdSw4ZQnw92qi KrOCZgXY3KV3FOt9M7/ClT6W1mLbSptVvznNHHYyN09eZr94L3hJFAPOng1oCv93XXm3 13cA== 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=Cd32L8zBQfzI2FIJl3MS6cweqi3P0X0I/SPGzz97Vpw=; b=mKhtA93IaQHYCTVHhYgBBh0RB6pKyDKDGj3yJvTYUhD3WdatarKSAZJ8eUCm1BraDe JgrCbsqELoeLAAf57BzbTJJY6qUhCZO0Qjd05CUe+0Vys5uVXko1rkcOQEX7UoPWoPMX NN6v/NGoOV4ImODNbuPhTopIsilkC9U4xYGWHVq821H6ywJIcN0b0d4dEcuI6y1fTt4o 505mF5cUgseuMfC8jQmznENeaXiiaLWLJRwnWuZcyaJrGaL4NRsvnxivHDlB5lbdtFg8 sv1g1y9bv90lk21twwwhfqOlop2hza1a3XCuhHgKIDTGKXZszTtjesup2y2GzJxSs75J gRYA== X-Gm-Message-State: AKS2vOw64kT10+HsT5WN+axBK15KbvP3qAdIJWmUVaSGc7XUw+073+gV FIWczrDUFGiTp/tl3oU= X-Received: by 10.223.147.98 with SMTP id 89mr32239457wro.103.1499099718575; Mon, 03 Jul 2017 09:35:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:36 +0200 Message-Id: <1499099693-22903-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- vl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 611ddfe..1ca6e8f 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 Tue May 7 09:01:39 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 1499100002241993.5266355581284; Mon, 3 Jul 2017 09:40:02 -0700 (PDT) Received: from localhost ([::1]:36285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4OE-0003x5-W9 for importer@patchew.org; Mon, 03 Jul 2017 12:39:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KI-0000lL-R4 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KF-0007y4-M8 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:54 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:32794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KF-0007xU-Co for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:51 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so21514439wmj.0 for ; Mon, 03 Jul 2017 09:35:51 -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 r5sm4867459wmr.9.2017.07.03.09.35.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35:19 -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=QoVf5JdMEUolVHKZPxRcy/phc5q/qrw/Ci6XVQLjRcA=; b=nEiGuIQbZRpBYyxS/DF+HKiiAUPuWu7dX9NvVVfc1lJM/7teHP6SeOW29Bq2OgGYkC 7XVypmFgrG6tysbEDrRiKB8u8FzARAwlDNT1V8sdYuFuTaJpxqidx/Ub22mvVdgDnWIF trnp8a7R9cLiHOwtx2knWrkmHGYneY9AzpGJy+VbZifIwZ7Ny5IH4EmypUDssd8a2XWF CV2L6xJykf5otRsxzugB9CG6eWIuMMNj626EosUl7HB/HlkIVpSPU3dFIuIcZ4x7hEtP 5qIY3wQ7Q3Io1JkUwuClz7almXt6UmyeX3uoJE0/R+nkpJdWl5F8vc+XlQHZxEfKDcyE eyLw== 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=QoVf5JdMEUolVHKZPxRcy/phc5q/qrw/Ci6XVQLjRcA=; b=hxsF61xkE4QQxitLgetvXEkzDycn/igxd5e3phT71MBDTiloJKk7udA4gK7u4lto18 4MPMUw9ALPblyzo7jX2I0fTApmTw//sa+pssS6PzOPbJJiwYFU8ADhUoMGSBlfbEAAO4 qYEBz4N+KnqOClUEtv6mCRmfcHVFk6IcqeEh3TU/VjkdBsr17XUXHgwr2WzzOBMt+VXN 1QixKOi9+fYUe2LLnzF6wu8B61JD3cxsmrZYTACT3syeeyZZe5N4xGu1mPUX/BkyKFLS 3koYtqkOEFV9V6LbhKTdukChfUsYcTcY+r0//cCKPZf9OMrCHkcBsBKFvcrQtKnQ5bIM jITg== X-Gm-Message-State: AIVw111oR05C+qXdISZXPZkvA6ZVVQNujRe/qZSiO1kftDUEMq815XBO Yq7w/BhAGKWQvWeeMzo= X-Received: by 10.28.228.134 with SMTP id b128mr7084271wmh.64.1499099750030; Mon, 03 Jul 2017 09:35:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:37 +0200 Message-Id: <1499099693-22903-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499100026116922.1668358191192; Mon, 3 Jul 2017 09:40:26 -0700 (PDT) Received: from localhost ([::1]:36287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Od-0004IH-Qs for importer@patchew.org; Mon, 03 Jul 2017 12:40:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KI-0000lK-Qx for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KG-0007zf-T4 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:54 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KG-0007yg-KI for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:52 -0400 Received: by mail-wm0-x244.google.com with SMTP id y5so21473801wmh.3 for ; Mon, 03 Jul 2017 09:35: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 r5sm4867459wmr.9.2017.07.03.09.35.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35: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=dIYJA4Qn1qaiUYFhgXAzpY1ITKem0i1odbOjUfJ3mG0=; b=jxa3DZNVjw7/CuW2R6B8/X37FJWsCWVmEdZpOUtFjZOC9bV9qVzCnWC03E5qg5cALw 2gTqoZgqrdKFoMchcnKk3tjl6W10su9y9zI9dH3t5C/cnyy1rWKtTLmmCbLcmFtDxh35 7OuZK57oZOgjR0062OD3lCG838tDT6Q1yzyvNuEH1vB0i+VEKJcYgo0bQW3Ztxl/cbr4 G+zjPKawjkJ9Y1TvIQnrIjjVUgbSgmSYw4KxdfTb88CZrjvFSjri/4niKK5i7VRI36EE PyN2bfXlTaTr6Hu8t4cbmsGHhBWOfMZmbQFJwtDDcSNXcqTKhZFoI1snEnxDpwK+VnsK OJXA== 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=dIYJA4Qn1qaiUYFhgXAzpY1ITKem0i1odbOjUfJ3mG0=; b=CJFa/0nAAh06Ror4wFw7WS6lHJj5hJOkVlsuc7kebVEUiF09zJpxrbLsVKUWTSqac4 KEitgQBiCIsi/uGwEU3Oznk8BXuDPus5AFj1DYfbh8ulrRKZ7TNSrKbMt2qe8IQQP/y0 mRQHpLEkB8k5rWIncJIRPfCTnjVeZqaEkFepLOiABysUyLD+LmtkpEgaaI5n0e0lJp46 vS0w3EiDIEik4rsndNEMArR3kj+9GeKNmbtM4gsiFetGQ4WrXb9FUNwZxwy/piYaWix+ 1QOeNYG4U9umDyPJRlsahup+DWcHdcMqaXxSUWGSvH/NP9yaCrcZ2yZAyZTGGaeG8pAj ZMjA== X-Gm-Message-State: AKS2vOzQTp18DU2xb9NBtYZzhBXH8PwQklvU+EWb6cNEies9kTJlSk1H 1qOAU90VKPEjUX6Turo= X-Received: by 10.28.211.132 with SMTP id k126mr25726467wmg.109.1499099751410; Mon, 03 Jul 2017 09:35:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:38 +0200 Message-Id: <1499099693-22903-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499100149606551.0672053811286; Mon, 3 Jul 2017 09:42:29 -0700 (PDT) Received: from localhost ([::1]:36298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Qd-0006EX-BT for importer@patchew.org; Mon, 03 Jul 2017 12:42:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KJ-0000ls-BA for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KI-00081W-8T for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:55 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KI-000809-2A for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:54 -0400 Received: by mail-wm0-x242.google.com with SMTP id p204so21568144wmg.1 for ; Mon, 03 Jul 2017 09:35:53 -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 r5sm4867459wmr.9.2017.07.03.09.35.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35: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=5QCRn4tPGVSBDlpKH9Xq24tD7Y7fQz/BIGVpeejr8oc=; b=sni2VLDVkr5UojU/MW8qV2hpn1AB6cBmD+PDpyc0UD805jrsICfKaoKfw43Fccgeyv aQeEzQo3qwL8E8m8DpnfwwHXVQHIUen6YOQphERaHgCw66GyMGogBp8fm2T5JeO/rCdM B5Y5xA3bvLke1etosXlrux9RJdksEv5o6mqTHGzowlCNi2GNnfd34oOm2rEvNDcyJNBG 2S4w6zrTUKA5O+okiAWIWdjLazflBGa6fdKCi6DU20bqYtSaoIznAH+kfZYIl6hmbkc5 zQNsEc9R4rgDczduGp1qSBeyF1iE6T+dJ0Zkb5w4gsIpBMQkGRQinvqrxT/kJ77wqleb HiZQ== 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=5QCRn4tPGVSBDlpKH9Xq24tD7Y7fQz/BIGVpeejr8oc=; b=gxWJWscnf5Mw6dL5aM5aRzYruUXXxOnuzy0ihe39xdTXQ+yYEWXuOb3QQRbbCJhMVi a5t9SVzUdcyqV9afKkVfZD/VqiFeD0/gtZdNkovnqjA0KgguHGy15Ua/YxZvRAJwxZjr UQEhLuF+djzBCzgASaqwT3W4E0++BgDGuBP61uAjpYTH1NjCT8Q4P+N7h3IUGrHEN/oX CuDe5msoNJPTUZuapyqrXspNwOjhGHu32kIGAnIbE60KEta31jX4hMQplWd4tOmQshkp uBPP37pbRA2BjSaG3x/H9NWN+3epcmN13XVauryjdrNxrab5xTz3juRnnLulKTeMs02b zKGQ== X-Gm-Message-State: AIVw110jJKy9uqKgyhxKwXCD5BUotGk6gQICmXmfsld6Hftq74yVjICR WtRn24Ti1DzUTLYuBW0= X-Received: by 10.28.153.21 with SMTP id b21mr8147941wme.96.1499099752732; Mon, 03 Jul 2017 09:35:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:39 +0200 Message-Id: <1499099693-22903-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 149910011184061.05821671838953; Mon, 3 Jul 2017 09:41:51 -0700 (PDT) Received: from localhost ([::1]:36297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Q1-0005gc-I8 for importer@patchew.org; Mon, 03 Jul 2017 12:41:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KK-0000n6-Ce for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KJ-00082t-Bo for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:56 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KJ-00081q-5x for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:55 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so21473998wmh.3 for ; Mon, 03 Jul 2017 09:35: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 r5sm4867459wmr.9.2017.07.03.09.35.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35: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=+kKRFe/7jdaPNT+Uyjweb4zIltEquSRqd+hMrfASLAo=; b=t5obti3kY2CQm9E5HFpjGnI4OYqDiPZRuSnCWZjMOWGN3/B2ucUahzf4a8Ic9bacLb rVE1V31GZfOq76pNrUTmgcJsk6rWopvF6+mAz2Yr0UtqkKorKoZj4kHSbpyJWtpShAMF mgqw72I48RLgxAU9onSowKnuL4wQVIiAdSh6FLfeBA0lW7NfPthPPgqD22zBgFHEZmyd 3gEgDLCzWTInlsAVwoYPawV3xI9r6+NHwQ0v+Z8ou7aPvXvl/Q1q8zxkOgA6z839YQbi Bsx9yhtMwoUsvC3wPMap8v1f8/ffsX/eYVqZuBAaJZNzea/aSDe5w0vFX3mGxHSuDVT7 /VNQ== 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=+kKRFe/7jdaPNT+Uyjweb4zIltEquSRqd+hMrfASLAo=; b=GmUhJru2gps4+gJCLi78VduP9mp1mehWuqnKV7keJqjNQ3MSQrXu45bQIZnGSOSJXO OrrTZW1McBhqRb/dxUC4za79W4RtvrfmnsM+9ywPbO/M0ZVJmJ6Vt0GQQfKXUCI5b9WK ZsfO9o6p3h+C+pqTdVf1O3s5gAnvewEu2eM7AN+MvVvK91Ny/qbuqoKfdbLRt9jNTzkP EDuC5GmtLkuOC+TXvt7c7c73kVSPaXwHjQE2+JZlYoH/4ojj/mv0VdFfQ2zXUFSNW9M2 ekdDxOTf/mcGb8iyBfOT/UHyxVzYTIykmrdQTIQ01590teDSp8QFvofOBEedHef5OPj7 gmCw== X-Gm-Message-State: AKS2vOyzKO3J+QeDWyRX+4Yi6kp7IYncyPPgfI1kMdYiPkJyF6YyF8da k5FmHKH33GW80db2vmU= X-Received: by 10.28.137.146 with SMTP id l140mr23925622wmd.101.1499099754008; Mon, 03 Jul 2017 09:35:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:40 +0200 Message-Id: <1499099693-22903-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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" Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499100177257471.6155501094985; Mon, 3 Jul 2017 09:42:57 -0700 (PDT) Received: from localhost ([::1]:36300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4R3-0006ct-VD for importer@patchew.org; Mon, 03 Jul 2017 12:42:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KL-0000oK-Hd for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KK-00084y-OR for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:57 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:32801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KK-00084A-HZ for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:56 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so21514843wmj.0 for ; Mon, 03 Jul 2017 09:35:56 -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 r5sm4867459wmr.9.2017.07.03.09.35.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35:54 -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=kMS7WBjucsljnD/dbwvMIt+udsARuLnGkSsPYUZsHfc=; b=b6A9wkXpmFnHtZdrNe5dBQ8T14bXOcUPfz0Uk5APsi8F+PHXM6lB49zPsxmm3nTLC/ TSvg2a6eEAQrVW8XgnMUF+Pn0NIKe9AuH0i82SsuCdspKrYwsQ8Bo2tzWZv77Wl7Xrja jeazK0Vob22U7114cXl81J8Ch5aYyoTQ3DoPMaI0jUShon4XwDv6N60MlH0AOkJlocLP XhfG6+wyOncp3EOAxoJX12Jt0CpMwT9xvAYdOZgNrlQtzJfURPCKO5FF0SV8lZsjX9wJ RypAjyg0VD/y/yzPrIOzhrzDzvqSqmqis3z5zSJh/R5WyHNbKVcsMqcxvucIuq5f33Tr 1hVA== 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=kMS7WBjucsljnD/dbwvMIt+udsARuLnGkSsPYUZsHfc=; b=K/idb0IAbvUhvOw/MD39gUUWEk1MQ033ZqsOr6IGVEZYMWdJVlmyfxNzKvEDoFgX/e QUJ5B+HMiRmwEe/lrT5HnDQ2AcTNK0O3Qz/ZX4AOBe/JJbs9lE38EK444FOI2KilbZ6l jMUgMQd6r13O01edW1Wb4yFddY7BphCh8n+/EDzd7Iju4so4gmC+IFXMpOkGTJ8iC5P+ 577pUCS+zAmTT1kDA19YZyxphbAX8E9PII+ueVqPUNF2Jd6fgJ8QplvTG+58mXJTQ+fT 8sNUefL+wRgf5KBm23mqMMRAK0y0LxfExp2v34vKdqmh5UrIsCyMMZFAYmXguP+vhFs+ fakg== X-Gm-Message-State: AKS2vOw0SUJCoWeRqAY/OtbZnfIljYsbQLAZH/WwQgZ0y+l3QErP+N82 dwFYRfKpmC5aA8hfwv8= X-Received: by 10.28.203.79 with SMTP id b76mr15798222wmg.81.1499099755349; Mon, 03 Jul 2017 09:35:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:41 +0200 Message-Id: <1499099693-22903-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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" Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499100322451911.4513059945205; Mon, 3 Jul 2017 09:45:22 -0700 (PDT) Received: from localhost ([::1]:36309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4TR-0000N3-6T for importer@patchew.org; Mon, 03 Jul 2017 12:45:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KN-0000py-18 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KM-000866-7m for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:59 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KM-00085X-0B for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:58 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so21474206wmh.3 for ; Mon, 03 Jul 2017 09:35: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 r5sm4867459wmr.9.2017.07.03.09.35.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35: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=m4P4pffAz2ucw1wUV0HkXbEwLvlDKqXHKDfQZrt0OM0=; b=Vn2B9Ka5sUwyiWpEBlE8QDTIsdYaQ+rhnvnVyCJTrFp1WiAh6M6A3qd1NizWqN373N 9DQgTywS22dIW1RlcWOAPRgo/DWV40XF9ZGYbcceJLXfDxZXSKW4aQOiSpzqzC1WKZzy kflIaQiBQx5iu8sya6hgFrMgO5GsMalwBhpbR78tcYAEr1rmG9BO1YY1kaCyV7vMhBNN 4ibFIqS1qiUnlzpNrv0Y3G7QZ0Zsh8tpnLsHyiQ0zuhBj19hMYupPwWIH/lhOzdFc0jn yv3WffhgjbJlxlPq1RXK9hWUrz45PkOS0cPLKwe4eutmcZvMXqkLZd30Ky+bezUNf5GI Jmgg== 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=m4P4pffAz2ucw1wUV0HkXbEwLvlDKqXHKDfQZrt0OM0=; b=cKMumKULXVxjDrEi0UfDuG4hd42oFQutHYx/aYjlPaVvhKsGBpHJyVH/C+ElOtNilf sx2ase3n2IXjhPWdBiMmaFoFpJjh2WDi3fnmMeauUjj4JCTL2E0QH2Xy71F1nFdlNnhi IW2a4nIcSfaxjJWShWzXSO3259A47y9mOAK07fnE/fAtKeqtRMnJsP3ZuyHM5MNYAPYZ 3dKjpp/LRPOaSHRK/yVD3N/+kPfGZq7wHKNDi7YDwzzU4JWaZXgqyHobrP4MCMaMm45c 9Xjy6KIuhOAuTUmd5klqRIJzVmuKEMJHPKOzsL4Ca+8Cv8f937GLQBVbly7/p5DZqhT6 3TNQ== X-Gm-Message-State: AKS2vOw4UaNa3+hjjplTrFKJwvCV4GcMJCnKAUlybysZyQ674SYwto/U lJSAmmyiCxgHy/gwuMk= X-Received: by 10.28.1.81 with SMTP id 78mr26076837wmb.100.1499099756774; Mon, 03 Jul 2017 09:35:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:42 +0200 Message-Id: <1499099693-22903-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499100153497967.924513857712; Mon, 3 Jul 2017 09:42:33 -0700 (PDT) Received: from localhost ([::1]:36299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Qh-0006H6-8E for importer@patchew.org; Mon, 03 Jul 2017 12:42:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KO-0000qz-Cf for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KN-00087f-IK for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:00 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KN-00086o-Bc for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:59 -0400 Received: by mail-wm0-x242.google.com with SMTP id u23so21542451wma.2 for ; Mon, 03 Jul 2017 09:35:59 -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 r5sm4867459wmr.9.2017.07.03.09.35.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35: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=Ex2DPmJmRoBpcEzb8KdU3KCNwWWorF93AR6SYasqLsw=; b=A8tvUV2CEGKeKgRfukfUKHEPl/QJN54fIMvvc3tJvMeqlKpWDwZ4Z/ZAcvo9u0yt28 WDmvdbn4Ay2UWkjZlhP1Q2hwnk7z+i6NvduvSOPD2X3kEBToxnXK6Tjs21avgKFsVtJY 5aT/MkB04uj9bvi76BdTOiCFVeVPV2KcNkiB0/9qjcFoiI85SRI7WyxTc0dj97MHb74j W58P9gOIAyJHrAobyk5j3Nhn9HM53z+CwCF6roA+8XQy6xgRCEogyZr2qdfp70mDqR7e XM26nd1ejCS4oSrPixlOFcCcyJiWce2Piq0QSs00ZW83Qsolgiz0070dle9esA491dnR NnXQ== 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=Ex2DPmJmRoBpcEzb8KdU3KCNwWWorF93AR6SYasqLsw=; b=CLVfTUcUux1r2ZegxNALRyjfY8HmQ6p3ZhtFYVcBE/jhtGFid3hBJsZ2TKkb2Ye1Xn nX1gXQHFnS7J9svk2yQ8+9z6FPko8KeEJ+14klVOxcx0z/Iqg1Rqp3vwcnU6Xl5whI9N lFUMOih2DwNUBYBTEd/2do3lqridWwKFmBjlf1W90WhtvObrriMrqru2+Shim+jl3W9+ SmlVLFumCkxU3vgGEP5q/WFa8Himlkyw01Kl/MqjyUvNzJfdD8dmKsCvvbISTJXVr3P7 c+zsvIh89OTsMMDr0QLAzrbIewqZgWDThal0OV9SjKYwXd8MyHvxMkADgnMy7RwFlp0w Qfsg== X-Gm-Message-State: AKS2vOxTW6mEA2En+aleDOWgXZ90lb72+b5Xw/g8W5Om71/eoxIDE10O qJBK7tCvIJLqMQ6PBA4= X-Received: by 10.28.134.11 with SMTP id i11mr24565594wmd.77.1499099758104; Mon, 03 Jul 2017 09:35:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:43 +0200 Message-Id: <1499099693-22903-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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" Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 149910045810755.64197079845644; Mon, 3 Jul 2017 09:47:38 -0700 (PDT) Received: from localhost ([::1]:36321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Vb-0002Hn-Su for importer@patchew.org; Mon, 03 Jul 2017 12:47:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KR-0000tp-L7 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KO-00088L-Q6 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:03 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KO-00087u-KG for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:00 -0400 Received: by mail-wm0-x243.google.com with SMTP id u23so21542657wma.2 for ; Mon, 03 Jul 2017 09:36: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 r5sm4867459wmr.9.2017.07.03.09.35.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:35: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=uY8b1+PsQay1HxMJulvbKsNHUBC91JB9HVcxSfUv8ac=; b=Od12/1MJwUy1YsVuq2EiCZmHlWuyMoCmyCqKCZRtcdXI+76JTkxPR4GicuVtdtjKgO LI3EN9PWaZ1kj23joPRctJHKhprYRbt8YFwSwbKY9hVKV7MlAQ2s4BcHwMEP8zBwhQYC +peLIjWs6jD4oPsw0qt/nAHhvL8o5Rblor6Fnda4HBc1IGjQhYX+HY7EWRo+q7Io6cSC nYaxKrDXUC5jAKAI1ztY7Tb/3kKnac2iE5Tz/jeubBjHc6xkMboYyxumrAMVQHrKqrYb 8Nt1r7G43VaXeyTlfINeUfHQjwxQLwC2bQn8SFg5+3XD55rF6q93Jssfmxhh2ttrkLjt lq9Q== 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=uY8b1+PsQay1HxMJulvbKsNHUBC91JB9HVcxSfUv8ac=; b=MBgCz3km6pgPlUM7Lp+AubO+N0+QtoPuWFYP2qIRVc8epJPDtM2KFQ2ZP0wOsCVwga IYriMrx9SBwa4EVhp8/uea7xeD9NLHIKx1XaR2ZHz0A+QX1T1tNgS06XZtPx7ssl/5Y5 n+1oUM74BzeBtVgnRbXyd9uYGLmP9ELHpeCKyI91AfITlK7nuBB185qCUaO1eDya473h Jo1gJQBS7fd52817w/CvnVVBXQmlg7G37w9EuZbXj/78XAez0OVymtaKetZUt3Hpm8TO Gt5jp6hTPscplLhCLiw6wqA3ikvHfDq8kRCcwciwFFBGDftJSycSl0TMjgrro0s+t07o kpcg== X-Gm-Message-State: AIVw110lfRXb8vgvyKn2BIetprdSBPfg9qc4R/BUVKVsFd2b+IUL+7pV EkcAWprbD2dYanrc+xs= X-Received: by 10.28.88.3 with SMTP id m3mr10491079wmb.28.1499099759408; Mon, 03 Jul 2017 09:35:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:44 +0200 Message-Id: <1499099693-22903-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 149910030398783.95518160803852; Mon, 3 Jul 2017 09:45:03 -0700 (PDT) Received: from localhost ([::1]:36308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4T8-0008Vr-Jv for importer@patchew.org; Mon, 03 Jul 2017 12:45:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KS-0000u4-5K for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KQ-00089C-OZ for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:04 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:32816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KQ-00088g-Ea for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:02 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so21515404wmj.0 for ; Mon, 03 Jul 2017 09:36:02 -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 r5sm4867459wmr.9.2017.07.03.09.35.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:00 -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=x7GMlo2GQgQYo8ic4q/+ne+DVivaNTd+LDRdAJvpj5Q=; b=m1tZ+HvJ9scXBkp1FiYRxhh92Phvk8tciqPQmN66+Wn/y8SMtrxSd6tGaYLNuZ3ScM vdgJPJ7IhBaj9noIdbCMv1m//DicaHVo1c7+RgTTXDOomoT2uUyweba/N0VmPB7bb7Eu pbShHAl/9oz+Z97KLHOptl/IKsP/Ws33Xevo9CvlwPzyqpptbZOUlbchyM+13t5IJjbD IOjY0FL+LcvaOhUD2gZQNyP94A4DetCCuwufM+WfKQ+8stuJaP9EC2XXF0dG+3fdsln5 zANURoiejUGJjufSdxAzfgSbnEf2Bmw58D6HgvxhM8zf1q4/cWcEvLGD1En6ln/xGVsV Un0Q== 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=x7GMlo2GQgQYo8ic4q/+ne+DVivaNTd+LDRdAJvpj5Q=; b=Uxh6qGqbFgZakOZ5Inbd8pgTVsYmXpkUTs5RCBaWq++ZJumJkeD1tr6BW2aQ4cSpqT WSfUa/mGl2f62rLaEKy1ZxRRgJDCS5CuArnnV37dXB0LyBBfK9vd2/ZwLCx7M3E2nQDf CsNHlNNyXwPjN92Mr5xMdxFDRxUlfmxycm7FPL2UwZFbKuZmjGqWXbjqgLsI4vNb2wiB 7OBio7Vp9UqFhlSH2QtPJYJ86J9u9zYTtG0lEVx7tUXhyodUNGzb6dJHwT+GRTi45j5z QHUj6oWQld57yHTmX8+hWLHCIiI4P2eEVl6+FiyjSwUE2rwEld7Hq1lrGtelSGmEVO/x decQ== X-Gm-Message-State: AIVw110Uq3J3rXWTbImquDTMi6fkVHjc8ymPqKyvhHhgE0MMusSe5bVO VzSpHneHnVdZffH0kPg= X-Received: by 10.28.125.3 with SMTP id y3mr12206871wmc.31.1499099761176; Mon, 03 Jul 2017 09:36:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:45 +0200 Message-Id: <1499099693-22903-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 --- include/exec/cpu-defs.h | 4 +++- include/exec/cputlb.h | 2 +- include/exec/exec-all.h | 53 ++++++++++++++++++++++++-----------------= ---- include/exec/helper-proto.h | 2 ++ 4 files changed, 34 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() diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h index 954bef8..417c7b0 100644 --- a/include/exec/helper-proto.h +++ b/include/exec/helper-proto.h @@ -28,7 +28,9 @@ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), d= h_ctype(t3), \ =20 #include "helper.h" #include "trace/generated-helpers.h" +#ifdef CONFIG_TCG #include "tcg-runtime.h" +#endif =20 #undef DEF_HELPER_FLAGS_0 #undef DEF_HELPER_FLAGS_1 --=20 1.8.3.1 From nobody Tue May 7 09:01:39 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 1499100259747244.1667469778838; Mon, 3 Jul 2017 09:44:19 -0700 (PDT) Received: from localhost ([::1]:36305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4SQ-0007uj-9J for importer@patchew.org; Mon, 03 Jul 2017 12:44:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KS-0000u5-RE for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KR-0008A7-U9 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:04 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35804) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KR-00089X-ND for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:03 -0400 Received: by mail-wm0-x242.google.com with SMTP id u23so21542973wma.2 for ; Mon, 03 Jul 2017 09:36:03 -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 r5sm4867459wmr.9.2017.07.03.09.36.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:01 -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=UDc9OoOs042EIvM7r85pjR/zpzOEZgAwpD4OxLWmHHA=; b=OVX8kO975fC9RzvY981D7NYpTOGx9gQyqRq+KrZxPPky7/UqbSo8fTeWnrxQ6QJgyz V989TdrxnNuZdcjYAs7QbgjNIR714rT+1RuwR/GkeSpR9a0rlXXbD/TlmFAQND+Q83lN comqtFwFPwDj5Ev9A8zAqLSBRjht1Mrm73haF58SM8ZTPPsMD+3O6E5lUFEUEBNLZnZQ fedKdHUfS7ViwUTHQrG4p7vFVcgp8zXPo3jywYNn9+ADVSZxrNT5Fhra9z9p8NHHFbVg n3qoLyJ2aKUWsyzn5VLxTwn2xEpWPsc7jIktwGKp9/eSNRT9If5+niJ6viVweC0Y2t9N G0MA== 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=UDc9OoOs042EIvM7r85pjR/zpzOEZgAwpD4OxLWmHHA=; b=WGyBgtDzBv0NBT8xTcgzgzoOybQwmIdMIt3TLndJWxQ1b+TGzAx6YLOqyYt6BV3CJF 9bgB0DN4mJpB6gHU9fGK2+ArBgQuD9i/HWofilvgfARn0490atoiICsq4U6kqyRqAhLo Kd09zNNGJiDzwTRK+rlWheEUSr1w/j19+DaJMJrSUroJtiKp2cekFYTySgAYkUa4peym wAFIR/MbyGvvbRoPLfGMg4hmkcIZQAlOBF/MIWWPy8xLHdd3uaKoFYgXPo1/O1hKSWDe yeuADM2hfj4ur1d5d+EQo7lqZOfmOzgqVVuH8XeYLzDUFCfpsetPBoN/4QioFeqzamAQ wsuA== X-Gm-Message-State: AKS2vOzW89eDCf8QPfcWIAVvz++fvaRUO0m1oEBes3c738Fw1Xm/BFlv rsfdWFQZoePdU/+D/HM= X-Received: by 10.28.214.71 with SMTP id n68mr14699075wmg.75.1499099762517; Mon, 03 Jul 2017 09:36:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:46 +0200 Message-Id: <1499099693-22903-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 1499100613795928.2907807075709; Mon, 3 Jul 2017 09:50:13 -0700 (PDT) Received: from localhost ([::1]:36333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Y8-0004fs-9T for importer@patchew.org; Mon, 03 Jul 2017 12:50:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KU-0000v5-CQ for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KT-0008BT-B5 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:06 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36646) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KT-0008Aw-41 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:05 -0400 Received: by mail-wm0-x242.google.com with SMTP id y5so21474819wmh.3 for ; Mon, 03 Jul 2017 09:36:04 -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 r5sm4867459wmr.9.2017.07.03.09.36.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:03 -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=PUSKrMDQEWgAcAp513B7tbCS3LBudXglC8NX6HnDp7U=; b=hg1YzAwVruMgKQHNsITafCel7Jt+fgc7dCSiMyNQzKHTiVWp+7RIAmfcLA3Kl2zWsD ARAsMJzN9u7SkW8Y7e1kDLEODoqAZ/NtIvZf3XmCOSoQKXud2cblyW+1khH9lHbthceg rJ6P0aaLfjwHuFHR8unGnCBn/7nYdExHnNuu2gk0TFHWiXponSm+zjkAbDS6vlDgmcsJ 0v5kfhq2wOxUn8pGO3P48bmISblYsVMaz6Leo40YQUx8XHqIYdYasxI67OVkdIC8SmiO Qwj6g5dM3x/58OfsSzmG7jcHe5fIEl9QZb/A95wOqU+eZYX69syxyKiOPnU2hZkSKoui cjjg== 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=PUSKrMDQEWgAcAp513B7tbCS3LBudXglC8NX6HnDp7U=; b=O/2zI73Xnzn9UmuD6hT89tTSjmvLKiMCGQBemCBS+NpalTSWk/3hkWXhzG26Ej+mU7 nq32yKIpOLnXQCGKC18oAGL0XHYSY/EwcLU82HDj0Omi6I10TwWpGj4Fi8hRSzOWzCoB bMgtQrjHShH9rnISs1VsV9QfFzRtmX6LDByr7byuHJOllSr5nLYVSGoz/AZr6n2fXCji ppwy3jvalSY4E0jr0eiWAUPXVZery8LAwSz6QBro1Iq9M5BPZnWLXnRJlwYd1hnSGSbg zK5DnPXqUwGKTnVHzRMUG2zTT8Smn5puVcGFlsa5iOksKoBxzbL5awiAUDLzEXoGv3H/ K6vg== X-Gm-Message-State: AKS2vOykznWTzWY7G4u8/tzQMIX1hwGT5r5tVKIWb3HBIDcktNIY1Xhj wPnjWv2BiYi68tjFwsc= X-Received: by 10.28.182.137 with SMTP id g131mr25205066wmf.95.1499099763854; Mon, 03 Jul 2017 09:36:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:47 +0200 Message-Id: <1499099693-22903-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 --- target/i386/helper.c | 34 +++++++++++++++++++++++++++++++++- target/i386/mpx_helper.c | 30 ------------------------------ 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index ef05059..87fd705 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -29,6 +29,36 @@ #include "hw/i386/apic_internal.h" #endif =20 +void cpu_sync_bndcs_hflags(CPUX86State *env) +{ + uint32_t hflags =3D env->hflags; + uint32_t hflags2 =3D env->hflags2; + uint32_t bndcsr; + + if ((hflags & HF_CPL_MASK) =3D=3D 3) { + bndcsr =3D env->bndcs_regs.cfgu; + } else { + bndcsr =3D env->msr_bndcfgs; + } + + if ((env->cr[4] & CR4_OSXSAVE_MASK) + && (env->xcr0 & XSTATE_BNDCSR_MASK) + && (bndcsr & BNDCFG_ENABLE)) { + hflags |=3D HF_MPX_EN_MASK; + } else { + hflags &=3D ~HF_MPX_EN_MASK; + } + + if (bndcsr & BNDCFG_BNDPRESERVE) { + hflags2 |=3D HF2_MPX_PR_MASK; + } else { + hflags2 &=3D ~HF2_MPX_PR_MASK; + } + + env->hflags =3D hflags; + env->hflags2 =3D hflags2; +} + static void cpu_x86_version(CPUX86State *env, int *family, int *model) { int cpuver =3D env->cpuid_version; @@ -1302,10 +1332,12 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAcc= ess access) env->tpr_access_type =3D access; =20 cpu_interrupt(cs, CPU_INTERRUPT_TPR); - } else { + } else if (tcg_enabled()) { cpu_restore_state(cs, cs->mem_io_pc); =20 apic_handle_tpr_access_report(cpu->apic_state, env->eip, access); + } else { + abort(); } } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/i386/mpx_helper.c b/target/i386/mpx_helper.c index 7e44820..ade5d24 100644 --- a/target/i386/mpx_helper.c +++ b/target/i386/mpx_helper.c @@ -24,36 +24,6 @@ #include "exec/exec-all.h" =20 =20 -void cpu_sync_bndcs_hflags(CPUX86State *env) -{ - uint32_t hflags =3D env->hflags; - uint32_t hflags2 =3D env->hflags2; - uint32_t bndcsr; - - if ((hflags & HF_CPL_MASK) =3D=3D 3) { - bndcsr =3D env->bndcs_regs.cfgu; - } else { - bndcsr =3D env->msr_bndcfgs; - } - - if ((env->cr[4] & CR4_OSXSAVE_MASK) - && (env->xcr0 & XSTATE_BNDCSR_MASK) - && (bndcsr & BNDCFG_ENABLE)) { - hflags |=3D HF_MPX_EN_MASK; - } else { - hflags &=3D ~HF_MPX_EN_MASK; - } - - if (bndcsr & BNDCFG_BNDPRESERVE) { - hflags2 |=3D HF2_MPX_PR_MASK; - } else { - hflags2 &=3D ~HF2_MPX_PR_MASK; - } - - env->hflags =3D hflags; - env->hflags2 =3D hflags2; -} - void helper_bndck(CPUX86State *env, uint32_t fail) { if (unlikely(fail)) { --=20 1.8.3.1 From nobody Tue May 7 09:01:39 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 149910030049415.261556550587215; Mon, 3 Jul 2017 09:45:00 -0700 (PDT) Received: from localhost ([::1]:36307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4T4-0008Rh-VC for importer@patchew.org; Mon, 03 Jul 2017 12:44:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KV-0000wh-Oj for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KU-0008CV-Qo for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:07 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KU-0008Bk-K3 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:06 -0400 Received: by mail-wm0-x241.google.com with SMTP id u23so21543258wma.2 for ; Mon, 03 Jul 2017 09:36:06 -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 r5sm4867459wmr.9.2017.07.03.09.36.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:04 -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=xqDPrBb8B8sO5C+yB47wuivWZFOry0AE7NT/jDWQEwQ=; b=BeabKwNa2O9XMqJbmTsTGNyOHHJXK2RFX4YH8oLbifVoRIOjJWiyYdkYtCrKoTaXcc 6jckrR3hXEdBHalE/XBpLNCtckP6oEBv3GUvwHtOzEcbZwFne8EYnYsybbr5vw6GAFIJ NFjVq3bTlLhthz2x+Eke0vOJ636t6aoKjH0aFnYNZ8h/lIy8+DQhmYBa9Zppbb6nYq9u aHzXztvQHt+k9zTu6b4mIHvlpy4NTLoMGS7S2mMW23hdJ1sRgGiXab4kXW2jh2UtQ7ii ErhSOgd1YrgI2O68ipe/qJ/YrFh4LNPKworJDYKqJwfaabKD/omqz8ckZqqJVW+1V3Cu +48w== 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=xqDPrBb8B8sO5C+yB47wuivWZFOry0AE7NT/jDWQEwQ=; b=n2wkDZMwkfeuVM/W6Ks+ctFIPlKlOleVy09Vbd3iyBMOMn8Nvr+WRlbbVIAXN2bLJr lyFrbB07EY02HbKZ9zCLIXiLTIsfyWLC7ow5vQQug2PQi7hj2lrPwg/uGGY9pdAkO6wG urZj2bDCRmYNHpnUOmZ1O0fhvup8fVjp1AxARhMVIE0ZQoSiwk2o9kd//dken0Xn2xme NDFErpYn/GFneVLErBuNtCrrrKPFw/PcvWvgfCdwBB1I7FpH5//mqE+lhRPiGnNun8Uo J0UzwurjiAAWoLaq6wChzJMCSQ6lwyjyGf3OcJZnN4R0fimoOKZrnczSSwPOQ3RG9Nu+ XRpQ== X-Gm-Message-State: AKS2vOyT5j53hP+IxWwMUIsb57j2OJM6KczZ9f/dpNgUC/Z5VIybiOae 1RKLGEdXVRnCoTpNG88= X-Received: by 10.28.68.66 with SMTP id r63mr15119185wma.120.1499099765270; Mon, 03 Jul 2017 09:36:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:48 +0200 Message-Id: <1499099693-22903-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 Tue May 7 09:01:39 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 149910075465476.06260011737186; Mon, 3 Jul 2017 09:52:34 -0700 (PDT) Received: from localhost ([::1]:36352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4aP-0006pT-Dn for importer@patchew.org; Mon, 03 Jul 2017 12:52:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4KW-0000xe-SR for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KW-0008Dl-4b for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:08 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KV-0008Cy-Uf for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:08 -0400 Received: by mail-wm0-x243.google.com with SMTP id u23so21543406wma.2 for ; Mon, 03 Jul 2017 09:36:07 -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 r5sm4867459wmr.9.2017.07.03.09.36.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:05 -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=WCiG1q4FT5mLtXw9L8wYE0HKhy6V2ZNVSRomxCX8tBg=; b=WTadG+c1wtpGygh3lkgweJB6hB+0waz1DcnlGlnA2xuAtRRsOYD7NCbmwXa65IeBMp 9bp364b5n70V2BZ3oBsg0Lbzyd5Pw8Loex1UTzXvEay4BnnUV7CMB77aA4FMBZrpr8Zd roWDu0C/pBp06qGWR44IRzxtUwUD+mwMRRE4hk2Y1lHHpp4bwIGhhAXgWByqsLN3HcF7 lFTfLcpZuePmFWgUZ9Jowb13W+fXtjiwAEuLqaXq7VjmkEfedoPCJywlubs4YWwiu6mX UjWuduqx0hfRSgt0vpyeWVyHz41DLf24Vn/UG7gY/npG0E/TA4IYzASA11tvYQ7x7uew aXKQ== 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=WCiG1q4FT5mLtXw9L8wYE0HKhy6V2ZNVSRomxCX8tBg=; b=IMKPDwKo9n0B3nO2b1zfRhMaLHqW4q3xjWYvs2ZJlKoiK1ytdyDutpWFWaxXzgRIXi f5gtH5HYwSaXMBNreTvwPVYsl55L2RE4Nyv44W8dRQT7uzxkccM5EWvFWSg9uL2AZkbF 6spAAifsHwAjpQK1NwEUnyoMd6HpWjn0s+NH0eV1MopCHyt+xcJvPvdWycI9U7kThh2X 8w3KgyY1Ye1q2t+3eOtOcN+ogF2xG8Mt0ZwZ7sHDFTC/z5tR691/5SZ/OoRTkzetBs5x O6obFoekfbYkGjXxnRVvJPSsL4HeQKTZgKXgT3pVeTwOhRYdblgQVVq9GkveGcBgt9DM /Q6Q== X-Gm-Message-State: AIVw111+Qg2abQ37ZbUH6LVtdKiJAFSQu0ppSkbuyo401gDnTIGnth2g O6bATxbNywaSOrVH5xI= X-Received: by 10.28.52.133 with SMTP id b127mr3442007wma.2.1499099766721; Mon, 03 Jul 2017 09:36:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:49 +0200 Message-Id: <1499099693-22903-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 --- target/i386/cpu.h | 18 ++++++++++++++++-- target/i386/fpu_helper.c | 11 ++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8b3b535..67a6091 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1643,8 +1643,22 @@ static inline int32_t x86_get_a20_mask(CPUX86State *= env) } =20 /* fpu_helper.c */ -void cpu_set_mxcsr(CPUX86State *env, uint32_t val); -void cpu_set_fpuc(CPUX86State *env, uint16_t val); +void tcg_update_mxcsr(CPUX86State *env); +static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +{ + env->mxcsr =3D mxcsr; + if (tcg_enabled()) { + tcg_update_mxcsr(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..f0facb9 100644 --- a/target/i386/fpu_helper.c +++ b/target/i386/fpu_helper.c @@ -1550,12 +1550,11 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, = uint64_t mask) #define SSE_RC_CHOP 0x6000 #define SSE_FZ 0x8000 =20 -void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +void tcg_update_mxcsr(CPUX86State *env) { + uint32_t mxcsr =3D env->mxcsr; int rnd_type; =20 - env->mxcsr =3D mxcsr; - /* set rounding mode */ switch (mxcsr & SSE_RC_MASK) { default: @@ -1581,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); --=20 1.8.3.1 From nobody Tue May 7 09:01:39 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 1499100771586902.2181694605665; Mon, 3 Jul 2017 09:52:51 -0700 (PDT) Received: from localhost ([::1]:36353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4ag-00073o-8C for importer@patchew.org; Mon, 03 Jul 2017 12:52:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Kd-00015O-DN for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KY-0008FI-I7 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:15 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KY-0008Ef-6h for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:10 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so21475276wmh.3 for ; Mon, 03 Jul 2017 09:36:10 -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 r5sm4867459wmr.9.2017.07.03.09.36.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:07 -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=kFp7RCmf1vBW1C+/C21A1+VGNhr24oJ1Dn3fKv5NBX4=; b=uXhVO+OL60HO35Yx832pIrzpQqIg3JsJQxu7bYYKCs2klk59+M+pz9v3t8QzASoFS9 KCUqsBEPciGOwTKaPDERZfshRxx8GFNYmGZ4OCjK6DSR9P5/92L+1pifsnmHX24n5mUs OPBT8BCJaaaZ9IQg8Evd61OjbkIcvao8pxI5IfmZd9Rh2q6eceTtHEGm4ptrSzb+FW8t hesaguQd5LDu9nUtDJe7xahN3DoKWiyIe7NB4/Gajl20NKjbtlBsMeyT0GtDncm+POzP 8wMuRZElQmRfXTp4N3O6KjTjjL3PdFhdIJGy59PhxUTDZJdRcspBUqB/0PDZneghAFMR tvIQ== 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=kFp7RCmf1vBW1C+/C21A1+VGNhr24oJ1Dn3fKv5NBX4=; b=uQ0otWBfCWFm8ArQr7vlth8eHm9yg5sTMA8SSCyeq2OUGzK+9fcclSO0bZZTyqrz73 VjfjJM2LiKqvYfPInO9dBV4sqxc9rZBlqW0U3EihxfcJOcTMX4VXVcjw3FxAYjdpbAEk rtTNCh3BxYWl4P2IURNc2WZpqOUsNj/q9R4+5HMAeZCaMjvnvsiHl786UWglHGJZaemK DP5cKb6ttt/Pzk7vX5iC17krE7GqmBZGAsluTKztLsAZPrs95JJt1OaaX2FCioX1k3DL JrIJyvEupclIjaRlRp7ZEGhMHtI/rQGbpxZTa4M/fL+ryonvcbvEMuO2gfJRCiusgfp8 Jz+g== X-Gm-Message-State: AKS2vOxpD5ikAhJpLGsnV/kue46XwL7kUUAOw0kR3Oasb7IPv4N9DFKJ Yr51klUL0D+SJ/K2Qb4= X-Received: by 10.28.50.70 with SMTP id y67mr16541612wmy.62.1499099768625; Mon, 03 Jul 2017 09:36:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:50 +0200 Message-Id: <1499099693-22903-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- 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 87fd705..2ae4f0f 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 Tue May 7 09:01:39 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 1499100408825780.4570565229975; Mon, 3 Jul 2017 09:46:48 -0700 (PDT) Received: from localhost ([::1]:36319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Up-0001eH-Hs for importer@patchew.org; Mon, 03 Jul 2017 12:46:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Kd-00015R-Dv for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4KZ-0008G1-Do for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:15 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:32835) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4KZ-0008FF-3T for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:11 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so21516214wmj.0 for ; Mon, 03 Jul 2017 09:36:10 -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 r5sm4867459wmr.9.2017.07.03.09.36.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:09 -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=Z6SmLL5ry8tr0pE/33vp2AwWCvB/N3BCORZrPwXP+oM=; b=a7iowzQ7hv1sFZRying/g8f9Hz1doK+e8ZltyzVm59uLlz3t6QIke0vs4cjLVXVBVp HYrRBzrUOt8kc0QbQ88tOkG/5Wfc4t34oNH/1+sLhc0X7RWy67R2QNOOvplfDbnj2+Uh Mo3oeXzTlok4b2swqRo+mc7rbLIHdhm2sZ6YTBTBECd05HsF81T79Ck6Nv07Z2WrykBC i8u/VeqvmtIBFT6V9LPfAkjWq5/cyb6KDH2fMofclYZo80WJYtA3e8nQkEPy8dI7AKEe fCALJThQ5bWD484FgjAOeXxNDoA4uCAvDhnKtMOYy/T02IvhhqiSB0Pu6v3PpY+yNZ5F 7nDw== 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=Z6SmLL5ry8tr0pE/33vp2AwWCvB/N3BCORZrPwXP+oM=; b=sP+oCbHwaGRzk2iDwiTD0oqw4fmrKzNxGBrPDoAxJDjv7eqQNYcnV8IckAx9wiZfC6 7f+px9HxjAyIgVlg9feq/znV0m7rnfmlPXFvrKty31jpa7qHdrANkXpdPgzkvyykBvjk FGQZCwnT6F/BGd2nnWNIbE5AvzcW6dCW1kfMgO0yW/SyremWpFMwAl1OYBeKSpfYLZ8q kJ1PggEMVEpvscQ2MyMMyR8REctQS0puNQtJYcnH6+V0ZjvZKOA6CvyTIFK3HhDQiMnf kfIRveM+UZ4tChE6vaAa/YMdccaNOWUX9PUXIaI2IHbh/QVSn61zVFdgb6fd38WudrwP +5fQ== X-Gm-Message-State: AKS2vOzXwn+EEw70pMso3Jv/vh2Q9wX23EdcWT/c2SPk0Zz2DlYm8/4D 8mWkGNwr4wm/slAbnfQ= X-Received: by 10.28.236.83 with SMTP id k80mr16192606wmh.52.1499099769848; Mon, 03 Jul 2017 09:36:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:51 +0200 Message-Id: <1499099693-22903-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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 --- target/i386/bpt_helper.c | 32 +++++++++++++++++++++++--------- target/i386/cpu.c | 4 +++- target/i386/cpu.h | 8 +++++++- target/i386/machine.c | 5 +++-- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/target/i386/bpt_helper.c b/target/i386/bpt_helper.c index b3efdc7..e0fa54c 100644 --- a/target/i386/bpt_helper.c +++ b/target/i386/bpt_helper.c @@ -215,10 +215,12 @@ void breakpoint_handler(CPUState *cs) if (cs->watchpoint_hit) { if (cs->watchpoint_hit->flags & BP_CPU) { cs->watchpoint_hit =3D NULL; - if (check_hw_breakpoints(env, false)) { - raise_exception(env, EXCP01_DB); - } else { - cpu_loop_exit_noexc(cs); + if (tcg_enabled()) { + if (check_hw_breakpoints(env, false)) { + raise_exception(env, EXCP01_DB); + } else { + cpu_loop_exit_noexc(cs); + } } } } else { @@ -226,7 +228,9 @@ void breakpoint_handler(CPUState *cs) if (bp->pc =3D=3D env->eip) { if (bp->flags & BP_CPU) { check_hw_breakpoints(env, true); - raise_exception(env, EXCP01_DB); + if (tcg_enabled()) { + raise_exception(env, EXCP01_DB); + } } break; } @@ -241,7 +245,9 @@ void helper_single_step(CPUX86State *env) check_hw_breakpoints(env, true); env->dr[6] |=3D DR6_BS; #endif - raise_exception(env, EXCP01_DB); + if (tcg_enabled()) { + raise_exception(env, EXCP01_DB); + } } =20 void helper_rechecking_single_step(CPUX86State *env) @@ -282,7 +288,9 @@ void helper_set_dr(CPUX86State *env, int reg, target_ul= ong t0) cpu_x86_update_dr7(env, t0); return; } - raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC()); + if (tcg_enabled()) { + raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC()); + } #endif } =20 @@ -304,7 +312,11 @@ target_ulong helper_get_dr(CPUX86State *env, int reg) return env->dr[7]; } } - raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC()); + if (tcg_enabled()) { + raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC()); + } else { + return 0; + } } =20 /* Check if Port I/O is trapped by a breakpoint. */ @@ -329,7 +341,9 @@ void helper_bpt_io(CPUX86State *env, uint32_t port, if (hit) { env->dr[6] =3D (env->dr[6] & ~0xf) | hit; env->eip =3D next_eip; - raise_exception(env, EXCP01_DB); + if (tcg_enabled()) { + raise_exception(env, EXCP01_DB); + } } #endif } 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 67a6091..27732ad 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 @@ -1598,7 +1600,11 @@ void update_fp_status(CPUX86State *env); =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/machine.c b/target/i386/machine.c index 53587ae..b78b36c 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -280,8 +280,9 @@ 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); + } cpu_breakpoint_remove_all(cs, BP_CPU); cpu_watchpoint_remove_all(cs, BP_CPU); { --=20 1.8.3.1 From nobody Tue May 7 09:01:39 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 1499100635386763.0786683458797; Mon, 3 Jul 2017 09:50:35 -0700 (PDT) Received: from localhost ([::1]:36339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4YU-0004yt-2e for importer@patchew.org; Mon, 03 Jul 2017 12:50:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Kd-00015Q-Dx for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4Ka-0008Gu-Ro for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:15 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:32836) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4Ka-0008GT-LC for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:12 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so21516290wmj.0 for ; Mon, 03 Jul 2017 09:36:12 -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 r5sm4867459wmr.9.2017.07.03.09.36.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:10 -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=Jfs1DvNFPu7UWUelcBB5E7w0rmqGDbFs9+afkpHlKcI=; b=LAN5MiXxtvnDv0ZgF7EYqlQjmRPC+bc6/qE84IFU2SiRbC8UEXnrR/D83p+5Yo+XoF jYV8H40lhimKndI9WOmu0LCIJwrTZxqmBgzVD/voOliLbmFGH4A7YCObSN2r8p8OdSjR BLlXZazvkskgc+nUG0X+DM+ndGAotcb7t8CGsCWqhm5XFi8XUFUnABrvtr8J4C7UE2ih eJ9m2Q2NX3HkNdtkPxVcGWaU/ySygaLt9E56+23bDbrlEmwyyQBwwUSuVjEB8FNwzt4L DPZ1C3n3HxnXQ9PIU610Ur1BTdPVn+Jd0hbFKcjKCkysoR5jeNtPClyfV3Ajg/ABrGgP yKIg== 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=Jfs1DvNFPu7UWUelcBB5E7w0rmqGDbFs9+afkpHlKcI=; b=jsG4fUKxnoWae/YLFPbK/B3n5oluwxIdh6frLmyiW1DUv6BIQfrv4P5D5Mob1H4GnW yA8CobLTw+fRU9LC9KPzBDebG7w3gJCCfT6n3gd6/Soe/rQ4MQV0eLdc5slxEFk/Qvt5 kcpPkTaypQv1+uE2LFyLPoxNYy6hT3By0hPdt7TOBhh2hnuTr/DZn8CRJKF6unQDJysE KtaqWFw32zDCmsnRVpr2BtHg/FUiKXLLqw/D7t7dYQQ5LSvk7LSW1QM24VC+/rRVVOvt ATf7RF+coofnXLKWYRqTuOFakl9UHTkf18Rksj4iTPWY5bfEk6kniSx9QUV6xzFjlloZ 2/aw== X-Gm-Message-State: AKS2vOymuRLyJp169zYtq58jxQhpy4dogVUXZ30W2KLixiThtartONfB HrD2lkIw0ReGE5DYO14= X-Received: by 10.28.34.130 with SMTP id i124mr26039719wmi.116.1499099771429; Mon, 03 Jul 2017 09:36:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:52 +0200 Message-Id: <1499099693-22903-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/Makefile.objs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 4fcb7f3..36949b1 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -1,6 +1,7 @@ -obj-y +=3D translate.o helper.o cpu.o bpt_helper.o -obj-y +=3D excp_helper.o fpu_helper.o cc_helper.o int_helper.o svm_helper.o -obj-y +=3D smm_helper.o misc_helper.o mem_helper.o seg_helper.o mpx_helper= .o +obj-y +=3D helper.o cpu.o bpt_helper.o +obj-$(CONFIG_TCG) +=3D translate.o +obj-$(CONFIG_TCG) +=3D excp_helper.o fpu_helper.o int_helper.o svm_helper.= o cc_helper.o +obj-$(CONFIG_TCG) +=3D smm_helper.o misc_helper.o mem_helper.o seg_helper.= o mpx_helper.o obj-y +=3D gdbstub.o obj-$(CONFIG_SOFTMMU) +=3D machine.o arch_memory_mapping.o arch_dump.o mon= itor.o obj-$(CONFIG_KVM) +=3D kvm.o hyperv.o --=20 1.8.3.1 From nobody Tue May 7 09:01:39 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 1499100479660125.39910949717284; Mon, 3 Jul 2017 09:47:59 -0700 (PDT) Received: from localhost ([::1]:36322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Vx-0002cQ-Fg for importer@patchew.org; Mon, 03 Jul 2017 12:47:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4Kd-00015N-Cp for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4Kc-0008HZ-96 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:15 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:32838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4Kc-0008HE-2d for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:36:14 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so21516379wmj.0 for ; Mon, 03 Jul 2017 09:36:13 -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 r5sm4867459wmr.9.2017.07.03.09.36.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:36:11 -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=7HNfiIQkUeQjqOMo94zCwfQKPt4cntAX8J2ChKV43vQ=; b=MFMgHgSv1F9i5XJERSF0ACllZgT3XBptTKtylNaE2pGYmuY1GNwN9PRe3OaPaq4N5F Bs2ZDUbTz/t87evcxAMdZsbKwhmRXveUjV9X2M/xdCTa3ICMRU36K2NLsjBnWSfBduq7 hUL0gASa0hfxJB0AlIk+V09+zL9Kgpu17ezl+OjrRzQtX/dAwLMExPp0rsUPALP210O3 +u9ZZT5cjiQpM2TZJmmz8stnuA4DGS/KiARHDCSQu1yquoQxXlcdp1wo6l4J7EbcYktu NpV+rzyYGFPu7kE6sKURuXQXGa0f67pb32PUzoijCE7TLMPmdWSOtJ8QHv78sVBZeI0F ZnQA== 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=7HNfiIQkUeQjqOMo94zCwfQKPt4cntAX8J2ChKV43vQ=; b=rJ+I1vwjk7FHAz/4UmUjv4I/b+75UmNlmtxrtXRz0U+N64xcLo7yXhHsPaG/3pBQwO 7S97W0gKrG3OIwzGVTDEo9cOgIvcpFN/BsNCvvOX6XsdJS9c3AWKagCxHGslddQYt0PI KRxoWHooqXhARVaNstGhfjT3L8wLVeTdPpYTAZoXoH8LY4UAxlSdNbZE2lS/9umEak9Q P/G/yMw1j/O6Q9sKQ9Dj1z9WcQi38EOpEEqyGMWPHf+3tYrPuX0bUJOhuN2d8u4xMzGH O7F+Qu2X1o9M5PIIEmQyBGxRRDS6iDbhRL/nzRhgHCKIptqcJEl0qWNQFTXs7+6wx87P yA6A== X-Gm-Message-State: AKS2vOwnftRvS6yKshAF2Rc8vesRO6Td7lAyRWEbH4nzN/C/ygim/gq6 UroM+BFUCh82RnpmYnE= X-Received: by 10.28.64.196 with SMTP id n187mr23830117wma.94.1499099772835; Mon, 03 Jul 2017 09:36:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:53 +0200 Message-Id: <1499099693-22903-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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 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. Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange Reviewed-by: Richard Henderson --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index cc8f5e3..a3a21d5 100755 --- a/configure +++ b/configure @@ -1766,6 +1766,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