public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <wei@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	gleb@kernel.org
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	[thread overview]
Message-ID: <5535466A.5000808@redhat.com> (raw)
In-Reply-To: <20150409194344.GC9729@potion.brq.redhat.com>

<snip>
>> +/* 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);
>> +	
>
<snip>

  parent reply	other threads:[~2015-04-20 18:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 16:18 [PATCH V2 0/5] KVM vPMU support for AMD Wei Huang
2015-04-08 16:18 ` [PATCH V2 1/5] KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch Wei Huang
2015-04-08 16:18 ` [PATCH V2 2/5] KVM: x86/vPMU: Rename pmu.c file to pmu_intel.c Wei Huang
2015-04-09 19:10   ` Radim Krčmář
2015-04-09 19:23     ` Wei Huang
2015-04-08 16:18 ` [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM Wei Huang
2015-04-09 19:43   ` Radim Krčmář
2015-04-09 20:03     ` Wei Huang
2015-04-09 20:54       ` Radim Krčmář
2015-04-09 21:08         ` Wei Huang
2015-04-10 12:53           ` Radim Krčmář
2015-04-20 18:33     ` Wei Huang [this message]
2015-04-21  9:33       ` Radim Krčmář
2015-04-10 12:57   ` Radim Krčmář
2015-04-08 16:18 ` [PATCH V2 4/5] KVM: x86/vPMU: Implement vPMU code AMD CPUs Wei Huang
2015-04-08 16:18 ` [PATCH V2 5/5] KVM: x86/vPMU: Enable PMU handling for AMD PERFCTRn and EVNTSELn MSRs Wei Huang
2015-04-08 16:22 ` [PATCH V2 0/5] KVM vPMU support for AMD Wei Huang
2015-04-09 19:05 ` Radim Krčmář
2015-04-09 19:19   ` Wei Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5535466A.5000808@redhat.com \
    --to=wei@redhat.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox