Return-Path: Received: from mga04.intel.com ([192.55.52.120]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fQaF7-0001ES-Ns for speck@linutronix.de; Wed, 06 Jun 2018 17:20:58 +0200 Subject: [MODERATED] Re: ARCH_CAPABILITIES note References: <0eca849b-fd6b-e42f-6c83-3c930d644bba@redhat.com> <3b6d8d03-945e-4efc-7baa-a7ecedfd2366@linux.intel.com> <51a5e275-67c2-5638-21e9-a3992ba1de0b@redhat.com> From: Dave Hansen Message-ID: <5f898d80-b66a-7933-d348-c733a2b888e8@linux.intel.com> Date: Wed, 6 Jun 2018 08:20:54 -0700 MIME-Version: 1.0 In-Reply-To: <51a5e275-67c2-5638-21e9-a3992ba1de0b@redhat.com> Content-Type: multipart/mixed; boundary="fozYGpscpsSyO0cgM4T7Z7MPVFK3WJbio"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --fozYGpscpsSyO0cgM4T7Z7MPVFK3WJbio Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/05/2018 11:48 AM, speck for Jon Masters wrote: > On 06/05/2018 02:27 PM, speck for Dave Hansen wrote: >> The retpoline LFENCE is only speculative and not ever retired >=20 > It's serializing though. The problem is not so much the use of the > lfence (provided the SDM doesn't change) but that it only applies right= > up /until/ syscall dispatch, but not once the syscall handler has been > dispatched. The handler might do something dangerous. I audited a few, > but there's a lot more work that needs to be done there I think. Just trying to be precise: Are you saying that LFENCE is an architecturally "serializing instruction", or that it shares some properties will fully "serializing instructions"? Also, do we agree that the speculative retpoline LFENCE has different behavior than a retired LFENCE? =46rom my perspective, the speculative LFENCE only has an impact on the loads in that _particular_ speculative execution path. It has no defined impact on the retired execution path, or *other* speculation paths that can occur. The processor could easily speculate into an LFENCE, decide it does not want to go down that speculative path, and restart speculating elsewhere as if it had never seen the LFENCE. BTW, I this is related to, but separate from the question of the mitigation value of the existing retpoline LFENCE for mitigating things other than Spectre v2. --fozYGpscpsSyO0cgM4T7Z7MPVFK3WJbio--