From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH V4 2/4] KVM: x86/vPMU: Create vPMU interface for VMX and SVM Date: Wed, 10 Jun 2015 22:18:06 +0200 Message-ID: <20150610201806.GE20384@8bytes.org> References: <1433481616-24884-1-git-send-email-wei@redhat.com> <1433481616-24884-3-git-send-email-wei@redhat.com> <20150610101212.GB20384@8bytes.org> <55786928.1000909@redhat.com> <20150610180531.GD20384@8bytes.org> <5578864E.7010808@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, pbonzini@redhat.com, gleb@kernel.org, rkrcmar@redhat.com To: Wei Huang Return-path: Received: from 8bytes.org ([81.169.241.247]:34562 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754498AbbFJUSI (ORCPT ); Wed, 10 Jun 2015 16:18:08 -0400 Content-Disposition: inline In-Reply-To: <5578864E.7010808@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 10, 2015 at 01:47:42PM -0500, Wei Huang wrote: > On 06/10/2015 01:05 PM, Joerg Roedel wrote: > > So how about putting the pmu-ops directly into the kvm_x86_ops as a > > (const) member, > I like this idea better. Here is the (expanded) design: > > 1) add const "struct kvm_pmu_ops *pmu_ops" to kvm_x86_ops; > 2) In VMX, "vmx_x86_ops.pmu_ops = &intel_pmu_ops"; > 3) In SVM, "svm_x86_ops.pmu_ops = &amd_pmu_ops". > > Common kvm_pmu_xxxx functions (in pmu.c) will change accordingly > afterwards. If no objection, I will do this way. Yeah, thats probably the best solution then. Extending kvm_init would be a lot more hassle. Joerg