Re: [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()

2013-03-19 Thread Stephane Eranian
On Tue, Mar 19, 2013 at 1:58 PM, Peter Zijlstra wrote: > On Tue, 2013-03-19 at 13:50 +0100, Stephane Eranian wrote: >> > Should we not replace: >> > >> > regs.ip = 0; >> > >> > with that memset? It avoids the memset work in a few cases and >> removes >> > the then superfluous clearing

Re: [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()

2013-03-19 Thread Peter Zijlstra
On Tue, 2013-03-19 at 13:50 +0100, Stephane Eranian wrote: > > Should we not replace: > > > > regs.ip = 0; > > > > with that memset? It avoids the memset work in a few cases and > removes > > the then superfluous clearing of the IP field. > > > We could drop it because it's covered by t

Re: [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()

2013-03-19 Thread Stephane Eranian
On Tue, Mar 19, 2013 at 1:43 PM, Peter Zijlstra wrote: > On Mon, 2013-03-18 at 14:46 +0100, Stephane Eranian wrote: >> >> This patch fixes an uninitialized pt_regs struct in drain BTS >> function. The pt_regs struct is propagated all the way to the >> code_get_segment() function from perf_instruct

Re: [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()

2013-03-19 Thread Peter Zijlstra
On Mon, 2013-03-18 at 14:46 +0100, Stephane Eranian wrote: > > This patch fixes an uninitialized pt_regs struct in drain BTS > function. The pt_regs struct is propagated all the way to the > code_get_segment() function from perf_instruction_pointer() > and may get garbage. > > We cannot simply in

[PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()

2013-03-18 Thread Stephane Eranian
This patch fixes an uninitialized pt_regs struct in drain BTS function. The pt_regs struct is propagated all the way to the code_get_segment() function from perf_instruction_pointer() and may get garbage. We cannot simply inherit the actual pt_regs from the interrupt because BTS must be flushed