lkml.org 
[lkml]   [2013]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()
From
On Tue, Mar 19, 2013 at 1:58 PM, Peter Zijlstra <peterz@infradead.org> 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 of the IP field.
>> >
>> We could drop it because it's covered by the memset().
>
> Yeah, but also place the memset a little lower than you did, avoids the
> stack writes when not needed.
>
Ok, I get it now. Yes, we can move it after the test and drop reg.val = 0.

>> The issue here was that you eventually end up in code_segment_base()
>> which
>> looks at other uninitialized fields in pt_regs and may cause breakage.
>
> Right, your changelog said so ;-)
>


\
 
 \ /
  Last update: 2013-03-19 14:43    [W:0.039 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site