From patchwork Fri Apr 15 14:23:51 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: 8851561 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 68532BF29F for ; Fri, 15 Apr 2016 14:33:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8715F20374 for ; Fri, 15 Apr 2016 14:33:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A38D20373 for ; Fri, 15 Apr 2016 14:33:00 +0000 (UTC) Received: from localhost ([::1]:35271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar4nr-0001Bp-PJ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Apr 2016 10:32:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar4ll-0006Nn-Ie for qemu-devel@nongnu.org; Fri, 15 Apr 2016 10:30:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ar4lg-00016i-Sy for qemu-devel@nongnu.org; Fri, 15 Apr 2016 10:30:49 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:35784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar4lg-00016e-NW for qemu-devel@nongnu.org; Fri, 15 Apr 2016 10:30:44 -0400 Received: by mail-wm0-x236.google.com with SMTP id a140so34065560wma.0 for ; Fri, 15 Apr 2016 07:30:44 -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=pmT+8eRv9fe/gSeAd0n4hI1WrBTFVaf6n7mgAgcsDgk=; b=NaQmr02wYj968FV64sHn8xqCwYxo7okK3yRg/PL83kehhAvn5ni4FTyiV1Nki1Lw2Y 62S3CniO1MHW3VIWptCfpD9tASz4RGBnQTeOCNvco/bD7hv+hyMI08oY11Q/p52C4NK+ rqMrPMkCI+cwdiy24bNmJllUPeAV3ui+wkjOI= 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=pmT+8eRv9fe/gSeAd0n4hI1WrBTFVaf6n7mgAgcsDgk=; b=ALkxFJ7vBsBsA58gzPkDHIIyR1eAS9048+AJTzCpj4FlGhBlV0tacCt6LUjUCVTPPe NrmQ6XhqE95cirxaeWn74BZVngsbHl8leN1LxcjaVHH9dBDYqg7mUBRsuFiGi5bIFKwl 7qF+aCE2TbiQ9BVy69dZGWVYSWANL/hRN3G6ALKOjCETDUXHrK6Da/T8EJ7OFXkxelso EwgHMrM/oeUfjoUM2NxCAre96XCUZi1PH25YaBBhxozpP+VXTzEnNc1VXBrU0I3WecPn 0TTuDPf/7v9Bu/Oui0pc7NNWFDGh5PgOyRKXVwG7tunszL1xXGZ6Y0bqwKofV6a6YU2k aZiQ== X-Gm-Message-State: AOPr4FWxkfy/1+JxIrz6r7AncK4CyKCRh7w56uRvWMXlHjWzrkWpdLQHdfjwmrk882+RR5Lh X-Received: by 10.194.6.36 with SMTP id x4mr22172673wjx.122.1460730644093; Fri, 15 Apr 2016 07:30:44 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id vu4sm10835242wjc.27.2016.04.15.07.30.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Apr 2016 07:30:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 507943E05EA; Fri, 15 Apr 2016 15:24:05 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, serge.fdrv@gmail.com, cota@braap.org Date: Fri, 15 Apr 2016 15:23:51 +0100 Message-Id: <1460730231-1184-14-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1460730231-1184-1-git-send-email-alex.bennee@linaro.org> References: <1460730231-1184-1-git-send-email-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::236 Subject: [Qemu-devel] [RFC v1 12/12] cpus: default MTTCG to on for 32 bit ARM on x86 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: peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes multi-threading the default for 32 bit ARM on x86. It has been tested with Debian Jessie as well as my extended KVM unit tests which stress the SMC and TB invalidation code. Those tests can be found at: https://github.com/stsquad/kvm-unit-tests/tree/mttcg/current-tests-v5 Signed-off-by: Alex Bennée --- cpus.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 860e2a9..daa92c7 100644 --- a/cpus.c +++ b/cpus.c @@ -171,12 +171,24 @@ opts_init(tcg_register_config); static bool default_mttcg_enabled(void) { - /* - * TODO: Check if we have a chance to have MTTCG working on this guest/host. - * Basically is the atomic instruction implemented? Is there any - * memory ordering issue? + /* Checklist for enabling MTTCG on a given frontend/backend combination + * + * - Are atomics correctly modelled for an MTTCG environment + * - If the backend is weakly ordered + * - has the front-end implemented explicit memory ordering ops + * - does the back-end generate code to ensure memory ordering */ +#if defined(__i386__) || defined(__x86_64__) + /* x86 backend is strongly ordered which helps a lot */ + #if defined(TARGET_ARM) + return true; + #else + return false; + #endif +#else + /* Until memory ordering implemented things will likely break */ return false; +#endif } void qemu_tcg_configure(QemuOpts *opts)