From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yan, Zheng" Subject: Re: perf uncore & lkvm woes Date: Tue, 21 Aug 2012 17:07:54 +0800 Message-ID: <50334FEA.4060205@linux.intel.com> References: <1345101585.31459.112.camel@twins> <502CA368.8050404@linux.intel.com> <502CB1F6.4010204@redhat.com> <502CD444.5020807@redhat.com> <1345115846.29668.16.camel@twins> <502CD891.5030102@redhat.com> <502DA115.1090907@linux.intel.com> <1345186574.29668.56.camel@twins> <5030B82C.5000106@redhat.com> <5031B9C9.5020401@linux.intel.com> <5031FA2C.2060306@redhat.com> <5032E02F.7060104@linux.intel.com> <50334781.4020903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Peter Zijlstra , Pekka Enberg , Sasha Levin , Asias He , Cyrill Gorcunov , Ingo Molnar , KVM General , Gleb Natapov To: Avi Kivity Return-path: Received: from mga09.intel.com ([134.134.136.24]:48919 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754403Ab2HUJIH (ORCPT ); Tue, 21 Aug 2012 05:08:07 -0400 In-Reply-To: <50334781.4020903@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/21/2012 04:32 PM, Avi Kivity wrote: > On 08/21/2012 04:11 AM, Yan, Zheng wrote: > >>>> There is only one kvm_pmu structure in struct kvm_vcpu_arch, but the uncore >>>> driver may define dozens of PMUs. Besides the uncore PMUs make extensive use >>>> of extra registers, I don't think we can store these information in kvm_pmu >>>> structure. >>> >>> We don't need to store any information, just respond to those MSRs (and >>> ignore them). >> >> The problem is that there are hundreds of MSRs, but only a few of them are >> defined in the header file of uncore driver. The uncore driver computes >> addresses of the rest MSRs by using uncore box index and counter index. > > You can do the same in kvm. Maybe even move the functions that compute > the addresses to a header, so that they can be shared. > > Can you point me at the code? Maybe I'm misunderstanding something here. > The code are located at linux/arch/x86/kernel/cpu/perf_event_intel_uncore.{h,c}. Regards Yan, Zheng