From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCHv2 7/9] KVM: Expose the architectural performance monitoring CPUID leaf Date: Mon, 7 Nov 2011 17:54:53 +0200 Message-ID: <20111107155453.GJ8670@redhat.com> References: <1320323618-10375-1-git-send-email-gleb@redhat.com> <1320323618-10375-8-git-send-email-gleb@redhat.com> <1320674987.18053.39.camel@twins> <20111107154132.GH8670@redhat.com> <1320680757.17809.2.camel@twins> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com, linux-kernel@vger.kernel.org, mingo@elte.hu, acme@ghostprotocols.net To: Peter Zijlstra Return-path: Content-Disposition: inline In-Reply-To: <1320680757.17809.2.camel@twins> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, Nov 07, 2011 at 04:45:57PM +0100, Peter Zijlstra wrote: > On Mon, 2011-11-07 at 17:41 +0200, Gleb Natapov wrote: > > > > + entry->eax = min(cap.version, 2) > > > > + | (cap.num_counters_gp << 8) > > > > + | (cap.bit_width_gp << 16) > > > > + | (cap.events_mask_len << 24); > > > > Do you mean by doing cpuid here directly instead of checking perf > > capability? > > No I meant something like: > > union cpuid10_eax eax; > > eax.version = min(cap.version, 2); > eax.bit_width = cap.bit_width; > eax.num_counters = cap.num_counters; > eax.mask_length = cap.mask_length; > > entry->eax = eax.full; > Ah, yes. Will do that. -- Gleb.