[PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-09-02 Thread Andi Kleen
From: Andi Kleen On Broadwell INST_RETIRED.ALL cannot be used with any period that doesn't have the lowest 6 bits cleared. And the period should not be smaller than 128. Add a new callback to enforce this, and set it for Broadwell. This is erratum BDM57 and BDM11. How does this handle the case

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-09-01 Thread Peter Zijlstra
On Mon, Aug 25, 2014 at 03:43:30PM -0700, Andi Kleen wrote: > From: Andi Kleen > > On Broadwell INST_RETIRED.ALL cannot be used with any period > that doesn't have the lowest 6 bits cleared. And the period > should not be smaller than 128. > > Add a new callback to enforce this, and set it for B

[PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-27 Thread Andi Kleen
From: Andi Kleen On Broadwell INST_RETIRED.ALL cannot be used with any period that doesn't have the lowest 6 bits cleared. And the period should not be smaller than 128. Add a new callback to enforce this, and set it for Broadwell. This is erratum BDM57 and BDM11. v2: Use correct event name in

[PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-25 Thread Andi Kleen
From: Andi Kleen On Broadwell INST_RETIRED.ALL cannot be used with any period that doesn't have the lowest 6 bits cleared. And the period should not be smaller than 128. Add a new callback to enforce this, and set it for Broadwell. This is erratum BDM57 and BDM11. v2: Use correct event name in

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-15 Thread Andi Kleen
> So no need to 'fix' the tools, al we need to do is refuse to create > INST_RETIRED:ALL events with sample_period < 128. Like this? diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index a0adf58..c592d4d 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-15 Thread Peter Zijlstra
On Thu, Aug 14, 2014 at 07:47:56PM +0200, Stephane Eranian wrote: > [+perf tool maintainers] > > On Thu, Aug 14, 2014 at 4:30 PM, Andi Kleen wrote: > > > > I understand all your points, but there's no alternative. > > The only other way would be to disable INST_RETIRED.ALL. > > > You cannot do th

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-14 Thread Andi Kleen
On Thu, Aug 14, 2014 at 07:47:56PM +0200, Stephane Eranian wrote: > [+perf tool maintainers] > > On Thu, Aug 14, 2014 at 4:30 PM, Andi Kleen wrote: > > > > I understand all your points, but there's no alternative. > > The only other way would be to disable INST_RETIRED.ALL. > > > You cannot do th

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-14 Thread Stephane Eranian
[+perf tool maintainers] On Thu, Aug 14, 2014 at 4:30 PM, Andi Kleen wrote: > > I understand all your points, but there's no alternative. > The only other way would be to disable INST_RETIRED.ALL. > You cannot do that either. INST_RETIRED:ALL is important. I assume the bug applies whether or not

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-14 Thread Andi Kleen
I understand all your points, but there's no alternative. The only other way would be to disable INST_RETIRED.ALL. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-14 Thread Peter Zijlstra
On Wed, Aug 13, 2014 at 06:17:48PM -0700, Andi Kleen wrote: > v2: Use correct event name in description. Use EVENT() macro. > +static unsigned bdw_limit_period(struct perf_event *event, unsigned left) > +{ > + if ((event->hw.config & 0x) == I was thinking you should use INTEL_ARCH_EVENT_M

Re: [PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-13 Thread Stephane Eranian
On Thu, Aug 14, 2014 at 3:17 AM, Andi Kleen wrote: > From: Andi Kleen > > On Broadwell INST_RETIRED.ALL cannot be used with any period > that doesn't have the lowest 6 bits cleared. And the period > should not be smaller than 128. > If you have frequency mode enabled, then I suspect this works ok

[PATCH 4/5] perf, x86: Add INST_RETIRED.ALL workarounds

2014-08-13 Thread Andi Kleen
From: Andi Kleen On Broadwell INST_RETIRED.ALL cannot be used with any period that doesn't have the lowest 6 bits cleared. And the period should not be smaller than 128. Add a new callback to enforce this, and set it for Broadwell. This is erratum BDM57 and BDM11. v2: Use correct event name in