From patchwork Thu Oct 27 15:10:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 79729 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp715255edx; Thu, 27 Oct 2016 08:42:21 -0700 (PDT) X-Received: by 10.176.1.17 with SMTP id 17mr6045489uak.143.1477582941815; Thu, 27 Oct 2016 08:42:21 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 41si393517uav.225.2016.10.27.08.42.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 27 Oct 2016 08:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzmov-0004xw-49 for patch@linaro.org; Thu, 27 Oct 2016 11:42:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzmTK-0003h9-Qm for qemu-devel@nongnu.org; Thu, 27 Oct 2016 11:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzmTH-0004QN-MC for qemu-devel@nongnu.org; Thu, 27 Oct 2016 11:20:02 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:38325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bzmTH-0004Ot-FP for qemu-devel@nongnu.org; Thu, 27 Oct 2016 11:19:59 -0400 Received: by mail-wm0-x231.google.com with SMTP id n67so51134549wme.1 for ; Thu, 27 Oct 2016 08:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=564fzkvIoVbPGzOjZzJ2lckxWLu6mW9jDl28AD6yV3M=; b=UGVBMd7CFyQAejX2yssGo4D0cChVi0LzRwy/J35bLv3rBqzjbralBIJa5NryOpVX+B JBZsYD39Kn1uOGqXLwKqkYcWzfV5znlKOmYmDcxeyaru6UjoLeHV5b17vyW37H5loLLe D+WhpBtxNwvE6HAKmTNzlGMtTO3IZF+d81Wgo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=564fzkvIoVbPGzOjZzJ2lckxWLu6mW9jDl28AD6yV3M=; b=VLxihjNmx8N7Aop3z68MRBEbOX79uS93T43oKPYuNLSENhvmjEzR6xpverHbT5LXfk gNcX5tJGpb32mZedVzqpxyyF9DvkQWgoBQEPqEsOiyXWXahIf7xlPoie/8nD5USHL2fZ bHQ+w88VzeF6TIQ2JmvneIL0WD7rqgpbbwrxsPcjrMNGV33VZdAHj5GYXl+9uHT/loSh E7HdGEp5CSh1E/uYLY4DG8VJZwER6u+P6xPPqYBJl6z6R5sdXmvK6ntFgugYUsXWnd2h zdi5bnt8WJze/0azlwzXbb8QsdMcKr7wMT/nO9Agtll+5K1FwGbdkF0GM2DH5xw0dKDe BroA== X-Gm-Message-State: ABUngvf0JFTbjEapP4wNMdhRca/dCIEj91zajTFkeVufVm9+zo+Ng/GjjOmmWyjAmzgkJx7r X-Received: by 10.28.48.130 with SMTP id w124mr13497786wmw.71.1477581598303; Thu, 27 Oct 2016 08:19:58 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id wh3sm8986200wjb.49.2016.10.27.08.19.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Oct 2016 08:19:55 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id AAE903E04E2; Thu, 27 Oct 2016 16:11:01 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: pbonzini@redhat.com Date: Thu, 27 Oct 2016 16:10:30 +0100 Message-Id: <20161027151030.20863-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161027151030.20863-1-alex.bennee@linaro.org> References: <20161027151030.20863-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::231 Subject: [Qemu-devel] [PATCH v5 33/33] tcg: enable MTTCG by default for ARM on x86 hosts 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: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, nikunj@linux.vnet.ibm.com, jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, cota@braap.org, serge.fdrv@gmail.com, bobby.prani@gmail.com, rth@twiddle.net, =?UTF-8?q?Alex=20Benn=C3=A9e?= , fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.10.1 diff --git a/configure b/configure index 91a14c1..2043436 100755 --- a/configure +++ b/configure @@ -515,6 +515,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 @@ -526,6 +527,7 @@ case "$cpu" in ;; x86_64|amd64) cpu="x86_64" + host_mttcg_support=yes ;; armv*b|armv*l|arm) cpu="arm" @@ -5614,6 +5616,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 @@ -5726,6 +5732,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) @@ -5783,11 +5790,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) ;; @@ -5938,6 +5947,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