public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Like Xu <like.xu@linux.intel.com>, kvm@vger.kernel.org
Cc: peterz@infradead.org, Jim Mattson <jmattson@google.com>,
	rkrcmar@redhat.com, sean.j.christopherson@intel.com,
	vkuznets@redhat.com, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	ak@linux.intel.com, wei.w.wang@intel.com, kan.liang@intel.com,
	like.xu@intel.com, ehankland@google.com, arbel.moshe@oracle.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] KVM: x86/vPMU: Add lazy mechanism to release perf_event per vPMC
Date: Mon, 21 Oct 2019 17:28:31 +0200	[thread overview]
Message-ID: <2175c2cd-2c1e-22e8-2f67-3fc334ef2a40@redhat.com> (raw)
In-Reply-To: <c2979d05-4536-e3b5-e2f6-3e6740c1a82d@linux.intel.com>

On 21/10/19 16:04, Like Xu wrote:
> 
>>
>> 2) introduce a new callback msr_idx_to_pmc that returns a struct
>> kvm_pmc*, and change kvm_pmu_is_valid_msr to do
> 
> For callback msr_idx_to_pmc,
> how do we deal with the input 'MSR_CORE_PERF_FIXED_CTR_CTRL'
> which may return several fixed kvm_pmcs not just one?

For RDMSR, do not do anything.  For WRMSR, you can handle it in the
set_msr callback.

>>
>> static int kvm_pmu_mark_pmc_in_use(struct kvm_vcpu *vcpu, u32 msr)
> 
> s/static int/static void/.
> 
>> {
>>     struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
>>     struct kvm_pmc *pmc = kvm_x86_ops->pmu_ops->msr_idx_to_pmc(vcpu, msr);
> 
> We need 'if(pmc)' here.

Agreed, sorry for the sloppiness.  Never interpret my suggestions as
more than pseudocode. :)

Paolo

  reply	other threads:[~2019-10-21 15:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-13  9:15 [PATCH v2 0/4] KVM: x86/vPMU: Efficiency optimization by reusing last created perf_event Like Xu
2019-10-13  9:15 ` [PATCH v2 1/4] perf/core: Provide a kernel-internal interface to recalibrate event period Like Xu
2019-10-13  9:15 ` [PATCH v2 2/4] perf/core: Provide a kernel-internal interface to pause perf_event Like Xu
2019-10-14 11:51   ` Peter Zijlstra
2019-10-15  1:47     ` Like Xu
2019-10-13  9:15 ` [PATCH v2 3/4] KVM: x86/vPMU: Reuse perf_event to avoid unnecessary pmc_reprogram_counter Like Xu
2019-10-21  8:12   ` Paolo Bonzini
2019-10-21  8:16     ` Like Xu
2019-10-13  9:15 ` [PATCH v2 4/4] KVM: x86/vPMU: Add lazy mechanism to release perf_event per vPMC Like Xu
2019-10-21  8:45   ` Paolo Bonzini
2019-10-21 14:04     ` Like Xu
2019-10-21 15:28       ` Paolo Bonzini [this message]
2019-10-21 10:55         ` [PATCH] KVM: x86/vPMU: Declare kvm_pmu->reprogram_pmi field using DECLARE_BITMAP Like Xu
2019-10-22 11:40           ` Paolo Bonzini
2019-10-21  2:26 ` [PATCH v2 0/4] KVM: x86/vPMU: Efficiency optimization by reusing last created perf_event Like Xu

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=2175c2cd-2c1e-22e8-2f67-3fc334ef2a40@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=arbel.moshe@oracle.com \
    --cc=ehankland@google.com \
    --cc=jmattson@google.com \
    --cc=kan.liang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=like.xu@intel.com \
    --cc=like.xu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.w.wang@intel.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