Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 05 Jul 2018 18:36:46 -0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fb97V-0001V8-1q for speck@linutronix.de; Thu, 05 Jul 2018 20:36:45 +0200 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 95516C324 for ; Thu, 5 Jul 2018 18:36:38 +0000 (UTC) Received: from washington.bos.jonmasters.org (ovpn-124-173.rdu2.redhat.com [10.10.124.173]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54CC02026D74 for ; Thu, 5 Jul 2018 18:36:38 +0000 (UTC) Subject: [MODERATED] Re: More lfence excitement References: <5d064dd6-af3c-a78f-1342-20c753888ab3@redhat.com> From: Jon Masters Message-ID: Date: Thu, 5 Jul 2018 14:36:37 -0400 MIME-Version: 1.0 In-Reply-To: <5d064dd6-af3c-a78f-1342-20c753888ab3@redhat.com> Content-Type: multipart/mixed; boundary="UdFYO4gByR1GvCMqbtq9dX7CtQatcyBd4"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --UdFYO4gByR1GvCMqbtq9dX7CtQatcyBd4 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 07/02/2018 05:36 PM, speck for Jon Masters wrote: > On 07/02/2018 02:52 PM, speck for Linus Torvalds wrote: >=20 >> So I assume many people on this list are occasionally in touch directl= y=20 >> with the TU Graz people, so this comes as no surprise, but just FYI in= =20 >> case you aren't: they have some tests that indicate that lfence isn't= =20 >> quite the fence for speculative execution that it was supposed to be. >=20 > Indeed. They let me know about this as well. For those who care, it als= o > extends to certain instruction sequences on other architectures. I have= > reference code (privately) from Graz and am reviewing it at the moment.= My guess (as I told Graz) is that the heavy interrupt load effectively forces in-order dispatch[0] of the instructions close to the lfence, then the lfence and subsequent speculative instructions hit the execution ports at the same moment. I believe there is then likely to be a small window before that lfence kills speculation during which already dispatched instructions are still in flight and under speculative mode. Graz did some further testing at my request by inserting additional instructions between the fence and subsequent speculative path. They were /unable/ to leak data if they added more than a small number and are currently pursuing this as a possible explanation. I'm confirmed at Graz next Tue and will review. Jon. [0] Continual interrupts will effectively mean many ROB entries are tagged with interrupt pending and speculation is killed frequently, so the out of order window is very small under load. --=20 Computer Architect | Sent from my Fedora powered laptop --UdFYO4gByR1GvCMqbtq9dX7CtQatcyBd4--