Re: [perf] crashing bug in icl_update_topdown_event

From: Liang, Kan
Date: Thu Jun 12 2025 - 10:53:07 EST




On 2025-06-11 3:28 p.m., Vince Weaver wrote:
> On Wed, 11 Jun 2025, Liang, Kan wrote:
>
>>
>>
>> It seems an regression from the f9bdf1f95339 ("perf/x86/intel: Avoid
>> disable PMU if !cpuc->enabled in sample read").
>> The commit merged the intel_pmu_auto_reload_read() and
>> intel_pmu_read_topdown_event(). It's possible that a PEBS event 0x0400
>> runs on a ATOM CPU. So the PERF_X86_EVENT_AUTO_RELOAD is set for the
>> event. The is_topdown_event() also returns true.
>>
>> Does the below patch help?
>> It checks the PERF_X86_EVENT_TOPDOWN flag as well before invoking the
>> topdown functions.
>
> With this patch applied my test case no longer crashes.
>

Thanks for the test. I've posted a fix to LKML.
https://lore.kernel.org/linux-perf-users/20250612143818.2889040-1-kan.liang@xxxxxxxxxxxxxxx/

It's a little bit different from the one tested. Please check and
provide a 'tested-by' on the new patch if it works.Thanks,Kan