From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from userp2120.oracle.com ([156.151.31.85]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDB3f-0008Kv-5s for speck@linutronix.de; Mon, 30 Apr 2018 17:49:44 +0200 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3UFkqqD138293 for ; Mon, 30 Apr 2018 15:49:36 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2hmhmfcnqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 15:49:36 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3UFnZlt024044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 15:49:35 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3UFnZxT018108 for ; Mon, 30 Apr 2018 15:49:35 GMT Date: Mon, 30 Apr 2018 11:49:32 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch V7 14/15] SBB 14 Message-ID: <20180430154932.GE3369@char.us.oracle.com> References: <20180429193045.711908246@linutronix.de> <20180429193938.637125129@linutronix.de> <20180430021455.GA30984@char.us.oracle.com> 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 07:57:19AM +0200, speck for Thomas Gleixner wrote: > On Sun, 29 Apr 2018, speck for Konrad Rzeszutek Wilk wrote: > > > +extern u64 x86_spec_ctrl_base; > > > + > > > +static inline u64 rds_tif_to_spec_ctrl(u64 tifn) > > > +{ > > > + BUILD_BUG_ON(TIF_RDS < SPEC_CTRL_RDS_SHIFT); > > > + return (tifn & _TIF_RDS) >> (TIF_RDS - SPEC_CTRL_RDS_SHIFT); > > > > If my math is correct, the right side value is 3, not 2. That is > > TIF_RDS (5) - SPEC_CTRL_RDS_SHIFT(2) = 3. > > > > Then if _TIF_RDS is set we do: > > 1 >> 3 > > _TIF_RDS == (1 << TIF_RDS) == 0x20 > > Ergo if set: > > 0x20 >> 3 = 0x04 > > if not set: > > 0x00 >> 3 = 0x00 > > Right? Yes. I missed the '_'. With that explanation and the thing below, please add Reviewed-by: Konrad Rzeszutek Wilk