Re: [Patch v3 1/8] perf/x86/intel: Remove anythread_deprecated bit from perf_capabilities
From: Peter Zijlstra
Date: Tue Jun 16 2026 - 06:04:35 EST
On Mon, Jun 15, 2026 at 08:59:29AM +0800, Mi, Dapeng wrote:
>
> On 6/12/2026 5:46 PM, Peter Zijlstra wrote:
> > On Fri, Jun 12, 2026 at 05:01:07PM +0800, Dapeng Mi wrote:
> >> AnyThread mode deprecation is enumerated by CPUID.0AH:EDX[15] instead of
> >> PERF_CAPABILITIES MSR. It's not a good practice to define a bit to
> >> represent "anythread deprecation" in perf_capabilities. It leads to the
> >> anythread_deprecated bit could be overwritten by the real value of
> >> PERF_CAPABILITIES MSR, just like the below code in update_pmu_cap() does.
> >>
> >> ```
> >> if (!intel_pmu_broken_perf_cap()) {
> >> /* Perf Metric (Bit 15) and PEBS via PT (Bit 16) are hybrid enumeration */
> >> rdmsrq(MSR_IA32_PERF_CAPABILITIES, hybrid(pmu, intel_cap).capabilities);
> >> }
> >> ```
> >>
> >> It leads to the anythread_deprecated bit is cleared to 0 and the "any"
> >> attribute is incorrectly shown in the /sys/devices/cpu/format/ folder on
> >> these support Perfmon v6 platforms, like Clearwater Forest.
> >>
> >> ```
> >> $grep . /sys/devices/cpu/format/*
> >> /sys/devices/cpu/format/acr_mask:config2:0-63
> >> /sys/devices/cpu/format/any:config:21
> >> /sys/devices/cpu/format/cmask:config:24-31
> >> ```
> >>
> >> So remove the anythread_deprecated bit from perf_capabilities structure
> >> and directly depends on CPUID.0AH:EDX[15] to judge if anythread is
> >> deprecated.
> > Again, no markdown please. I've stripped it from these patches.
>
> My bad. Thanks a lot.
>
> BTW, Peter, have you pull these patches? I didn't see them in perf/core or
> perf/urgent branches. Sashiko reports a defect about "Patch 5/8:
> perf/x86/intel: Validate the return value of intel_pmu_init_hybrid()". If
> not, I would post a v4 patchset to fix the defect. Thanks.
>
I had them in queue:perf/core, but realized it was *really* late in the
window. I'll probably move them into tip post -rc1. If there's a new
version by then, I'll be sure to pick it up.