Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-09-10 Thread Peter Zijlstra
On Thu, Sep 10, 2015 at 01:54:18AM -0700, Stephane Eranian wrote: > On Fri, Aug 21, 2015 at 1:31 PM, Sasha Levin wrote: > > > > On 05/21/2015 07:17 AM, Peter Zijlstra wrote: > > > --- a/arch/x86/kernel/cpu/perf_event_intel.c > > > +++ b/arch/x86/kernel/cpu/perf_event_intel.c > > > @@ -2106,7 +2106

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-09-10 Thread Stephane Eranian
On Fri, Aug 21, 2015 at 1:31 PM, Sasha Levin wrote: > > On 05/21/2015 07:17 AM, Peter Zijlstra wrote: > > --- a/arch/x86/kernel/cpu/perf_event_intel.c > > +++ b/arch/x86/kernel/cpu/perf_event_intel.c > > @@ -2106,7 +2106,7 @@ static struct event_constraint * > > intel_get_event_constraints(struct

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-09-09 Thread Sasha Levin
Ping? On 08/21/2015 04:31 PM, Sasha Levin wrote: > On 05/21/2015 07:17 AM, Peter Zijlstra wrote: >> --- a/arch/x86/kernel/cpu/perf_event_intel.c >> +++ b/arch/x86/kernel/cpu/perf_event_intel.c >> @@ -2106,7 +2106,7 @@ static struct event_constraint * >> intel_get_event_constraints(struct cpu_hw_e

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-08-21 Thread Sasha Levin
On 05/21/2015 07:17 AM, Peter Zijlstra wrote: > --- a/arch/x86/kernel/cpu/perf_event_intel.c > +++ 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

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-22 Thread Ingo Molnar
* Stephane Eranian wrote: > On Thu, May 21, 2015 at 11:49 PM, Ingo Molnar wrote: > > > > > > * Stephane Eranian wrote: > > > > > On Thu, May 21, 2015 at 7:03 AM, Peter Zijlstra > > > wrote: > > > > On Thu, 2015-05-21 at 06:36 -0700, Stephane Eranian wrote: > > > >> On Thu, May 21, 2015 at 6:

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-22 Thread Stephane Eranian
On Thu, May 21, 2015 at 11:49 PM, Ingo Molnar wrote: > > > * Stephane Eranian wrote: > > > On Thu, May 21, 2015 at 7:03 AM, Peter Zijlstra > > wrote: > > > On Thu, 2015-05-21 at 06:36 -0700, Stephane Eranian wrote: > > >> On Thu, May 21, 2015 at 6:29 AM, Peter Zijlstra > > >> wrote: > > >> >

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Ingo Molnar
* Stephane Eranian wrote: > On Thu, May 21, 2015 at 7:03 AM, Peter Zijlstra wrote: > > On Thu, 2015-05-21 at 06:36 -0700, Stephane Eranian wrote: > >> On Thu, May 21, 2015 at 6:29 AM, Peter Zijlstra > >> wrote: > >> > On Thu, 2015-05-21 at 06:27 -0700, Stephane Eranian wrote: > >> >> Or are y

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
On Thu, May 21, 2015 at 7:53 AM, Peter Zijlstra wrote: > On Thu, May 21, 2015 at 01:17:11PM +0200, Peter Zijlstra wrote: >> --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c >> +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c >> @@ -706,9 +706,9 @@ void intel_pmu_pebs_disable(struct perf_ >> >>

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
On Thu, May 21, 2015 at 7:03 AM, Peter Zijlstra wrote: > On Thu, 2015-05-21 at 06:36 -0700, Stephane Eranian wrote: >> On Thu, May 21, 2015 at 6:29 AM, Peter Zijlstra wrote: >> > On Thu, 2015-05-21 at 06:27 -0700, Stephane Eranian wrote: >> >> Or are you talking about a preemption while executing

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
On Thu, May 21, 2015 at 01:17:11PM +0200, Peter Zijlstra wrote: > --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c > +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c > @@ -706,9 +706,9 @@ void intel_pmu_pebs_disable(struct perf_ > > cpuc->pebs_enabled &= ~(1ULL << hwc->idx); > > - if (e

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
On Thu, 2015-05-21 at 06:36 -0700, Stephane Eranian wrote: > On Thu, May 21, 2015 at 6:29 AM, Peter Zijlstra wrote: > > On Thu, 2015-05-21 at 06:27 -0700, Stephane Eranian wrote: > >> Or are you talking about a preemption while executing > >> x86_schedule_events()? > > > > That. > > > > And we ca

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
On Thu, May 21, 2015 at 6:29 AM, Peter Zijlstra wrote: > On Thu, 2015-05-21 at 06:27 -0700, Stephane Eranian wrote: >> Or are you talking about a preemption while executing x86_schedule_events()? > > That. > > And we can of course cure that by an earlier patch I send; but I find it > a much simple

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
On Thu, 2015-05-21 at 06:27 -0700, Stephane Eranian wrote: > Or are you talking about a preemption while executing x86_schedule_events()? That. And we can of course cure that by an earlier patch I send; but I find it a much simpler rule to just never allow modifying global state for validation. -

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
On Thu, May 21, 2015 at 6:20 AM, Peter Zijlstra wrote: > On Thu, May 21, 2015 at 06:18:15AM -0700, Stephane Eranian wrote: >> Yes, it does modify the cpuc->event_list[]->hwc, because it is used as a >> cache for *EACH* invocation of the function. It is irrelevant outside the >> function. > > Yes,

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
On Thu, May 21, 2015 at 06:18:15AM -0700, Stephane Eranian wrote: > Yes, it does modify the cpuc->event_list[]->hwc, because it is used as a > cache for *EACH* invocation of the function. It is irrelevant outside the > function. Yes, but the problem is that they _nest_. So you get to use the one

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
On Thu, May 21, 2015 at 6:09 AM, Peter Zijlstra wrote: > On Thu, May 21, 2015 at 06:07:20AM -0700, Stephane Eranian wrote: >> On Thu, May 21, 2015 at 5:56 AM, Peter Zijlstra wrote: >> > On Thu, May 21, 2015 at 05:35:02AM -0700, Stephane Eranian wrote: >> >> > Commit e979121b1b15 ("perf/x86/intel:

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
On Thu, May 21, 2015 at 06:07:20AM -0700, Stephane Eranian wrote: > On Thu, May 21, 2015 at 5:56 AM, Peter Zijlstra wrote: > > On Thu, May 21, 2015 at 05:35:02AM -0700, Stephane Eranian wrote: > >> > Commit e979121b1b15 ("perf/x86/intel: Implement cross-HT corruption > >> > bug workaround") made t

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
On Thu, May 21, 2015 at 5:56 AM, Peter Zijlstra wrote: > On Thu, May 21, 2015 at 05:35:02AM -0700, Stephane Eranian wrote: >> > Commit e979121b1b15 ("perf/x86/intel: Implement cross-HT corruption >> > bug workaround") made the situation much worse by actually setting the >> > event->hw.constraint

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
On Thu, May 21, 2015 at 05:35:02AM -0700, Stephane Eranian wrote: > Peter, > > On Thu, May 21, 2015 at 4:17 AM, Peter Zijlstra wrote: > > Commit 43b4578071c0 ("perf/x86: Reduce stack usage of > > x86_schedule_events()") violated the rule that 'fake' scheduling; as > > used for event/group validat

Re: [PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Stephane Eranian
Peter, On Thu, May 21, 2015 at 4:17 AM, Peter Zijlstra wrote: > Commit 43b4578071c0 ("perf/x86: Reduce stack usage of > x86_schedule_events()") violated the rule that 'fake' scheduling; as > used for event/group validation; should not change the event state. > > This went mostly un-noticed becaus

[PATCH 01/10] perf,x86: Fix event/group validation

2015-05-21 Thread Peter Zijlstra
Commit 43b4578071c0 ("perf/x86: Reduce stack usage of x86_schedule_events()") violated the rule that 'fake' scheduling; as used for event/group validation; should not change the event state. This went mostly un-noticed because repeated calls of x86_pmu::get_event_constraints() would give the same