Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2449718yba; Mon, 15 Apr 2019 11:53:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0g4JBlcc4g273uo/+S3v7MbZ9RCmjr3zmhNq1dRDfzXryrCdhnGbuLMVskkyFabkbWRha X-Received: by 2002:a17:902:7c01:: with SMTP id x1mr51369435pll.299.1555354408641; Mon, 15 Apr 2019 11:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354408; cv=none; d=google.com; s=arc-20160816; b=Zy/KIFq5edePTB/Q9wzUjQW/cCxfLLfDm8GiU3uP4B5G76g+YyOK1A0D0I74jY0xOa FD0X23VTNtsZX5BXA1PHdP8rl9SMywosx5stmGkiCb2rsZr1R1wrraiRW+G9oU9iYFm8 xbt4PpBBinxnBBhl2JZbJBAl5VH3JhbGjadzdQUHEThY4t6WCFFAvzom5X5us315RpGv yVK3UkTTVPBiTSUcwLMqqoAVQ5y0vee/ZDzU8rjCfUJYIsNjkPOfsap5nvc7QfChhVkQ uWxEwSibTqoQbKeSX072H0s2Xuk8LJ+N3xzwajdmJbwBbwRP5QUoTw/dBpnbtFdclm3W AJxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WtYU3VZNUtI9klxmihVDS+swqIUX9rNSQFWH+q2p4ok=; b=Bsv8EOlt852q7oB679lXyPXuxN1RXIrCzMbOIbAP0yZjJoTU/GUp16rzITDHQenwiS ExnMn5EGrSPmeI1k8nwmOIRy57CQ34080ardv/MXlO16lGY2Fg+cX6hbOUtvrH/uur1O vB+vWgyRWztDLlUhvuxtcXUlVX9mpMx2h7XR+iHDyuSNuhcV5fBetOSVrFmhSRNaDcPp 91SVolDIBjlH78fUxExsyBfkNTIKbcLXopGqBrP4RXnNElvmnEKVfa6CB55REQTyiy9X VpNAUbE5uC+C+Ow5g538vdg4pQHABXhkR7oxo/pslK/UmaIwPbw5LETP5fXRmqaIevbW vgNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eqpNPBru; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si13186908pfc.92.2019.04.15.11.53.12; Mon, 15 Apr 2019 11:53:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eqpNPBru; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728868AbfDOSvq (ORCPT + 99 others); Mon, 15 Apr 2019 14:51:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728350AbfDOSpX (ORCPT ); Mon, 15 Apr 2019 14:45:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82CBC218A1; Mon, 15 Apr 2019 18:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353923; bh=sYQ1QMXpv/wJsV49N0KY/s+KsKF9a1gsPHX4kxWj84Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqpNPBrutPahpVeCDDo3fjtjMG2NC502kRlmc22HYxUncFwf7prKKVUQ1pho4NOkl ECofpGBhrUzAfiU9aN4jkzR3sbQX+OhqbObaClqHfvCv+WottvC04/iMXTEfkTztB6 SNjiGj/jygh+JwGHsLEJ+JasERAgvKkz1RdAupyI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Diana Craciun , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 20/76] powerpc/64: Disable the speculation barrier from the command line Date: Mon, 15 Apr 2019 20:43:44 +0200 Message-Id: <20190415183712.869759410@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit cf175dc315f90185128fb061dc05b6fbb211aa2f upstream. The speculation barrier can be disabled from the command line with the parameter: "nospectre_v1". Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/security.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index bf298d0c475f..813e38ff81ce 100644 --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -17,6 +17,7 @@ unsigned long powerpc_security_features __read_mostly = SEC_FTR_DEFAULT; bool barrier_nospec_enabled; +static bool no_nospec; static void enable_barrier_nospec(bool enable) { @@ -43,9 +44,18 @@ void setup_barrier_nospec(void) enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR); - enable_barrier_nospec(enable); + if (!no_nospec) + enable_barrier_nospec(enable); } +static int __init handle_nospectre_v1(char *p) +{ + no_nospec = true; + + return 0; +} +early_param("nospectre_v1", handle_nospectre_v1); + #ifdef CONFIG_DEBUG_FS static int barrier_nospec_set(void *data, u64 val) { -- 2.19.1