Re: [tip:perf/core] perf/x86: Add an MSR PMU driver

Peter Zijlstra
2015-08-06T15:59:49Z

On Thu, Aug 06, 2015 at 08:30:08AM -0700, Andy Lutomirski wrote:
> On Thu, Aug 6, 2015 at 8:21 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Tue, Aug 04, 2015 at 08:39:27PM +0000, Liang, Kan wrote:
> > - default:
> > - err = -ENOTSUPP;
> > + if (!msr[i].test() || rdmsrl_safe(msr[i].msr, &val))
> > + msr[i].attr = NULL;
>
> IIRC rdmsrl_safe literally never fails under QEMU TCG, and I'm not

*sigh* the borkage never stops does it :-(

> entirely sure what happens under KVM if emulation kicks in. It might
> pay to keep the model check for the non-architectural stuff, or at
> least check for a nonzero return value.

Of course, 0 might be a valid value.. Esp. for the SMI counter.