Received: by 10.213.65.68 with SMTP id h4csp147776imn; Thu, 15 Mar 2018 12:18:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELuaZz8zWqZ96+UIjnXt0p52TbvQKV64JOrhN+zyusospk1FW1MqTzvlkvu8R4htA2/YB9EL X-Received: by 10.99.105.7 with SMTP id e7mr7494444pgc.193.1521141522209; Thu, 15 Mar 2018 12:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521141522; cv=none; d=google.com; s=arc-20160816; b=O2ezyU3cYbEbPYJ7W33dEybYnDEpfhMkW35jx/HahtEbPQw/hLXa7kVHJ0//ZtwvnK Wy552Rs4jhSkDkPLF0uXwr6ItLhCCb4beT3ct44CmrrYQQQaUAJNv8l7HxdlhUVbJUMV WP6gM3Izi4krBW0+Xphth2Udgv9EhSj7U8LB9D3Rp1VtOfGZC5UJuYQZKlbCp83N8ftv ZaLK1MKXjPqTMVMdEf8ykjdRe1ueuRFH4JM2ieKbhGTlU9bhVpkLB2LrSMEcOz6f+/iA jrZumy4nqh6I9gz/7NDYjkr4XdMWRgnNuUeECL7nsXfhaLMXEPQGQ4tx6kf4TziNu5I3 xplQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0yTnIIBWE7fpy+1xtrqFwpk1aX5ho+G4OYcNFB0ayOk=; b=Ovkk2oQKy2RTvw/+NRVU6o0CWFIARtUIUvWx/1nKHPNf48XE41BD+3Ru2o1hHeTqRs AbfNh2XSqq1W4SxjkteAo8q7N4KV6TvK6bpl0BdxZx8GrN35v4t40+XD01qOO5SZBXfy mhzxxlNe2pE30ADbzjNllLlsTNLf65eGg6HdFmS/dPcnq3r0Fo3o/UVkb1TUYbmosJ8Q TLzJ7RYqC6Zkum2KtWYE9bbVadj3JIlm3NyG0Z353CxZDRHwMymlpcSt3ZTDokcn0uXM lk/GB1VlNWawwJfqVOjM132wwajLBN8FxV7mYr83AkT/jGnQuBBg1NaoWDdEj+cVGAR2 OG+A== ARC-Authentication-Results: i=1; mx.google.com; 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 3-v6si4488721plc.700.2018.03.15.12.18.27; Thu, 15 Mar 2018 12:18:42 -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; 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 S932628AbeCOTRY (ORCPT + 99 others); Thu, 15 Mar 2018 15:17:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:45220 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbeCOTQ0 (ORCPT ); Thu, 15 Mar 2018 15:16:26 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BD54AAFC5; Thu, 15 Mar 2018 19:16:25 +0000 (UTC) From: Michal Suchanek To: linuxppc-dev@lists.ozlabs.org Cc: Kate Stewart , Madhavan Srinivasan , Paul Mackerras , Michael Neuling , "Bryant G. Ly" , Mahesh Salgaonkar , "Naveen N. Rao" , Daniel Axtens , Nicholas Piggin , Al Viro , David Gibson , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Sergey Senozhatsky , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Masami Hiramatsu , Andrew Donnellan , Philippe Ombredanne , Joe Perches , Oliver O'Halloran , Andrew Morton , "Tobin C. Harding" , Michal Suchanek Subject: [PATCH RFC rebase 9/9] powerpc/64: barrier_nospec: Add commandline trigger Date: Thu, 15 Mar 2018 20:15:58 +0100 Message-Id: <1dcf7403042daddcdb8109f6b852b9bb9d768f89.1521141122.git.msuchanek@suse.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: <20180313200108.GA4082@hirez.programming.kicks-ass.net> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add commandline options spectre_v2 and nospectre_v2 These are named same as similar x86 options regardless of actual effect to not require platform-specific configuration. Supported options: nospectre_v2 or spectre_v2=off - speculation barrier not used spectre_v2=on or spectre_v2=auto - speculation barrier used Changing the settings after boot is not supported and VM migration may change requirements so auto is same as on. Based on s390 implementation Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/setup_64.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f6678a7b6114..c74e656265df 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -840,6 +840,28 @@ static int __init handle_no_pti(char *p) } early_param("nopti", handle_no_pti); +static int __init nospectre_v2_setup_early(char *str) +{ + no_nospec = true; + return 0; +} +early_param("nospectre_v2", nospectre_v2_setup_early); + +static int __init spectre_v2_setup_early(char *str) +{ + if (str && !strncmp(str, "on", 2)) + no_nospec = false; + + if (str && !strncmp(str, "off", 3)) + no_nospec = true; + + if (str && !strncmp(str, "auto", 4)) + no_nospec = false; + + return 0; +} +early_param("spectre_v2", spectre_v2_setup_early); + static void do_nothing(void *unused) { /* -- 2.13.6