From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 477CBC10F13 for ; Thu, 11 Apr 2019 04:02:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15BBD2133D for ; Thu, 11 Apr 2019 04:02:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bChOnVwZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15BBD2133D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gHSjefrJgaIBe/WC9dAtJWzGse0FP9l3/X4V9vzVBbQ=; b=bChOnVwZPmIZZ8 +D+9MZurUlUNdr0ccwThdHMLOQacrrL5sraJpMuXCliK48Mb0s28iZojKxLNyMrmdxxU8mdY7WbGD cSMBQPLP/SXam1+MpdyyJH5YONbucIn/iT/tXGDHRAL8YtMv5dphjR4Sb17b8MyTEbe/xwHZb7wQL sA82t1MGZ+uoi8ec3aJRieELQUG0koBHCYz+7V8egWcvMDTRmd9r8ZfX2S9WHGeyVWfTobGx/+qHR bXRbbnZ6zjrK9L9U62HWYf0OchNm4DW/BrCrsQ4U4G5MJGTCIJU2CI33wCLOPmZnFz7+OI9m2s4Ok uIhRDdB+Q0CndTzqj8rA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEQv8-0001Mq-Gq; Thu, 11 Apr 2019 04:02:38 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEQv5-0001Lx-7Q for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2019 04:02:37 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C339E85546; Thu, 11 Apr 2019 04:02:32 +0000 (UTC) Received: from treble (ovpn-120-231.rdu2.redhat.com [10.10.120.231]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 303CC608A4; Thu, 11 Apr 2019 04:02:24 +0000 (UTC) Date: Wed, 10 Apr 2019 23:02:22 -0500 From: Josh Poimboeuf To: Michael Ellerman Subject: Re: [PATCH RFC 3/5] powerpc/speculation: Add support for 'cpu_spec_mitigations=' cmdline options Message-ID: <20190411040222.p6yslvypbe6lq5cm@treble> References: <91b92d8182d2f114d92c95689fcd4bb1a8dda1b0.1554396090.git.jpoimboe@redhat.com> <87pnpuwg05.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87pnpuwg05.fsf@concordia.ellerman.id.au> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 11 Apr 2019 04:02:33 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_210235_310302_484050D3 X-CRM114-Status: GOOD ( 21.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Benjamin Herrenschmidt , Heiko Carstens , Paul Mackerras , "H . Peter Anvin" , Ingo Molnar , Andrea Arcangeli , linux-s390@vger.kernel.org, x86@kernel.org, Will Deacon , Linus Torvalds , Catalin Marinas , Waiman Long , linux-arch@vger.kernel.org, Jon Masters , Jiri Kosina , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Tyler Hicks , Martin Schwidefsky , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 10, 2019 at 04:06:50PM +1000, Michael Ellerman wrote: > Josh Poimboeuf writes: > > Configure powerpc CPU runtime speculation bug mitigations in accordance > > with the 'cpu_spec_mitigations=' cmdline options. This affects > > Meltdown, Spectre v1, Spectre v2, and Speculative Store Bypass. > > > > The default behavior is unchanged. > > > > Signed-off-by: Josh Poimboeuf > > --- > > Documentation/admin-guide/kernel-parameters.txt | 9 +++++---- > > arch/powerpc/kernel/security.c | 6 +++--- > > arch/powerpc/kernel/setup_64.c | 2 +- > > 3 files changed, 9 insertions(+), 8 deletions(-) > > > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > > index 29dc03971630..0e8eae1e8a25 100644 > > --- a/Documentation/admin-guide/kernel-parameters.txt > > +++ b/Documentation/admin-guide/kernel-parameters.txt > > @@ -2552,10 +2552,11 @@ > > > > off > > Disable all speculative CPU mitigations. > > - Equivalent to: nopti [x86] > > + Equivalent to: nopti [x86, powerpc] > > + nospectre_v1 [powerpc] > > nospectre_v2 [x86] > > Not sure if you meant to omit powerpc from nospectre_v2? > > You have patched it in the code below. Oops. I'll update the documentation. > > spectre_v2_user=off [x86] > > - spec_store_bypass_disable=off [x86] > > + spec_store_bypass_disable=off [x86, powerpc] > > l1tf=off [x86] > > > > auto (default) > > @@ -2568,7 +2569,7 @@ > > Equivalent to: pti=auto [x86] > > spectre_v2=auto [x86] > > spectre_v2_user=auto [x86] > > - spec_store_bypass_disable=auto [x86] > > + spec_store_bypass_disable=auto [x86, powerpc] > > l1tf=flush [x86] > > > > auto,nosmt > > @@ -2579,7 +2580,7 @@ > > Equivalent to: pti=auto [x86] > > spectre_v2=auto [x86] > > spectre_v2_user=auto [x86] > > - spec_store_bypass_disable=auto [x86] > > + spec_store_bypass_disable=auto [x86, powerpc] > > l1tf=flush,nosmt [x86] > > > > mminit_loglevel= > > diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c > > index b33bafb8fcea..5aed4ad729ba 100644 > > --- a/arch/powerpc/kernel/security.c > > +++ b/arch/powerpc/kernel/security.c > > @@ -57,7 +57,7 @@ void setup_barrier_nospec(void) > > enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && > > security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR); > > > > - if (!no_nospec) > > + if (!no_nospec && cpu_spec_mitigations != CPU_SPEC_MITIGATIONS_OFF) > > enable_barrier_nospec(enable); > > Adding a wrapper func that checks for CPU_SPEC_MITIGATIONS_OFF would > make these a little less verbose, eg: > > if (!no_nospec && !cpu_spec_mitigations_off()) > enable_barrier_nospec(enable); > > But that's a nitpick. Yes, that would be much nicer. I'll probably do something like that in the next version. Thanks. -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel