Received: by 10.223.176.5 with SMTP id f5csp456706wra; Wed, 7 Feb 2018 02:03:54 -0800 (PST) X-Google-Smtp-Source: AH8x22440UPtNEqoT8Zc9zJkf+uw2hqq/IM86HP8WatEfsV3TknvPAAQ8pxbawDsh62Q9F6atSer X-Received: by 2002:a17:902:7402:: with SMTP id g2-v6mr5434116pll.170.1517997834727; Wed, 07 Feb 2018 02:03:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517997834; cv=none; d=google.com; s=arc-20160816; b=Bs02rWS76UE43R8NFhynxNNRd18lr/GLJ0ABZF9Uc9mcYGjt0dx79n3uJcnau0b0vA 2/FvHtATUB2wnNHjI0PeSVeKeJkRVWjpB1ZuW3fFc2ArX3jIbQsdeVgJTHxyaVRC9Zq/ Mrc45nXGKroNcCzZjVOWtSoFXkRbr87wT1yHZEFCr6C9Zz4BMF38hvXkKnpeLr7ZMX0r HWOoW32yEmOwppXmpPed9S05sAcf6YRX5V6sVsoDb4fFZMmINib8bbQ9Tdj2/IUcOmiZ fZdKuRKbkP3xwOMratqkS1LCf0uyo/AyBg1a/CDvyw4me+7foLgUvSYayTyOzMt4+TpX Ha1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8wKnaSUTSgkPuSshJsgLI4rXEde7vsJFCpwcnsJzGHw=; b=wY/AdWOEXpj1pZIIgoIgNswmNQTO8neO3V6byPKse6+v6DEXFI/LPZFRUM4vuHDucU Dtkid0kkf5VzKYhloOBe+JVmZ5slsuNWRnjzmocOdJrFnpSfY5lFM/wDna6RzrscPfmZ 5Tx5T/Sf8tdo8u1dPm+7t1G1QADs0VvRjDRCAGkXnmL/EsxvR7pqiK3MfEtovwyM1/UE SoxVaZ4zVL3a6sGDr08mA4uvrvZBUZGASN+clDFLuvE4spIgqzVPeYf9ZlfXlomEs0SL dEPf5lVAUCZZ6q5HeEfkTksWakS4WilE5ryAQ+tyPJzj5u/47z+Uv7cEMmWUHUaYjHz+ hfmA== 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 124si732247pgf.252.2018.02.07.02.03.37; Wed, 07 Feb 2018 02:03:54 -0800 (PST) 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 S1753648AbeBGKC4 (ORCPT + 99 others); Wed, 7 Feb 2018 05:02:56 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:55204 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753337AbeBGKCz (ORCPT ); Wed, 7 Feb 2018 05:02:55 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id DAA498015A; Wed, 7 Feb 2018 11:02:52 +0100 (CET) Date: Wed, 7 Feb 2018 11:02:52 +0100 From: Pavel Machek To: Martin Schwidefsky Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Heiko Carstens , Christian Borntraeger , Cornelia Huck , David Hildenbrand , Greg Kroah-Hartman , Jon Masters , Marcus Meissner , Jiri Kosina , Dominik Brodowski , Alan Cox , David Woodhouse Subject: Re: [PATCH 4/6] s390: add options to change branch prediction behaviour for the kernel Message-ID: <20180207100252.GA31392@amd> References: <1517986811-27819-1-git-send-email-schwidefsky@de.ibm.com> <1517986811-27819-5-git-send-email-schwidefsky@de.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <1517986811-27819-5-git-send-email-schwidefsky@de.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-02-07 08:00:09, Martin Schwidefsky wrote: > Add the PPA instruction to the system entry and exit path to switch > the kernel to a different branch prediction behaviour. The instructions > are added via CPU alternatives and can be disabled with the "nospec" > or the "nobp=3D0" kernel parameter. If the default behaviour selected > with CONFIG_KERNEL_NOBP is set to "n" then the "nobp=3D1" parameter can be > used to enable the changed kernel branch prediction. >=20 > Acked-by: Cornelia Huck > Signed-off-by: Martin Schwidefsky > --- > arch/s390/Kconfig | 17 ++++++++++++++ > arch/s390/include/asm/processor.h | 1 + > arch/s390/kernel/alternative.c | 23 +++++++++++++++++++ > arch/s390/kernel/early.c | 2 ++ > arch/s390/kernel/entry.S | 48 +++++++++++++++++++++++++++++++++= ++++++ > arch/s390/kernel/ipl.c | 1 + > arch/s390/kernel/smp.c | 2 ++ > 7 files changed, 94 insertions(+) >=20 > diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig > index 0105ce2..d514e25 100644 > --- a/arch/s390/Kconfig > +++ b/arch/s390/Kconfig > @@ -540,6 +540,23 @@ config ARCH_RANDOM > =20 > If unsure, say Y. > =20 > +config KERNEL_NOBP > + def_bool n > + prompt "Enable modified branch prediction for the kernel by default" > + help > + If this option is selected the kernel will switch to a modified > + branch prediction mode if the firmware interface is available. > + The modified branch prediction mode improves the behaviour in > + regard to speculative execution. > + > + With the option enabled the kernel parameter "nobp=3D0" or "nospec" > + can be used to run the kernel in the normal branch prediction mode. > + > + With the option disabled the modified branch prediction mode is > + enabled with the "nobp=3D1" kernel parameter. > + > + If unsure, say N. > + This could use some improvement. Afaict the config option only changes the default behaviour? Do we need the option in such case? (CONFIG_CMDLINE_APPEND can be useful to avoid some options). Plus, it is not clear what "modified branch prediction mode is" and if "improves behaviour" means "faster" or "safer". Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --FCuugMFkClbJLl1L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlp6zswACgkQMOfwapXb+vK0pwCeL4PEbHal/xjwNBCka4uCa8VM w+IAn2Hj1tcYhZp0gdFqCfL+gIpsooAF =wjN7 -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L--