mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Zide" <zide.chen@intel.com>
To: Yosry Ahmed <yosry@kernel.org>, Jim Mattson <jmattson@google.com>
Cc: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	kvm@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org, Mingwei Zhang <mizhang@google.com>,
	Das Sandipan <Sandipan.Das@amd.com>,
	Shukla Manali <Manali.Shukla@amd.com>,
	Dapeng Mi <dapeng1.mi@linux.intel.com>,
	Xudong Hao <xudong.hao@intel.com>
Subject: Re: [PATCH v9 05/12] KVM: x86/pmu: Support PERF_METRICS MSR in mediated vPMU
Date: Fri, 30 Oct 2026 10:47:05 -0500	[thread overview]
Message-ID: <0ccdf391-4c38-48c5-bb74-db36e55e800b@intel.com> (raw)
In-Reply-To: <CAO9r8zM0rTuROCTYdMQhdghDcbYBhfK=ezU_wU2GeM_w7FBPDw@mail.gmail.com>



On 10/29/2026 6:32 PM, Yosry Ahmed wrote:
> On Thu, Oct 29, 2026 at 4:26 PM Jim Mattson <jmattson@google.com> wrote:
>>
>> On Thu, Oct 29, 2026 at 4:19 PM Yosry Ahmed <yosry@kernel.org> wrote:
>>>
>>> On Thu, Oct 29, 2026 at 4:17 PM Chen, Zide <zide.chen@intel.com> wrote:
>>>>
>>>>
>>>>
>>>> On 10/29/2026 5:06 PM, Yosry Ahmed wrote:
>>>>>> diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
>>>>>> index 448044a2b121..f4d3801b97bc 100644
>>>>>> --- a/arch/x86/kvm/pmu.c
>>>>>> +++ b/arch/x86/kvm/pmu.c
>>>>>> @@ -806,9 +806,16 @@ static bool kvm_need_any_pmc_intercept(struct kvm_vcpu *vcpu)
>>>>>>                pmu->nr_arch_fixed_counters != kvm_host_pmu.num_counters_fixed;
>>>>>>  }
>>>>>>
>>>>>> +static bool kvm_need_perf_metrics_intercept(struct kvm_vcpu *vcpu)
>>>>>
>>>>> The name is confusing, this doesn't control the intercept of
>>>>> PERF_METRICS (and it wouldn't be correct to use it for that AFAICT).
>>>>
>>>> Right, these two APIs do not directly determine whether the mentioned
>>>> resources need interception:
>>>>
>>>> kvm_need_any_pmc_intercept()
>>>> kvm_need_perf_metrics_intercept()
>>>
>>> Jim suggested folding kvm_need_perf_metrics_intercept() into
>>> kvm_need_any_pmc_intercept(). The name of kvm_need_any_pmc_intercept()
>>> might be confusing as well, but at least it's one less interface to
>>> worry about?
>>>
>>>>
>>>> This is different from kvm_need_perf_global_ctrl_intercept() and
>>>> kvm_need_rdpmc_intercept().
>>>>
>>>> How about change them to something like these?
>>>>
>>>> kvm_pmu_has_unexposed_pmcs()
>>>> kvm_pmu_has_unexposed_perf_metrics()
>>>>
>>>> Or merge them into one single API? kvm_pmu_has_unexposed_resources()
>>>
>>> I don't like this name any better, but I don't have better
>>> suggestions. Since we already have kvm_need_any_pmc_intercept(), let's
>>> just use it for now?
>>
>> How about kvm_pmu_incomplete_passthrough()?
> 
> Better than kvm_need_any_pmc_intercept() imo.

OK, I can rename it in v3.


  reply	other threads:[~2026-10-30 15:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 19:39 [PATCH v9 00/12] KVM: x86/pmu: Add hardware Topdown metrics support Zide Chen
2026-09-18 19:39 ` [PATCH v9 01/12] KVM: x86/pmu: Do not map fixed counters >= 3 to generic perf events Zide Chen
2026-09-18 19:39 ` [PATCH v9 02/12] KVM: x86/pmu: Support Intel fixed counter 3 on mediated vPMU Zide Chen
2026-09-18 19:39 ` [PATCH v9 03/12] KVM: x86/pmu: Rename and move vcpu_get_perf_capabilities() to pmu.h Zide Chen
2026-09-18 19:39 ` [PATCH v9 04/12] KVM: x86/pmu: Snapshot host IA32_PERF_CAPABILITIES in kvm_host Zide Chen
2026-09-18 19:39 ` [PATCH v9 05/12] KVM: x86/pmu: Support PERF_METRICS MSR in mediated vPMU Zide Chen
2026-10-23 18:27   ` Jim Mattson
2026-10-27 21:30     ` Chen, Zide
2026-10-29 21:28       ` Yosry Ahmed
2026-10-29 22:06   ` Yosry Ahmed
2026-10-29 23:17     ` Chen, Zide
2026-10-29 23:19       ` Yosry Ahmed
2026-10-29 23:26         ` Jim Mattson
2026-10-29 23:32           ` Yosry Ahmed
2026-10-30 15:47             ` Chen, Zide [this message]
2026-09-18 19:39 ` [PATCH v9 06/12] KVM: x86/pmu: Move RDPMC emulation into per-vendor callbacks Zide Chen
2026-09-18 19:39 ` [PATCH v9 07/12] KVM: x86/pmu: Emulate RDPMC on performance metrics Zide Chen
2026-10-23 18:33   ` Jim Mattson
2026-09-18 19:39 ` [PATCH v9 08/12] KVM: selftests: Add PERF_METRICS and fixed counter 3 tests Zide Chen
2026-09-18 19:39 ` [PATCH v9 09/12] perf/x86: Add INTEL_TD_METRIC_FIELD_{BITS,MASK} constants Zide Chen
2026-09-21  7:01   ` Mi, Dapeng
2026-10-27 21:39     ` Chen, Zide
2026-09-18 19:39 ` [PATCH v9 10/12] perf/x86: Expose number of Topdown metric events to KVM Zide Chen
2026-09-21  7:06   ` Mi, Dapeng
2026-09-18 19:39 ` [PATCH v9 11/12] KVM: x86/pmu: Reject writes to reserved MSR_PERF_METRICS bits Zide Chen
2026-09-21  7:11   ` Mi, Dapeng
2026-10-23 18:45   ` Jim Mattson
2026-10-27 22:09     ` Chen, Zide
2026-09-18 19:39 ` [PATCH v9 12/12] KVM: x86/pmu: Support RDPMC Metrics Clear Mode Zide Chen
2026-10-23 18:55   ` Jim Mattson
2026-10-27 22:17     ` Chen, Zide

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=0ccdf391-4c38-48c5-bb74-db36e55e800b@intel.com \
    --to=zide.chen@intel.com \
    --cc=Manali.Shukla@amd.com \
    --cc=Sandipan.Das@amd.com \
    --cc=ak@linux.intel.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mizhang@google.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=xudong.hao@intel.com \
    --cc=yosry@kernel.org \
    /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®