Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753912Ab2B0QS5 (ORCPT ); Mon, 27 Feb 2012 11:18:57 -0500 Received: from merlin.infradead.org ([205.233.59.134]:48234 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753600Ab2B0QS4 convert rfc822-to-8bit (ORCPT ); Mon, 27 Feb 2012 11:18:56 -0500 Message-ID: <1330359518.11248.72.camel@twins> Subject: Re: [PATCH] perf_event use rdpmc rather than rdmsr when possible in kernel From: Peter Zijlstra To: Vince Weaver Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, Paul Mackerras , Arnaldo Carvalho de Melo , Stephane Eranian Date: Mon, 27 Feb 2012 17:18:38 +0100 In-Reply-To: References: <1330342762.11248.69.camel@twins> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1147 Lines: 24 On Mon, 2012-02-27 at 11:06 -0500, Vince Weaver wrote: > > > + new_raw_count=native_read_pmc(hwc->event_base_rdpmc); > > > > That really wants to be rdpmc(), bypassing paravirt like that isn't > > nice. > > I couldn't find another usable rdpmc() call in the kernel. Should I add > one? I admit I hadn't thought that this might break VMs not expecting > rdpmc calls from the kernel. arch/x86/include/asm/msr.h #define rdpmc(counter, low, high) \ do { \ u64 _l = native_read_pmc((counter)); \ (low) = (u32)_l; \ (high) = (u32)(_l >> 32); \ } while (0) -- 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/