[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1603211600160.3978@nanos>
Date: Mon, 21 Mar 2016 16:03:46 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: "Liang, Kan" <kan.liang@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
Stephane Eranian <eranian@...gle.com>,
Borislav Petkov <bp@...e.de>,
"Andi Kleen (ak@...ux.intel.com)" <ak@...ux.intel.com>
Subject: Re: [patch 2/4] x86/perf/intel/cstate: Sanitize probing
On Mon, 21 Mar 2016, Peter Zijlstra wrote:
> On Mon, Mar 21, 2016 at 02:19:27PM +0000, Liang, Kan wrote:
>
> > > - /* Probe the cstate events. */
> > > - for (i = 0; i < max_event_nr; i++) {
> > > - if (!msr[i].test(i) || rdmsrl_safe(msr[i].msr, &val))
> > > - msr[i].attr = NULL;
> > > - }
> >
> > I think we need to update msr[i].attr as well.
> > Because in cstate_pmu_event_init we still need it to do check.
>
> Yeah, this is exploding on all sides..
Gah crap. Why did this not explode in my face? Delta patch below.
Thanks,
tglx
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -553,6 +553,8 @@ static bool __init cstate_probe_msr(cons
if (!rdmsrl_safe(msr[bit].msr, &val)) {
*attrs++ = &msr[bit].attr->attr.attr;
found = true;
+ } else {
+ msr[bit].attr = NULL;
}
}
*attrs = NULL;
Powered by blists - more mailing lists