kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Huang <wei@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: gleb@kernel.org, pbonzini@redhat.com, KVM <kvm@vger.kernel.org>
Subject: Re: [RFC] vPMU support for AMD system
Date: Thu, 02 Oct 2014 09:15:22 -0500	[thread overview]
Message-ID: <542D5DFA.7070800@redhat.com> (raw)
In-Reply-To: <20141002135058.GA28737@potion.redhat.com>

>
> (if-else forest is daunting.)
>
>> I think this approach is quite acceptable, except that there will be many
>> if-else in the code. Not clean enough.
>>
>> (b) Convert intel-pmu.c => vmx.c and convert amd-pmu.c => svm.c
>> * PMU function pointers will be created in kvm_x86_ops;
>> * The entry functions will be created inside vmx.c and svm.c respectively;
>
> I would be nicer to keep them in separate files and link to vmx/svm.
>
>> * There might be common functions defined in pmu.c.
>>
>> This design is viable too. But to be honest, it is a bit messy compared with
>> (a).
>
> This makes sense as we will use only vmx+intel_pmu and svm+amd_pmu, so
> we'd have less code loaded in both cases.
>
> I consider design (c) strictly better than the current one (2):
>    (c) keep {intel,amd}-pmu.c and introduce pmu.[hc] that joins duplicate
>        functions and wraps kvm_pmu_ops
Thanks for the suggestion. I will take this into consideration. Your 
suggestion is similar to existing svm.c/vmx.c/x86.c, which split 
distinct functions in vmx.c/svm.c; but in the meanwhile merging them in 
x86.c for common code.
>
> And if we decide to move VMX/SVM related code into their respective
> modules, we won't have to change callers.
>
Yes.

  reply	other threads:[~2014-10-02 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01  2:07 [RFC] vPMU support for AMD system Wei Huang
2014-10-02 13:50 ` Radim Krčmář
2014-10-02 14:15   ` Wei Huang [this message]
2014-10-04  7:00 ` Gleb Natapov
2014-10-06 14:26   ` 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=542D5DFA.7070800@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;
as well as URLs for NNTP newsgroup(s).