Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 07 Feb 2019 16:02:00 -0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1grm7i-0005l6-OQ for speck@linutronix.de; Thu, 07 Feb 2019 17:01:59 +0100 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1grm7h-0005gs-Ey for speck@linutronix.de; Thu, 07 Feb 2019 16:01:57 +0000 Date: Thu, 7 Feb 2019 17:01:54 +0100 From: Peter Zijlstra Subject: [MODERATED] Re: [PATCH v2 0/8] PERFv2 Message-ID: <20190207160154.GF32477@hirez.programming.kicks-ass.net> References: <20190207132709.GA32477@hirez.programming.kicks-ass.net> <20190207143759.GP31598@tassilo.jf.intel.com> MIME-Version: 1.0 In-Reply-To: <20190207143759.GP31598@tassilo.jf.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Thu, Feb 07, 2019 at 06:37:59AM -0800, speck for Andi Kleen wrote: > With no use of RTM clobbering should be fairly unlikely, > but in theory it could happen if RETPOLINE is not used > (due to an indirect branch mistakenenly executing something > that looks like XBEGIN). If we assume that RETPOLINE > is used I believe it shouldn't happen in the kernel at least. > Even without RETPOLINE such a case should be fairly unlikely, > but cannot be 100% ruled out. Hurmph; yes. Even with the kernel not actually having an XBEGIN, the BTB can send us halfway into another instruction, and as long as that has the right bytes (C7 F8) we'll try and run it. What does bother me a bit is that XBEGIN is not a speculation barrier and the whole PMC3 state becomes a speculation leak. But whatever..