From: Sean Christopherson <seanjc@google.com>
To: Like Xu <like.xu@linux.intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Stephane Eranian <eranian@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[]
Date: Fri, 15 Jan 2021 09:30:24 -0800 [thread overview]
Message-ID: <YAHRMK5SmrmMx8hg@google.com> (raw)
In-Reply-To: <1ff5381c-3057-7ca2-6f62-bbdcefd8e427@linux.intel.com>
On Fri, Jan 15, 2021, Like Xu wrote:
> Ping ?
>
> On 2020/12/30 16:19, Like Xu wrote:
> > The HW_REF_CPU_CYCLES event on the fixed counter 2 is pseudo-encoded as
> > 0x0300 in the intel_perfmon_event_map[]. Correct its usage.
> >
> > Fixes: 62079d8a4312 ("KVM: PMU: add proper support for fixed counter 2")
> > Signed-off-by: Like Xu <like.xu@linux.intel.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
> > ---
> > arch/x86/kvm/vmx/pmu_intel.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c
> > index a886a47daebd..013e8d253dfa 100644
> > --- a/arch/x86/kvm/vmx/pmu_intel.c
> > +++ b/arch/x86/kvm/vmx/pmu_intel.c
> > @@ -29,7 +29,7 @@ static struct kvm_event_hw_type_mapping intel_arch_events[] = {
> > [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES },
> > [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS },
> > [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES },
> > - [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES },
> > + [7] = { 0x00, 0x03, PERF_COUNT_HW_REF_CPU_CYCLES },
In a follow up patch, would it be sane/appropriate to define these magic numbers
in asm/perf_event.h and share them between intel_perfmon_event_map and
intel_arch_events? Without this patch, it's not at all obvious that these are
intended to align with the Core (arch?) event definitions.
> > };
> > /* mapping between fixed pmc index and intel_arch_events array */
>
next prev parent reply other threads:[~2021-01-15 17:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 8:19 [PATCH] KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] Like Xu
2021-01-15 8:46 ` Like Xu
2021-01-15 17:30 ` Sean Christopherson [this message]
2021-01-18 4:40 ` Xu, Like
2021-01-20 1:13 ` Sean Christopherson
2021-01-18 17:57 ` 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=YAHRMK5SmrmMx8hg@google.com \
--to=seanjc@google.com \
--cc=eranian@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=like.xu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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).