From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Huang Subject: Re: [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM Date: Mon, 20 Apr 2015 13:33:14 -0500 Message-ID: <5535466A.5000808@redhat.com> References: <1428509905-32352-1-git-send-email-wei@redhat.com> <1428509905-32352-4-git-send-email-wei@redhat.com> <20150409194344.GC9729@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Paolo Bonzini , gleb@kernel.org To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbbDTSdR (ORCPT ); Mon, 20 Apr 2015 14:33:17 -0400 In-Reply-To: <20150409194344.GC9729@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: >> +/* check if msr_idx is a valid index to access PMU */ >> +inline int kvm_pmu_check_msr_idx(struct kvm_vcpu *vcpu, unsigned msr_idx) > > If we really want it inline, it's better done in header. > (I think GCC would inline this in-module anyway, but other modules still > have to call it.) > >> +{ >> + return kvm_pmu_ops->check_msr_idx(vcpu, msr_idx); >> +} >> + > | [...] >> +bool kvm_pmu_is_msr(struct kvm_vcpu *vcpu, u32 msr) > > (Might make sense to inline these trivial wrappers.) Hi Radim, I forgot to mention that I didn't create inline for these functions in V3. For an inline to work on across source files, I have to explicitly use "extern"; so I decided not to touch it in V3 yet. If you insist, I will change it. Another solution is to replace the functions with kvm_opmu_ops->blah_blah(). But this looks less appealing to me. Thanks, -Wei > >> +{ >> + return kvm_pmu_ops->is_pmu_msr(vcpu, msr); >> +} >> + >> +int kvm_pmu_get_msr(struct kvm_vcpu *vcpu, u32 msr, u64 *data) >> +{ >> + return kvm_pmu_ops->get_msr(vcpu, msr, data); >> +} >> + >> +int kvm_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) >> +{ >> + return kvm_pmu_ops->set_msr(vcpu, msr_info); >> + >