lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aM2ICvFxB7gWnW0H@google.com>
Date: Fri, 19 Sep 2025 09:42:50 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Dapeng Mi <dapeng1.mi@...ux.intel.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Yi Lai <yi1.lai@...el.com>, dongsheng <dongsheng.x.zhang@...el.com>
Subject: Re: [PATCH v3 5/5] KVM: selftests: Handle Intel Atom errata that
 leads to PMU event overcount

On Fri, Sep 19, 2025, Sean Christopherson wrote:
> On Fri, Sep 19, 2025, Dapeng Mi wrote:
> > Or better, directly define INSTRUCTIONS_RETIRED_OVERCOUNT as a bitmap, like
> > this.
> > 
> > diff --git a/tools/testing/selftests/kvm/include/x86/pmu.h
> > b/tools/testing/selftests/kvm/include/x86/pmu.h
> > index 25d2b476daf4..9af448129597 100644
> > --- a/tools/testing/selftests/kvm/include/x86/pmu.h
> > +++ b/tools/testing/selftests/kvm/include/x86/pmu.h
> > @@ -106,8 +106,8 @@ extern const uint64_t intel_pmu_arch_events[];
> >  extern const uint64_t amd_pmu_zen_events[];
> > 
> >  enum pmu_errata {
> > -       INSTRUCTIONS_RETIRED_OVERCOUNT,
> > -       BRANCHES_RETIRED_OVERCOUNT,
> > +       INSTRUCTIONS_RETIRED_OVERCOUNT = (1 << 0),
> > +       BRANCHES_RETIRED_OVERCOUNT     = (1 << 1),
> 
> I want to utilize the auto-incrementing behavior of enums, without having to
> resort to double-defines or anything. 

The counter-argument to that is we need to remember to use BIT_ULL() when
generating the mask in get_pmu_errata().  But I think overall I prefer hiding
the use of a bitmask.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ