From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from aserp2130.oracle.com ([141.146.126.79]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDFHp-0004VX-Ji for speck@linutronix.de; Mon, 30 Apr 2018 22:20:39 +0200 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3UKAuph053512 for ; Mon, 30 Apr 2018 20:20:31 GMT Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2hmeg5nrux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 20:20:30 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3UKKUkm021033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 20:20:30 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3UKKTR0003959 for ; Mon, 30 Apr 2018 20:20:29 GMT Date: Mon, 30 Apr 2018 16:20:28 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch V7 15/15] SBB 15 Message-ID: <20180430202028.GB18388@char.us.oracle.com> References: <20180429193045.711908246@linutronix.de> <20180429193938.717571156@linutronix.de> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, Apr 30, 2018 at 01:12:28PM -0700, speck for Tim Chen wrote: > On 04/30/2018 12:36 PM, speck for Thomas Gleixner wrote: > > On Mon, 30 Apr 2018, speck for Tim Chen wrote: > > > >> On 04/29/2018 12:31 PM, speck for Thomas Gleixner wrote: > >> > >>> +static int sbb_prctl_set(unsigned long ctrl) > >>> +{ > >>> + bool rds = !!test_tsk_thread_flag(current, TIF_RDS); > >>> + > >>> + if (ssb_mode != SPEC_STORE_BYPASS_PRCTL) > >>> + return -ENXIO; > >> > >> Perhaps we should not use the prctl if we don't have > >> the SSB bug. Something like: > >> > >> if (ssb_mode != SPEC_STORE_BYPASS_PRCTL || > >> !boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS)) > >> return -ENXIO; > > > > What? If the CPU does not have the bug then the kernel does not enable > > PRCTL mode at all unless > > > > 1) RDS is available > > > > AND > > > > 2) The user enforced PRTCL mode on the kernel command line. > > > > So what exactly are you trying to solve? > > Right, we will only do the PRCTL only for the case when > admin explicitly ask for it at kernel command line. No. It will be automatically enabled. That is the '=auto' sets prctl by default on Intel... You know why don't I just paste to you the code: 477 switch (cmd) { 478 case SPEC_STORE_BYPASS_CMD_AUTO: 479 /* 480 * AMD platforms by default don't need SSB mitigation. 481 */ 482 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) 483 break; 484 /* Choose prctl as the default mode */ 485 mode = SPEC_STORE_BYPASS_PRCTL; 486 break; > > We'll let the admin have the choice to do prctl, if he > explicitly ask for it. Even though it > is unnecessary for cpus that don't have the SSB bug and > there will be some added cost in changing the MSR on context > switches. Just want to clear in my mind that this is the choice > we are making. > > Tim