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 ; 20 Feb 2019 18:09:03 -0000 Received: from mga14.intel.com ([192.55.52.115]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gwWIn-0003Sv-IJ for speck@linutronix.de; Wed, 20 Feb 2019 19:09:02 +0100 Date: Wed, 20 Feb 2019 10:08:58 -0800 From: mark gross Subject: [MODERATED] Re: [patch V2 03/10] MDS basics+ 3 Message-ID: <20190220180858.GA285@mgross-MOBL.amr.corp.intel.com> Reply-To: mgross@linux.intel.com References: <20190220150753.665964899@linutronix.de> <20190220151400.217101404@linutronix.de> <20190220165453.GA127@mgross-MOBL.amr.corp.intel.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 Wed, Feb 20, 2019 at 05:57:04PM +0100, speck for Thomas Gleixner wrote: > On Wed, 20 Feb 2019, speck for mark gross wrote: > > On Wed, Feb 20, 2019 at 04:07:56PM +0100, speck for Thomas Gleixner wrote: > > > +static inline void mds_clear_cpu_buffers(void) > > > +{ > > > + static const u16 ds = __KERNEL_DS; > > > + > > > + /* > > > + * Has to be memory form, don't modify to use a register. VERW > > > + * modifies ZF. > > > + */ > > > + asm volatile("verw %[ds]" : : "i" (0), [ds] "m" (ds) : "cc"); > > > +} > > > + > > > #endif /* __ASSEMBLY__ */ > > > > > > /* > > > > > Perhaps a dumb question but, is there any point to including that fall back ASM > > altrinitive for platfroms without the uCode update enabling verw to clear > > buffers? > > See 8/10 .... I was just wrapping my head around that one. I don't like the name for that mode but I can't think of a better one other than MDS_GUEST_CHICKEN_BIT. Which is worse. Anyway, Andi pointed out off list to me that Linus rejected the ASM sequences that could be used if verw was not available before I was on this list. So, please ingore my initial comment as it was related to those. --mark