All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>, Jiri Olsa <jolsa@redhat.com>,
	Salman Qazi <sqazi@google.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>
Subject: Re: [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer()
Date: Tue, 19 Mar 2013 13:58:22 +0100	[thread overview]
Message-ID: <1363697902.22553.43.camel@laptop> (raw)
In-Reply-To: <CABPqkBSmVzk=0nvHiuk-+XSfNX8ODXWKeJ+jUu2482=NvMoghg@mail.gmail.com>

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.

> 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 ;-)


  reply	other threads:[~2013-03-19 12:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 13:46 [PATCH] perf,x86: fix uninitialized pt_regs in intel_pmu_drain_bts_buffer() Stephane Eranian
2013-03-19 12:43 ` Peter Zijlstra
2013-03-19 12:50   ` Stephane Eranian
2013-03-19 12:58     ` Peter Zijlstra [this message]
2013-03-19 13:02       ` Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363697902.22553.43.camel@laptop \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sqazi@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.