From patchwork Fri Apr 15 02:08:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 8844311 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 B0393C0553 for ; Fri, 15 Apr 2016 02:08:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1442A20295 for ; Fri, 15 Apr 2016 02:08:56 +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 6671020270 for ; Fri, 15 Apr 2016 02:08:55 +0000 (UTC) Received: from localhost ([::1]:51696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqtBm-00046E-PC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Apr 2016 22:08:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqtBc-0003zu-7X for qemu-devel@nongnu.org; Thu, 14 Apr 2016 22:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqtBb-00077E-AT for qemu-devel@nongnu.org; Thu, 14 Apr 2016 22:08:44 -0400 Received: from hr2.samba.org ([2a01:4f8:192:486::147:1]:56045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqtBb-00077A-4I; Thu, 14 Apr 2016 22:08:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42627210; h=Message-ID:Cc:To:From:Date; bh=/CSJT/w44qYt532g3SZl6jbDm0OVKjS5VxPn1dE+lpg=; b=v5PR/JdOzjArzuXq9PmFkYD7vjMIalqGoS1QCLA0o22caQC5Ut9rmtYoPU6PDSJ9zhzW918CuWWjCMqQ0Sza3bVpxfuSIeV8cp96aqA7sy0qdfzBGfQxUczbd7d/4f2Ll0V6PGDMeZOBZVL021O76ZRo0TNNMEuMWSBXQhazCv8=; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim) id 1aqtBU-0001Cz-27; Fri, 15 Apr 2016 02:08:36 +0000 Date: Fri, 15 Apr 2016 12:08:19 +1000 From: Anton Blanchard To: Alexey Kardashevskiy , Michael Ellerman , Paul Mackerras , Benjamin Herrenschmidt , Michael Neuling , David Gibson , Alexander Graf Message-ID: <20160415120819.7144900c@kryten> In-Reply-To: <20160404211112.66b0756f@kryten> References: <20160404164457.539a55f0@kryten> <57021123.6050506@ozlabs.ru> <20160404204346.1cf44df8@kryten> <20160404211112.66b0756f@kryten> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 2a01:4f8:192:486::147:1 Subject: [Qemu-devel] [PATCH 3/3] powerpc: Update TM user feature bits in scan_features() 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: qemu-ppc@nongnu.org, linuxppc-dev@lists.ozlabs.org, qemu-devel@nongnu.org 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 We need to update the user TM feature bits (PPC_FEATURE2_HTM and PPC_FEATURE2_HTM) to mirror what we do with the kernel TM feature bit. At the moment, if firmware reports TM is not available we turn off the kernel TM feature bit but leave the userspace ones on. Userspace thinks it can execute TM instructions and it dies trying. This (together with a QEMU patch) fixes PR KVM, which doesn't currently support TM. Signed-off-by: Anton Blanchard Cc: stable@vger.kernel.org --- arch/powerpc/kernel/prom.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 99709bb..5beffd7 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -161,11 +161,12 @@ static struct ibm_pa_feature { {0, MMU_FTR_CI_LARGE_PAGE, 0, 0, 1, 2, 0}, {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 0, 0, 5, 0, 0}, /* - * If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n), - * we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP - * which is 0 if the kernel doesn't support TM. + * If the kernel doesn't support TM (ie CONFIG_PPC_TRANSACTIONAL_MEM=n), + * we don't want to turn on TM here, so we use the *_COMP versions + * which are 0 if the kernel doesn't support TM. */ - {CPU_FTR_TM_COMP, 0, 0, 0, 22, 0, 0}, + {CPU_FTR_TM_COMP, 0, 0, + PPC_FEATURE2_HTM_COMP|PPC_FEATURE2_HTM_NOSC_COMP, 22, 0, 0}, }; static void __init scan_features(unsigned long node, const unsigned char *ftrs,