Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757929AbcJXQuF (ORCPT ); Mon, 24 Oct 2016 12:50:05 -0400 Received: from mga04.intel.com ([192.55.52.120]:27834 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757928AbcJXQuD (ORCPT ); Mon, 24 Oct 2016 12:50:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="776965392" Date: Mon, 24 Oct 2016 09:50:00 -0700 From: Andi Kleen To: Imre Palik Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Stephane Eranian , Kan Liang , David Carrillo-Cisneros , linux-kernel@vger.kernel.org, Alexander Kozyrev , Artyom Kuanbekov , Imre Palik , Matt Wilson , David Woodhouse Subject: Re: [RFC PATCH v2] perf: honouring the cpuid for number of fixed counters in hypervisors Message-ID: <20161024165000.GF1075@tassilo.jf.intel.com> References: <1477037939-15605-1-git-send-email-imrep.amz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477037939-15605-1-git-send-email-imrep.amz@gmail.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 622 Lines: 19 On Fri, Oct 21, 2016 at 01:18:59AM -0700, Imre Palik wrote: > From: Imre Palik > > perf doesn't seem to honour the number of fixed counters specified by cpuid > leaf 0xa. It always assume that Intel CPUs have at least 3 fixed counters. > > So if some of the fixed counters are masked out by the hypervisor, it still > tries to check/set them. > > This patch makes perf behave nicer when the kernel is running under a > hypervisor that doesn't expose all the counters. > > This patch contains some ideas from Matt Wilson. Patch looks good to me. Reviewed-by: Andi Kleen -Andi