All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lewis <aaronlewis@google.com>
To: Like Xu <like.xu.linux@gmail.com>
Cc: pbonzini@redhat.com, jmattson@google.com, seanjc@google.com,
	kvm list <kvm@vger.kernel.org>
Subject: Re: [PATCH v8 1/7] kvm: x86/pmu: Correct the mask used in a pmu event filter lookup
Date: Wed, 28 Dec 2022 20:00:39 +0000	[thread overview]
Message-ID: <CAAAPnDE2HjrDbgzJgj7G6=5NQ11BJ=x4wmEStJkoPPCyWQmK_w@mail.gmail.com> (raw)
In-Reply-To: <37064a64-47cb-aaad-4b8e-6ce2bdf68e56@gmail.com>

> > diff --git a/arch/x86/kvm/pmu.h b/arch/x86/kvm/pmu.h
> > index 85ff3c0588ba..5b070c563a97 100644
> > --- a/arch/x86/kvm/pmu.h
> > +++ b/arch/x86/kvm/pmu.h
> > @@ -40,6 +40,8 @@ struct kvm_pmu_ops {
> >       void (*reset)(struct kvm_vcpu *vcpu);
> >       void (*deliver_pmi)(struct kvm_vcpu *vcpu);
> >       void (*cleanup)(struct kvm_vcpu *vcpu);
> > +
> > +     const u64 EVENTSEL_EVENT;
>
> Isn't it weird when the new thing added here is
> not of the same type as the existing members ?
>
> Doesn't "pmu->raw_event_mask" help here ?
>

In earlier revisions I had this as a callback, but it was a little
awkward being that I really just wanted it to be a const that differed
depending on platform.  Making it a const fit more naturally when
using it than the callback approach, so despite it being different
from the others here I think it works better overall.

> >   };
> >
> >   void kvm_pmu_ops_update(const struct kvm_pmu_ops *pmu_ops);
> > diff --git a/arch/x86/kvm/svm/pmu.c b/arch/x86/kvm/svm/pmu.c
> > index 0e313fbae055..d3ae261d56a6 100644
> > --- a/arch/x86/kvm/svm/pmu.c
> > +++ b/arch/x86/kvm/svm/pmu.c
> > @@ -229,4 +229,5 @@ struct kvm_pmu_ops amd_pmu_ops __initdata = {
> >       .refresh = amd_pmu_refresh,
> >       .init = amd_pmu_init,
> >       .reset = amd_pmu_reset,
> > +     .EVENTSEL_EVENT = AMD64_EVENTSEL_EVENT,
> >   };
> > diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c
> > index e5cec07ca8d9..edf23115f2ef 100644
> > --- a/arch/x86/kvm/vmx/pmu_intel.c
> > +++ b/arch/x86/kvm/vmx/pmu_intel.c
> > @@ -810,4 +810,5 @@ struct kvm_pmu_ops intel_pmu_ops __initdata = {
> >       .reset = intel_pmu_reset,
> >       .deliver_pmi = intel_pmu_deliver_pmi,
> >       .cleanup = intel_pmu_cleanup,
> > +     .EVENTSEL_EVENT = ARCH_PERFMON_EVENTSEL_EVENT,
> >   };

  reply	other threads:[~2022-12-28 20:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 16:12 [PATCH v8 0/7] Introduce and test masked events Aaron Lewis
2022-12-20 16:12 ` [PATCH v8 1/7] kvm: x86/pmu: Correct the mask used in a pmu event filter lookup Aaron Lewis
2022-12-22  6:19   ` Like Xu
2022-12-28 20:00     ` Aaron Lewis [this message]
2023-01-03 18:28       ` Sean Christopherson
2022-12-20 16:12 ` [PATCH v8 2/7] kvm: x86/pmu: Remove impossible events from the pmu event filter Aaron Lewis
2022-12-20 16:12 ` [PATCH v8 3/7] kvm: x86/pmu: prepare the pmu event filter for masked events Aaron Lewis
2022-12-22  6:34   ` Like Xu
2022-12-20 16:12 ` [PATCH v8 4/7] kvm: x86/pmu: Introduce masked events to the pmu event filter Aaron Lewis
2022-12-22  7:40   ` Like Xu
2022-12-28 20:00     ` Aaron Lewis
2022-12-20 16:12 ` [PATCH v8 5/7] selftests: kvm/x86: Add flags when creating a " Aaron Lewis
2022-12-20 16:12 ` [PATCH v8 6/7] selftests: kvm/x86: Add testing for KVM_SET_PMU_EVENT_FILTER Aaron Lewis
2022-12-20 16:12 ` [PATCH v8 7/7] selftests: kvm/x86: Test masked events Aaron Lewis
2023-01-19 20:57 ` [PATCH v8 0/7] Introduce and test " Sean Christopherson
2023-01-20 18:11   ` Sean Christopherson

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='CAAAPnDE2HjrDbgzJgj7G6=5NQ11BJ=x4wmEStJkoPPCyWQmK_w@mail.gmail.com' \
    --to=aaronlewis@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=like.xu.linux@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.