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 ; 13 Nov 2018 01:35:49 -0000 Received: from mga01.intel.com ([192.55.52.88]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gMNcK-0000XW-Eg for speck@linutronix.de; Tue, 13 Nov 2018 02:35:48 +0100 Date: Mon, 12 Nov 2018 17:35:45 -0800 From: Andi Kleen Subject: [MODERATED] Re: [PATCH 2/4] RFC-MDSv1 0 Message-ID: <20181113013545.GI6218@tassilo.jf.intel.com> References: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Tue, Nov 13, 2018 at 12:07:47AM +0000, speck for Andrew Cooper wrote: > On 12/11/2018 03:41, speck for Andi Kleen wrote: > > @@ -329,6 +331,12 @@ For 32-bit we have the following conventions - kerne= l is built with > > =20 > > #endif > > =20 > > +.macro EXIT_MDS > > + /* Clear CPU buffers that could leak. Instruction must be in memory for= m. */ > > + ALTERNATIVE "", __stringify(pushq $__USER_DS ; verw (%rsp) ; addq $8, %= rsp),\ > > + X86_FEATURE_MB_CLEAR >=20 > The code sample from the slides is push $0.=C2=A0 Here, you are forcing an > implicit access into the GDT by using a non-NUL selector, which is a > compound performance hit. Actually it should be the same as 0. I think the slides just use $0 because they don't know which OS the sequence would be used on. -Andi