[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180207100252.GA31392@amd>
Date: Wed, 7 Feb 2018 11:02:52 +0100
From: Pavel Machek <pavel@....cz>
To: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
Heiko Carstens <heiko.carstens@...ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Cornelia Huck <cohuck@...hat.com>,
David Hildenbrand <david@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jon Masters <jcm@...hat.com>,
Marcus Meissner <meissner@...e.de>,
Jiri Kosina <jkosina@...e.cz>,
Dominik Brodowski <linux@...inikbrodowski.net>,
Alan Cox <gnomes@...rguk.ukuu.org.uk>,
David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH 4/6] s390: add options to change branch prediction
behaviour for the kernel
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=0" kernel parameter. If the default behaviour selected
> with CONFIG_KERNEL_NOBP is set to "n" then the "nobp=1" parameter can be
> used to enable the changed kernel branch prediction.
>
> Acked-by: Cornelia Huck <cohuck@...hat.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky@...ibm.com>
> ---
> 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(+)
>
> 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
>
> If unsure, say Y.
>
> +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=0" 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=1" 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
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists