Bug 213443 - ADL: hw perf events fixed 5 > max(4), clipping
Summary: ADL: hw perf events fixed 5 > max(4), clipping
Status: NEW
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: x86-64 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_x86_64@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-15 15:21 UTC by You-Sheng Yang
Modified: 2021-06-29 05:37 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.13-rc6
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg of kernel v5.13-rc6 (84.51 KB, text/plain)
2021-06-15 15:21 UTC, You-Sheng Yang
Details
lscpu (2.52 KB, text/plain)
2021-06-15 15:22 UTC, You-Sheng Yang
Details
dmesg with perf/core branch merged into v5.13-rc7 (83.51 KB, text/plain)
2021-06-29 05:37 UTC, You-Sheng Yang
Details

Description You-Sheng Yang 2021-06-15 15:21:56 UTC
Created attachment 297371 [details]
dmesg of kernel v5.13-rc6

In arch/x86/events/intel/core.c, function intel_pmu_init, it has:

  /* Initialize big core specific PerfMon capabilities.*/
  pmu = &x86_pmu.hybrid_pmu[X86_HYBRID_PMU_CORE_IDX];
  ...
  pmu->num_counters_fixed = x86_pmu.num_counters_fixed + 1;

while x86_pmu.num_counters_fixed on this platform has been previously set to 4, this causes pmu->num_counters_fixed to have value 5, and it will trigger a warning in intel_pmu_check_num_counters() when called by intel_pmu_check_hybrid_pmus() later:

[    0.142681] Performance Events: XSAVE Architectural LBR, PEBS fmt4+-baseline,  AnyThread deprecated, Alderlake Hybrid events, 32-deep LBR, full-width counters, 
[    0.142734] ------------[ cut here ]------------
[    0.142735] hw perf events fixed 5 > max(4), clipping!
[    0.142736] WARNING: CPU: 0 PID: 1 at arch/x86/events/intel/core.c:5397 intel_pmu_check_num_counters+0x68/0x82
[    0.142743] Modules linked in:
[    0.142745] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.13.0-051300rc6-generic #202106132230
[    0.142747] Hardware name: Dell Inc. OptiPlex 3000/, BIOS 0.6.15 06/04/2021
[    0.142748] RIP: 0010:intel_pmu_check_num_counters+0x68/0x82
[    0.142750] Code: 8b 0e b8 01 00 00 00 48 d3 e0 48 ff c8 48 89 03 41 8b 75 00 83 fe 04 7e 1b ba 04 00 00 00 48 c7 c7 30 40 7a 8e e8 e4 98 00 00 <0f> 0b 41 c7 45 00 04 00 00 00 49 c1 e4 20 4c 09 23 5b 41 5c 41 5d
[    0.142752] RSP: 0000:ffffa1a380073d50 EFLAGS: 00010282
[    0.142753] RAX: 0000000000000000 RBX: ffff90df4023ed78 RCX: ffffffff8f125188
[    0.142754] RDX: c0000000ffffdfff RSI: 0000000000000000 RDI: ffffffff8f075180
[    0.142755] RBP: ffffa1a380073d70 R08: 0000000000000000 R09: ffffa1a380073b48
[    0.142755] R10: ffffa1a380073b40 R11: ffffffff8f1551c8 R12: 000000000000000f
[    0.142756] R13: ffff90df4023ed88 R14: ffff90df4023ed84 R15: ffffffff8f665e18
[    0.142757] FS:  0000000000000000(0000) GS:ffff90e2bf800000(0000) knlGS:0000000000000000
[    0.142758] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.142759] CR2: ffff90e244a01000 CR3: 0000000403e10001 CR4: 0000000000770ef0
[    0.142760] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    0.142760] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400
[    0.142761] PKRU: 55555554
[    0.142762] Call Trace:
[    0.142763]  intel_pmu_check_hybrid_pmus+0x5b/0xc1
[    0.142766]  intel_pmu_init+0x18ca/0x18ef
[    0.142769]  ? map_vsyscall+0x81/0x81
[    0.142770]  init_hw_perf_events+0x46/0x411
[    0.142772]  ? map_vsyscall+0x81/0x81
[    0.142773]  do_one_initcall+0x46/0x1d0
[    0.142777]  ? wake_up_process+0x15/0x20
[    0.142779]  kernel_init_freeable+0x13e/0x1c3
[    0.142783]  ? rest_init+0xba/0xba
[    0.142786]  kernel_init+0xe/0x116
[    0.142789]  ret_from_fork+0x1f/0x30
[    0.142793] ---[ end trace 6e68195f1990c87b ]---
[    0.142795] Intel PMU driver.
Comment 1 You-Sheng Yang 2021-06-15 15:22:30 UTC
Created attachment 297373 [details]
lscpu
Comment 2 You-Sheng Yang 2021-06-28 08:04:45 UTC
Intel proposed a fix[1], which should have been available in korg tip/tip.git perf/core branch[2]. However, with that 3 patches backported to Ubuntu 5.13 kernel[3], this issue is still not fixed.

[1]: https://lore.kernel.org/lkml/162451858710.395.18369691558342592680.tip-bot2@tip-bot2/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=perf/core&id=1d5c7880992a06679585e7e568cc679c0c5fd4f2
[3]: https://launchpad.net/~vicamo/+archive/ubuntu/ppa-1933617 version 5.13.0-2004.4+lp1933617.1.adl.pmu
Comment 3 You-Sheng Yang 2021-06-29 05:37:19 UTC
Created attachment 297651 [details]
dmesg with perf/core branch merged into v5.13-rc7

Tested with Ubuntu oem-5.13 kernel (currently based on v5.13-rc7) with perf/core branch (HEAD commit 012669c740e6 "perf: Fix task context PMU for Hetero") merged. Still reproducible.

Note You need to log in before you can comment on or make changes to this bug.