From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from aserp2120.oracle.com ([141.146.126.78]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDF74-00047f-Pm for speck@linutronix.de; Mon, 30 Apr 2018 22:09:32 +0200 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3UK6KJQ174840 for ; Mon, 30 Apr 2018 20:09:23 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2hmgxfnmmb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 20:09:23 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3UK9MQV028425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 20:09:22 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3UK9MwT014504 for ; Mon, 30 Apr 2018 20:09:22 GMT Date: Mon, 30 Apr 2018 16:09:21 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch V7 15/15] SBB 15 Message-ID: <20180430200921.GA18631@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 12:30:18PM -0700, 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 you look in the previous patches you will see that you cannot set SPEC_STORE_BYPASS_PRCTL at all if X86_BUG_SPEC_STORE_BYPASS is not defined. > > if (ssb_mode != SPEC_STORE_BYPASS_PRCTL || > !boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS)) > return -ENXIO; > > Thanks. > > Tim > >+ > >+ if (ctrl == PR_SPEC_ENABLE) > >+ clear_tsk_thread_flag(current, TIF_RDS); > >+ else > >+ set_tsk_thread_flag(current, TIF_RDS); > >+ > >+ if (rds != !!test_tsk_thread_flag(current, TIF_RDS)) > >+ speculative_store_bypass_update(); > >+ return 0; > +} > +