Received: by 10.223.176.46 with SMTP id f43csp493285wra; Thu, 18 Jan 2018 20:54:58 -0800 (PST) X-Google-Smtp-Source: ACJfBouXTzNFrkbpnDVFd3nZN4+SyYR4pGmVG7pfRtZPujY5q71my1NcOwWHRHd0eDWiVhHtE7Bo X-Received: by 10.99.173.5 with SMTP id g5mr17209390pgf.391.1516337698500; Thu, 18 Jan 2018 20:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516337698; cv=none; d=google.com; s=arc-20160816; b=hz4QKTSaP8mZa8UGOROz0/H1yh3nh2kgq3IeViG+T//mo53FxAJR6awnhV72+hA3NF 1Irm5Jd30l1IcsO9DNM2ojy8x+fBmXHJ3iiAP53pYyv+NSm/kHoTvH5oHJd6wdje0UuU l3G1R2JdNlCk+1zus3ukjY+UQzqDv1TpYwmrqRg909+ZrGSSeTxY0SfPXdexQdw4PRCb 6QHLuhgqZ1zHc9RaaHeMhffbPs6xgM4ryTpdT62ytG4iBnl81WciT8zPz6Ttff5Iaka2 EXJb5clKg8Dzlty9GMdY5fTjx5H4jim32uxb2GR/QFV3n8UvFU5rzLvYauUl4rhEg0FF YxOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:from:references:cc:to :subject:arc-authentication-results; bh=b01XGpDd8vZa2qrjuGvYRbuKSg1j4JF4eTKkuYU+rtE=; b=NiBTMzUQAZKDDtSSOSX1IPCXX3hR/zPczqFH2CCuqvVIzaGeasG4KlP1DpBOKsB0Kc TH44T2cc50IgVAcL7nnhY+RmDSsk/xoP+2HsO7nDBbwtb48y9hrzVCCD61RRWoxtczQt qpkc/tGV7aRxnXyqijELAJhqLLgrt3r73DwkS5lLKaFPd/hYWc5zDAeNb0ytaaCe868j itn3FNSD7EZrNrgxDR60RYJtSG5gR4Vig9IPRAZzRMiUiD+MV/XSQnixB+Uy3gJbhJqM y9V0ylSPRxGUXH6lndq0DZYcFSFlEWJ5HTZEMfdW938ngJrzzKx2lIYFicvX1AUoKA6Y PFyQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14si3524933pgd.207.2018.01.18.20.54.43; Thu, 18 Jan 2018 20:54:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbeASEyK (ORCPT + 99 others); Thu, 18 Jan 2018 23:54:10 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39218 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750974AbeASEyG (ORCPT ); Thu, 18 Jan 2018 23:54:06 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0J4rjjD003467 for ; Thu, 18 Jan 2018 23:54:06 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fk58b1mew-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Jan 2018 23:54:05 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Jan 2018 23:54:05 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 18 Jan 2018 23:54:02 -0500 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0J4s1vh48693432; Fri, 19 Jan 2018 04:54:01 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0020FAE04B; Thu, 18 Jan 2018 23:55:15 -0500 (EST) Received: from [9.125.65.177] (unknown [9.125.65.177]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTPS id 7DA69AE03B; Thu, 18 Jan 2018 23:55:11 -0500 (EST) Subject: Re: [PATCH 3/6] s390: add options to change branch prediction behaviour for the kernel To: Martin Schwidefsky , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org Cc: Heiko Carstens , Paolo Bonzini , Cornelia Huck , Greg Kroah-Hartman , Jon Masters , Marcus Meissner , Jiri Kosina References: <1516182519-10623-1-git-send-email-schwidefsky@de.ibm.com> <1516182519-10623-4-git-send-email-schwidefsky@de.ibm.com> From: QingFeng Hao Date: Fri, 19 Jan 2018 12:53:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516182519-10623-4-git-send-email-schwidefsky@de.ibm.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18011904-0036-0000-0000-000002AF0EF2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008404; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00977120; UDB=6.00495390; IPR=6.00757042; BA=6.00005782; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019121; XFM=3.00000015; UTC=2018-01-19 04:54:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011904-0037-0000-0000-0000430AD09F Message-Id: <4f27802d-9cdd-ed59-f892-92803f9a4986@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-19_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801190057 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2018/1/17 17:48, Martin Schwidefsky ะด??: > 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: Christian Borntraeger > 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 | 50 ++++++++++++++++++++++++++++++++++++++- > arch/s390/kernel/ipl.c | 1 + > arch/s390/kernel/smp.c | 2 ++ > 7 files changed, 95 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig > index 829c679..a818644 100644 > --- a/arch/s390/Kconfig > +++ b/arch/s390/Kconfig > @@ -541,6 +541,23 @@ config ARCH_RANDOM > > If unsure, say Y. > > +config KERNEL_NOBP Just a question that can we add the control in proc system to enable/disable the facilities for the whole system by default? Each process can still overwrite the default setting. This may provide more flexibility for the operator to choose and debug as well without rebooting the system. e.g. echo 0 > /sys/kernel/debug/s390x/ibpb_enabled Ref: https://access.redhat.com/articles/3311301 > + 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. > + > endmenu [...] -- Regards QingFeng Hao