public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Colton Lewis <coltonlewis@google.com>
Cc: Mingwei Zhang <mizhang@google.com>,
	kvm@vger.kernel.org, ljr.kernel@gmail.com,  jmattson@google.com,
	aaronlewis@google.com, pbonzini@redhat.com,  shuah@kernel.org,
	linux-kselftest@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves
Date: Thu, 29 Aug 2024 13:25:21 -0700	[thread overview]
Message-ID: <ZtDZMZgYp7F6e_Qd@google.com> (raw)
In-Reply-To: <gsntjzg09tgm.fsf@coltonlewis-kvm.c.googlers.com>

On Wed, Aug 28, 2024, Colton Lewis wrote:
> Hi Mingwei, thanks for reviewing!
> 
> Mingwei Zhang <mizhang@google.com> writes:
> 
> > On Tue, Aug 13, 2024, Colton Lewis wrote:
> > > This defined the CPUID calls to determine what extensions and
> > > properties are available. AMD reference manual names listed below.
> 
> > > * PerfCtrExtCore (six core counters instead of four)
> > > * PerfCtrExtNB (four counters for northbridge events)
> > > * PerfCtrExtL2I (four counters for L2 cache events)
> > > * PerfMonV2 (support for registers to control multiple
> > >    counters with a single register write)
> > > * LbrAndPmcFreeze (support for freezing last branch recorded stack on
> > >    performance counter overflow)
> > > * NumPerfCtrCore (number of core counters)
> > > * NumPerfCtrNB (number of northbridge counters)
> 
> > > Signed-off-by: Colton Lewis <coltonlewis@google.com>
> > > ---
> > >   tools/testing/selftests/kvm/include/x86_64/processor.h | 7 +++++++
> > >   1 file changed, 7 insertions(+)
> 
> > > diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h
> > > b/tools/testing/selftests/kvm/include/x86_64/processor.h
> > > index a0c1440017bb..9d87b5f8974f 100644
> > > --- a/tools/testing/selftests/kvm/include/x86_64/processor.h
> > > +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h
> > > @@ -183,6 +183,9 @@ struct kvm_x86_cpu_feature {
> > >   #define	X86_FEATURE_GBPAGES		KVM_X86_CPU_FEATURE(0x80000001, 0, EDX, 26)
> > >   #define	X86_FEATURE_RDTSCP		KVM_X86_CPU_FEATURE(0x80000001, 0, EDX, 27)
> > >   #define	X86_FEATURE_LM			KVM_X86_CPU_FEATURE(0x80000001, 0, EDX, 29)
> > > +#define	X86_FEATURE_PERF_CTR_EXT_CORE	KVM_X86_CPU_FEATURE(0x80000001,
> > > 0, ECX, 23)
> > > +#define	X86_FEATURE_PERF_CTR_EXT_NB	KVM_X86_CPU_FEATURE(0x80000001,
> > > 0, ECX, 24)
> > > +#define	X86_FEATURE_PERF_CTR_EXT_L2I	KVM_X86_CPU_FEATURE(0x80000001,
> > > 0, ECX, 28)
> 
> > You won't be testing Northbridge counters and L2I counters, so these two
> > could be optional to the patch.
> 
> That's correct. Since it was a small thing to include I thought it best
> to include and save someone in the future from digging through the
> reference manual again.

+1.  They're defines, i.e. have no meaningful cost.  And anything that *might*
save me from having to find CPUID entries in the SDM/APM is worth adding.

  reply	other threads:[~2024-08-29 20:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 16:42 [PATCH 0/6] Extend pmu_counters_test to AMD CPUs Colton Lewis
2024-08-13 16:42 ` [PATCH 1/6] KVM: x86: selftests: Fix typos in macro variable use Colton Lewis
2024-08-21 18:21   ` Mingwei Zhang
2024-08-28 21:24     ` Colton Lewis
2024-08-13 16:42 ` [PATCH 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves Colton Lewis
2024-08-26 22:27   ` Mingwei Zhang
2024-08-28 22:24     ` Colton Lewis
2024-08-29 20:25       ` Sean Christopherson [this message]
2024-08-13 16:42 ` [PATCH 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test Colton Lewis
2024-08-26 22:43   ` Mingwei Zhang
2024-08-28 22:39     ` Colton Lewis
2024-08-28 23:18       ` Mingwei Zhang
2024-08-29 20:45         ` Sean Christopherson
2024-09-02 18:37           ` Colton Lewis
2024-08-13 16:42 ` [PATCH 4/6] KVM: x86: selftests: Test read/write core counters Colton Lewis
2024-08-13 16:42 ` [PATCH 5/6] KVM: x86: selftests: Test core events Colton Lewis
2024-08-13 16:42 ` [PATCH 6/6] KVM: x86: selftests: Test PerfMonV2 Colton Lewis
2024-08-13 17:36 ` [PATCH 0/6] Extend pmu_counters_test to AMD CPUs Sean Christopherson
2024-08-13 20:09   ` Colton Lewis
2024-08-14  1:03     ` Sean Christopherson
2024-08-14 16:58       ` Colton Lewis
  -- strict thread matches above, loose matches on Subject: below --
2024-08-02 18:22 [PATCH 0/7] " Colton Lewis
2024-08-02 18:22 ` [PATCH 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves Colton Lewis

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=ZtDZMZgYp7F6e_Qd@google.com \
    --to=seanjc@google.com \
    --cc=aaronlewis@google.com \
    --cc=coltonlewis@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ljr.kernel@gmail.com \
    --cc=mizhang@google.com \
    --cc=pbonzini@redhat.com \
    --cc=shuah@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