From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4USO-0007nT-TR for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:06:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4USJ-0004Zt-Cm for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:06:32 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:35307) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4USJ-0004ZK-65 for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:06:27 -0500 Received: by mail-wm0-x231.google.com with SMTP id a197so312752882wmd.0 for ; Wed, 09 Nov 2016 07:06:27 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Wed, 9 Nov 2016 14:57:48 +0000 Message-Id: <20161109145748.27282-20-alex.bennee@linaro.org> In-Reply-To: <20161109145748.27282-1-alex.bennee@linaro.org> References: <20161109145748.27282-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v6 19/19] tcg: enable MTTCG by default for ARM on x86 hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com Cc: qemu-devel@nongnu.org, mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com, mark.burton@greensocs.com, jan.kiszka@siemens.com, serge.fdrv@gmail.com, rth@twiddle.net, peter.maydell@linaro.org, claudio.fontana@huawei.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= This enables the multi-threaded system emulation by default for ARMv7 and ARMv8 guests using the x86_64 TCG backend. This means: - The x86_64 TCG backend supports cmpxchg based atomic ops - The x86_64 TCG backend emits barriers for barrier ops And on the guest side: - The ARM translate.c/translate-64.c have been converted to - use MTTCG safe atomic primitives - emit the appropriate barrier ops - The ARM machine has been updated to - hold the BQL when modifying shared cross-vCPU state - defer cpu_reset to async safe work Signed-off-by: Alex Bennée --- configure | 12 ++++++++++++ default-configs/arm-softmmu.mak | 2 ++ 2 files changed, 14 insertions(+) diff --git a/configure b/configure index fd6f898..685eb03 100755 --- a/configure +++ b/configure @@ -516,6 +516,7 @@ else fi ARCH= +host_mttcg_support= # Normalise host CPU name and set ARCH. # Note that this case should only have supported host CPUs, not guests. case "$cpu" in @@ -527,6 +528,7 @@ case "$cpu" in ;; x86_64|amd64) cpu="x86_64" + host_mttcg_support=yes ;; armv*b|armv*l|arm) cpu="arm" @@ -5703,6 +5705,10 @@ if test "$pthread_setname_np" = "yes" ; then echo "CONFIG_PTHREAD_SETNAME_NP=y" >> $config_host_mak fi +if test "$host_mttcg_support" = "yes" ; then + echo "CONFIG_MTTCG_HOST=y" >> $config_host_mak +fi + if test "$tcg_interpreter" = "yes"; then QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" elif test "$ARCH" = "sparc64" ; then @@ -5815,6 +5821,7 @@ target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) target_bigendian="no" +target_mttcg_support="no" case "$target_name" in armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) @@ -5872,11 +5879,13 @@ case "$target_name" in TARGET_ARCH=arm bflt="yes" gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" + target_mttcg_support="yes" ;; aarch64) TARGET_BASE_ARCH=arm bflt="yes" gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" + target_mttcg_support="yes" ;; cris) ;; @@ -6027,6 +6036,9 @@ if test "$target_bigendian" = "yes" ; then fi if test "$target_softmmu" = "yes" ; then echo "CONFIG_SOFTMMU=y" >> $config_target_mak + if test "$target_mttcg_support" = "yes" ; then + echo "CONFIG_MTTCG_TARGET=y" >> $config_target_mak + fi fi if test "$target_user_only" = "yes" ; then echo "CONFIG_USER_ONLY=y" >> $config_target_mak diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak index 6de3e16..007f751 100644 --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@ -115,3 +115,5 @@ CONFIG_ACPI=y CONFIG_SMBIOS=y CONFIG_ASPEED_SOC=y CONFIG_GPIO_KEY=y + +CONFIG_MTTCG_TARGET=y -- 2.10.1