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 15:52:44 -0000 Received: from smtp.ctxuk.citrix.com ([185.25.65.24] helo=SMTP.EU.CITRIX.COM) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1grlyk-0005Tg-Fr for speck@linutronix.de; Thu, 07 Feb 2019 16:52:43 +0100 Subject: [MODERATED] Re: [PATCH v2 0/8] PERFv2 References: <20190207132709.GA32477@hirez.programming.kicks-ass.net> <20190207143759.GP31598@tassilo.jf.intel.com> <20190207153330.GD32477@hirez.programming.kicks-ass.net> From: Andrew Cooper Message-ID: <2d21053c-4c0b-a993-80f3-305e809e5996@citrix.com> Date: Thu, 7 Feb 2019 15:51:24 +0000 MIME-Version: 1.0 In-Reply-To: <20190207153330.GD32477@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Content-Language: en-GB To: speck@linutronix.de List-ID: On 07/02/2019 15:33, speck for Peter Zijlstra wrote: > On Thu, Feb 07, 2019 at 06:37:59AM -0800, speck for Andi Kleen wrote: >>> A few questions: >>> >>> - How will this 'feature' interact with MSR_CORE_PERF_GLOBAL_CTRL ? >> It's completely independent of GLOBAL_CTRL on the software level. >> Internally it uses it, but it shouldn't be software visible. > So if you write GLOBAL_CTRL=3D0 and then use RTM instructions, the ucode > doesn't set GLOBAL_CTRL.3 =3D 1 ? It would have to, otherwise I don't see > how it would work. Speaking with no authority on what the ucode actually does, From discussion on the joint call, I believe the behaviour is this: On an XBEGIN instruction (even speculatively) =A0* Write PCR3 event select to a specific event =A0* Enable PCR3 in GLOBAL_CTRL On a transaction end: =A0* Disable PCR3 in GLOBAL_CTRL As a result, software will won't see PCR3 enabled after the fact, but it will find that the event select and counter have been modified. ~Andrew