lkml.org 
[lkml]   [2021]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[]
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 */
>

\
 
 \ /
  Last update: 2021-01-15 18:32    [W:0.157 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site