All of lore.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, pbonzini@redhat.com, gleb@kernel.org
Subject: Re: [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM
Date: Thu, 09 Apr 2015 16:08:38 -0500	[thread overview]
Message-ID: <5526EA56.7010403@redhat.com> (raw)
In-Reply-To: <20150409205453.GA17888@potion.brq.redhat.com>

<snip>
>>>> @@ -4918,13 +4919,13 @@ static int emulator_set_msr(struct x86_emulate_ctxt *ctxt,
>>>>  static int emulator_check_pmc(struct x86_emulate_ctxt *ctxt,
>>>>  			      u32 pmc)
>>>>  {
>>>> -	return kvm_pmu_check_pmc(emul_to_vcpu(ctxt), pmc);
>>>> +	return kvm_pmu_check_msr_idx(emul_to_vcpu(ctxt), pmc);
>>>
>>> (Why not pmc?)
>> See "Design Note" in pmu.c for a better explanation. I tried to use msr as
>> real x86 MSR; and msr_idx refers to MSR offset.
> 
> I skipped the comment as I thought it was there before, sorry ...
> 
> I wouldn't call it MSR index, MSR is just a related interface for PMC,
> and MSR indices don't even have simple mapping to RDPMC ones.
> We are indexing PMC without MSR, so index/pmc_idx/pmc seems better.
> 
I can fix the name of this function (maybe back to kvm_pmu_check_pmc(),
let me think about it). In the meanwhile, do you have any comments on
the following names? They will impact the rest code:

* msr: MSR for x86
* msr_idx: offset of MSR registers (used by rdpmc)
* glb_idx: a unified index for both GP and fixed counters (should we
rename it to idx instead?)

Are they confusing to you? Maybe I should move "Design Note" to commit
message instead of real code?

Thanks,
-Wei

  reply	other threads:[~2015-04-09 21:08 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 [this message]
2015-04-10 12:53           ` Radim Krčmář
2015-04-20 18:33     ` Wei Huang
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=5526EA56.7010403@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.