From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 09 Dec 2018 21:08:40 -0000 Received: from smtp.ctxuk.citrix.com ([185.25.65.24] helo=SMTP.EU.CITRIX.COM) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gW3Zd-0001Kx-NO for speck@linutronix.de; Sun, 09 Dec 2018 19:13:02 +0100 Subject: [MODERATED] Re: [PATCH 2/4] RFC-MDSv1 0 References: <20181113013545.GI6218@tassilo.jf.intel.com> <6c12a339-278c-3896-b423-f03a25ec8ace@citrix.com> <20181114040429.GL6218@tassilo.jf.intel.com> From: Andrew Cooper Message-ID: <193b9590-6f56-4b96-6dcc-d003548aa1c7@citrix.com> Date: Sun, 9 Dec 2018 18:12:52 +0000 MIME-Version: 1.0 In-Reply-To: <20181114040429.GL6218@tassilo.jf.intel.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Content-Language: en-GB To: speck@linutronix.de List-ID: On 14/11/2018 04:04, speck for Andi Kleen wrote: >> I was under the impression that the recommendation to use a NUL selector >> was specifically to avoid this second read. > No the rationale for the recommendation is to avoid mispredictions=20 > in the microcode. But the two are equivalent. After a discussion with Jason where (again) he suggested the use of %ds rather than NUL, I went back and extended my micro-benchmark. All other things being equal and cache-hot, a VERW of %ds really is faster NUL.=A0 (Net execution time is about 2/3 as long as recorded by two rdtscp's, not accounting for any systematic timing errors).=A0 This is just against some of my development boxes - I'm still waiting on the correct CPU to use the prototype microcode with additional VERW goodies. Either way - I'm surprised by these results, but %ds does looks to be the quickest option.=A0 Apologies for the noise on this thread. ~Andrew