mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Like Xu <like.xu@linux.intel.com>,
	peterz@infradead.org, kvm@vger.kernel.org
Cc: like.xu@intel.com, linux-kernel@vger.kernel.org,
	jmattson@google.com, sean.j.christopherson@intel.com,
	wei.w.wang@intel.com, kan.liang@intel.com
Subject: Re: [PATCH v3 6/6] KVM: x86/vPMU: Add lazy mechanism to release perf_event per vPMC
Date: Tue, 22 Oct 2019 12:47:11 +0200	[thread overview]
Message-ID: <c17a9d77-2c30-b3c0-4652-57f0b9252f3b@redhat.com> (raw)
In-Reply-To: <20191021160651.49508-7-like.xu@linux.intel.com>

On 21/10/19 18:06, Like Xu wrote:
>  
> +		__set_bit(INTEL_PMC_IDX_FIXED + i, pmu->pmc_in_use);
>  		reprogram_fixed_counter(pmc, new_ctrl, i);
>  	}
>  
> @@ -329,6 +330,11 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu)
>  	    (boot_cpu_has(X86_FEATURE_HLE) || boot_cpu_has(X86_FEATURE_RTM)) &&
>  	    (entry->ebx & (X86_FEATURE_HLE|X86_FEATURE_RTM)))
>  		pmu->reserved_bits ^= HSW_IN_TX|HSW_IN_TX_CHECKPOINTED;
> +
> +	bitmap_set(pmu->all_valid_pmc_idx,
> +		0, pmu->nr_arch_gp_counters);
> +	bitmap_set(pmu->all_valid_pmc_idx,
> +		INTEL_PMC_MAX_GENERIC, pmu->nr_arch_fixed_counters);

The offset needs to be INTEL_PMC_IDX_FIXED for GP counters, and 0 for
fixed counters, otherwise pmc_in_use and all_valid_pmc_idx are not in sync.

Paolo


  reply	other threads:[~2019-10-22 10:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 16:06 [PATCH v3 0/6] KVM: x86/vPMU: Efficiency optimization by reusing last created perf_event Like Xu
2019-10-21 16:06 ` [PATCH v3 1/6] perf/core: Provide a kernel-internal interface to recalibrate event period Like Xu
2019-10-21 16:06 ` [PATCH v3 2/6] perf/core: Provide a kernel-internal interface to pause perf_event Like Xu
2019-10-21 16:06 ` [PATCH v3 3/6] KVM: x86/vPMU: Rename pmu_ops callbacks from msr_idx to rdpmc_idx Like Xu
2019-10-23 17:55   ` Jim Mattson
2019-10-21 16:06 ` [PATCH v3 4/6] KVM: x86/vPMU: Introduce a new kvm_pmu_ops->msr_idx_to_pmc callback Like Xu
2019-10-26  5:28   ` [RFC PATCH] KVM: x86/vPMU: intel_msr_idx_to_pmc() can be static kbuild test robot
2019-10-26  5:28   ` [PATCH v3 4/6] KVM: x86/vPMU: Introduce a new kvm_pmu_ops->msr_idx_to_pmc callback kbuild test robot
2019-10-21 16:06 ` [PATCH v3 5/6] KVM: x86/vPMU: Reuse perf_event to avoid unnecessary pmc_reprogram_counter Like Xu
2019-10-21 16:06 ` [PATCH v3 6/6] KVM: x86/vPMU: Add lazy mechanism to release perf_event per vPMC Like Xu
2019-10-22 10:47   ` Paolo Bonzini [this message]
2019-10-22 12:00     ` Like Xu
2019-10-22 14:09       ` Paolo Bonzini

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=c17a9d77-2c30-b3c0-4652-57f0b9252f3b@redhat.com \
    --to=pbonzini@redhat.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=peterz@infradead.org \
    --cc=sean.j.christopherson@intel.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

all inboxes | Powered by JetHome®