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:37:38 -0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1grlk8-00059v-LS for speck@linutronix.de; Thu, 07 Feb 2019 16:37:37 +0100 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1grlk1-00087u-Q3 for speck@linutronix.de; Thu, 07 Feb 2019 15:37:35 +0000 Date: Thu, 7 Feb 2019 16:37:28 +0100 From: Peter Zijlstra Subject: [MODERATED] Re: [PATCH v2 0/8] PERFv2 Message-ID: <20190207153728.GE32477@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: > > +static struct event_constraint * > > +skl_get_event_constraints(struct cpu_hw_events *cpuc, int idx, > > + struct perf_event *event) > > +{ > > + struct event_constraint *c; > > + > > + c = hsw_get_event_constraints(cpuc, idx, event); > > + > > + if (!force_rtm_abort) { > > + /* > > + * Without TFA we must not use PMC3. > > + */ > > + c->idxmsk64 &= ~(1ULL << 3); > > Doesn't that overwrite the global shared constraints constraints? > Would need to make them non const at least, it will likely fault. They are !const; we already update them at init time (for example we add the GPRs to the fixed ones etc..). > Okay I see you rely on it being guarded by the global, but for virtualization > support will need the copy. > > Would need a copy at least. I've not thought abou virt yet; do we _have_ to expose the thing to guests? > Other than that there doesn't seem to be anything obviously wrong. > > I will do some testing/checking and readd the opt-in/opt-out interfaces. Right, so per using DEVICE_BOOL_ATTR() changing the value is racy like hell. If we were to use an update function we could try and do complicated crap. Not sure that's worth it though.