linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Jin, Yao" <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>,
	kan.liang@linux.intel.com, mingo@redhat.com, jolsa@kernel.org,
	linux-kernel@vger.kernel.org, ak@linux.intel.com
Subject: Re: [PATCH] perf/x86/intel: Fix spurious NMI on fixed counter
Date: Fri, 5 Jul 2019 13:44:35 +0200	[thread overview]
Message-ID: <20190705114435.GQ3402@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <a0722e4d-4cae-7212-c8ec-a8d0c9edc08c@linux.intel.com>

On Fri, Jul 05, 2019 at 08:23:37AM +0800, Jin, Yao wrote:
> 
> 
> On 6/25/2019 10:58 PM, Jiri Olsa wrote:
> > On Tue, Jun 25, 2019 at 07:21:35AM -0700, kan.liang@linux.intel.com wrote:
> > > From: Kan Liang <kan.liang@linux.intel.com>
> > > 
> > > If a user first sample a PEBS event on a fixed counter, then sample a
> > > non-PEBS event on the same fixed counter on Icelake, it will trigger
> > > spurious NMI. For example,
> > > 
> > >    perf record -e 'cycles:p' -a
> > >    perf record -e 'cycles' -a
> > > 
> > > The error message for spurious NMI.
> > > 
> > >    [June 21 15:38] Uhhuh. NMI received for unknown reason 30 on CPU 2.
> > >    [  +0.000000] Do you have a strange power saving mode enabled?
> > >    [  +0.000000] Dazed and confused, but trying to continue
> > > 
> > > The issue was introduced by the following commit:
> > > 
> > >    commit 6f55967ad9d9 ("perf/x86/intel: Fix race in intel_pmu_disable_event()")
> > > 
> > > The commit moves the intel_pmu_pebs_disable() after
> > > intel_pmu_disable_fixed(), which returns immediately.
> > > The related bit of PEBS_ENABLE MSR will never be cleared for the fixed
> > > counter. Then a non-PEBS event runs on the fixed counter, but the bit
> > > on PEBS_ENABLE is still set, which trigger spurious NMI.
> > > 
> > > Check and disable PEBS for fixed counter after intel_pmu_disable_fixed().
> > > 
> > > Reported-by: Yi, Ammy <ammy.yi@intel.com>
> > > Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> > > Fixes: 6f55967ad9d9 ("perf/x86/intel: Fix race in intel_pmu_disable_event()")

> > oops, I overlooed this, looks good
> > 
> > Acked-by: Jiri Olsa <jolsa@kernel.org>

Have it now, thanks!

  reply	other threads:[~2019-07-05 11:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 14:21 [PATCH] perf/x86/intel: Fix spurious NMI on fixed counter kan.liang
2019-06-25 14:58 ` Jiri Olsa
2019-07-05  0:23   ` Jin, Yao
2019-07-05 11:44     ` Peter Zijlstra [this message]
2019-07-10 19:37       ` Andi Kleen
2019-07-13 11:13 ` [tip:perf/urgent] " tip-bot for Kan Liang

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=20190705114435.GQ3402@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=yao.jin@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).