Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754898AbbHFP7t (ORCPT ); Thu, 6 Aug 2015 11:59:49 -0400 Received: from casper.infradead.org ([85.118.1.10]:44154 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754662AbbHFP7s (ORCPT ); Thu, 6 Aug 2015 11:59:48 -0400 Date: Thu, 6 Aug 2015 17:59:43 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: "Liang, Kan" , Thomas Gleixner , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , Andrew Lutomirski , Linus Torvalds , Ingo Molnar , "linux-tip-commits@vger.kernel.org" Subject: Re: [tip:perf/core] perf/x86: Add an MSR PMU driver Message-ID: <20150806155943.GH25159@twins.programming.kicks-ass.net> References: <1437407346-31186-1-git-send-email-kan.liang@intel.com> <37D7C6CF3E00A74B8858931C1DB2F077018D16F1@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F077018D206A@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F077018D2103@SHSMSX103.ccr.corp.intel.com> <20150806152151.GG25159@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 997 Lines: 22 On Thu, Aug 06, 2015 at 08:30:08AM -0700, Andy Lutomirski wrote: > On Thu, Aug 6, 2015 at 8:21 AM, Peter Zijlstra 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/