Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757349AbbEVNlJ (ORCPT ); Fri, 22 May 2015 09:41:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:50827 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757194AbbEVNlG (ORCPT ); Fri, 22 May 2015 09:41:06 -0400 Date: Fri, 22 May 2015 15:40:56 +0200 From: Peter Zijlstra To: mingo@kernel.org Cc: vincent.weaver@maine.edu, eranian@google.com, jolsa@redhat.com, kan.liang@intel.com, linux-kernel@vger.kernel.org, Andrew Hunter , Maria Dimakopoulou Subject: Re: [PATCH v2 01/11] perf,x86: Fix event/group validation Message-ID: <20150522134056.GG3644@twins.programming.kicks-ass.net> References: <20150522132905.416122812@infradead.org> <20150522133135.353044581@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150522133135.353044581@infradead.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1234 Lines: 33 On Fri, May 22, 2015 at 03:29:06PM +0200, Peter Zijlstra wrote: > @@ -788,9 +788,9 @@ int x86_schedule_events(struct cpu_hw_ev > x86_pmu.start_scheduling(cpuc); > > for (i = 0, wmin = X86_PMC_IDX_MAX, wmax = 0; i < n; i++) { > + cpuc->event_constraint[i] = NULL; ^^^ that is new, which is esp. important in light of the intel_get_event_constraints() hunk below, which would happily continue life with a garbage constraint. > c = x86_pmu.get_event_constraints(cpuc, i, cpuc->event_list[i]); > + cpuc->event_constraint[i] = c; > > wmin = min(wmin, c->weight); > wmax = max(wmax, c->weight); > +++ b/arch/x86/kernel/cpu/perf_event_intel.c > @@ -2106,7 +2106,7 @@ static struct event_constraint * > intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx, > struct perf_event *event) > { > - struct event_constraint *c1 = event->hw.constraint; > + struct event_constraint *c1 = cpuc->event_constraint[idx]; > struct event_constraint *c2; > > /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/