Performance events changes for v6.19
Linus,
Please pull the latest perf/core Git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-core-2025-12-01
# HEAD: 9929dffce5ed7e2988e0274f4db98035508b16d9 perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use
Performance events changes for v6.19:
Callchain support:
- Add support for deferred user-space stack unwinding for perf, enabled on x86. (Peter Zijlstra, Steven Rostedt)
- unwind_user/x86: Enable frame pointer unwinding on x86 (Josh Poimboeuf)
x86 PMU support and infrastructure:
- x86/insn: Simplify for_each_insn_prefix() (Peter Zijlstra)
- x86/insn,uprobes,alternative: Unify insn_is_nop() (Peter Zijlstra)
Intel PMU driver:
- Large series to prepare for and implement architectural PEBS support for Intel platforms such as Clearwater Forest (CWF) and Panther Lake (PTL). (Dapeng Mi, Kan Liang)
- Check dynamic constraints (Kan Liang)
- Optimize PEBS extended config (Peter Zijlstra)
- cstates: Remove PC3 support from LunarLake (Zhang Rui)
- cstates: Add Pantherlake support (Zhang Rui)
- cstates: Clearwater Forest support (Zide Chen)
AMD PMU driver:
- x86/amd: Check event before enable to avoid GPF (George Kennedy)
Fixes and cleanups:
- task_work: Fix NMI race condition (Peter Zijlstra)
- perf/x86: Fix NULL event access and potential PEBS record loss (Dapeng Mi)
- Misc other fixes and cleanups.
(Dapeng Mi, Ingo Molnar, Peter Zijlstra)
Thanks,
Ingo
------------------>
Dapeng Mi (12):
perf/x86: Remove redundant is_x86_event() prototype perf/x86: Fix NULL event access and potential PEBS record loss perf/x86/intel: Replace x86_pmu.drain_pebs calling with static call perf/x86/intel: Correct large PEBS flag check perf/x86/intel: Initialize architectural PEBS perf/x86/intel/ds: Factor out PEBS record processing code to functions perf/x86/intel/ds: Factor out PEBS group processing code to functions perf/x86/intel: Process arch-PEBS records or record fragments perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR perf/x86/intel: Update dyn_constraint base on PEBS event precise level perf/x86/intel: Setup PEBS data configuration and enable legacy groups perf/x86/intel: Add counter group support for arch-PEBS
George Kennedy (1):
perf/x86/amd: Check event before enable to avoid GPF
Ingo Molnar (1):
perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use
Josh Poimboeuf (1):
unwind_user/x86: Enable frame pointer unwinding on x86
Kan Liang (1):
perf/x86/intel: Add a check for dynamic constraints
Peter Zijlstra (19):
x86/insn,uprobes,alternative: Unify insn_is_nop() x86/insn: Simplify for_each_insn_prefix()
task_work: Fix NMI race condition
unwind: Shorten lines
unwind: Add required include files
unwind: Simplify unwind_reset_info()
unwind: Add comment to unwind_deferred_task_exit()
unwind: Fix unwind_deferred_request() vs NMI
unwind: Clarify calling context
unwind: Simplify unwind_user_faultable()
unwind: Make unwind_task_info::unwind_mask consistent
unwind: Simplify unwind_user_next_fp() alignment check
unwind: Implement compat fp unwind unwind_user/x86: Teach FP unwind about start of function
perf: Support deferred user unwind unwind_user/x86: Fix arch=um build entry,unwind/deferred: Fix unwind_reset_info() placement perf/x86/intel: Check PEBS dyn_constraints perf/x86/intel: Optimize PEBS extended config
Zhang Rui (2):
perf/x86/intel/cstate: Remove PC3 support from LunarLake perf/x86/intel/cstate: Add Pantherlake support
Zide Chen (1):
perf/x86/intel/cstate: Add Clearwater Forest support
arch/x86/Kconfig | 1 + arch/x86/boot/compressed/sev-handle-vc.c | 3 +- arch/x86/events/amd/core.c | 7 +- arch/x86/events/core.c | 66 +--- arch/x86/events/intel/core.c | 444 +++++++++++++++++++++-- arch/x86/events/intel/cstate.c | 18 +- arch/x86/events/intel/ds.c | 601 +++++++++++++++++++++++++------ arch/x86/events/perf_event.h | 41 ++- arch/x86/include/asm/insn-eval.h | 2 + arch/x86/include/asm/insn.h | 5 +- arch/x86/include/asm/intel_ds.h | 10 +- arch/x86/include/asm/msr-index.h | 20 + arch/x86/include/asm/perf_event.h | 116 +++++- arch/x86/include/asm/unwind_user.h | 41 +++ arch/x86/include/asm/uprobes.h | 9 + arch/x86/kernel/alternative.c | 20 +- arch/x86/kernel/kprobes/core.c | 3 +- arch/x86/kernel/uprobes.c | 70 ++-- arch/x86/lib/insn-eval.c | 151 +++++++- include/linux/irq-entry-common.h | 2 +- include/linux/perf_event.h | 2 +- include/linux/unwind_deferred.h | 52 ++- include/linux/unwind_deferred_types.h | 18 +- include/linux/unwind_user_types.h | 2 + include/uapi/linux/perf_event.h | 21 +- kernel/bpf/stackmap.c | 4 +- kernel/events/callchain.c | 14 +- kernel/events/core.c | 78 +++- kernel/exit.c | 7 +- kernel/task_work.c | 8 +- kernel/unwind/deferred.c | 44 ++- kernel/unwind/user.c | 59 ++- tools/arch/x86/include/asm/insn.h | 5 +- tools/include/uapi/linux/perf_event.h | 21 +- 34 files changed, 1627 insertions(+), 338 deletions(-) create mode 100644 arch/x86/include/asm/unwind_user.h
The pull request you sent on Mon, 1 Dec 2025 11:45:47 +0100:
The pull request you sent on Mon, 1 Dec 2025 11:45:47 +0100:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-core-2025-12-01
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6c26fbe8c9d3e932dce6afe2505b19b4b261cae9
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html
Quoted 28 lines · Ingo Molnar
Linus,
Please pull the latest perf/core Git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-core-2025-12-01# HEAD:
9929dffce5ed7e2988e0274f4db98035508b16d9perf/x86/intel: Fix and clean upintel_pmu_drain_arch_pebs()type usePerformance events changes for v6.19:
Callchain support:
- Add support for deferred user-space stack unwinding for perf, enabled on x86. (Peter Zijlstra, Steven Rostedt)
- unwind_user/x86: Enable frame pointer unwinding on x86 (Josh Poimboeuf)
x86 PMU support and infrastructure:
- x86/insn: Simplify
for_each_insn_prefix()(Peter Zijlstra)- x86/insn,uprobes,alternative: Unify
insn_is_nop()(Peter Zijlstra)Intel PMU driver:
Quoted 7 lines
- Large series to prepare for and implement architectural PEBS support for Intel platforms such as Clearwater Forest (CWF) and Panther Lake (PTL). (Dapeng Mi, Kan Liang)
- Check dynamic constraints (Kan Liang)
- Optimize PEBS extended config (Peter Zijlstra)
I'm not seeing this patch on the mailing list, so I'm asking here. An AI review flagged this change and the condition it describes sounds unlikely but possible:
Quoted 5 lines
(quoted diff) +0
-1@@ -8171,8 +8169,13 @@ if (!is_hybrid() && boot_cpu_has(X86_FEATURE_ARCH_PERFMON_EXT)) update_pmu_cap(NULL); - if (x86_pmu.arch_pebs)
Review line 8181
Quoted 10 lines
(quoted diff) +6
-0+ if (x86_pmu.arch_pebs) { + static_call_update(intel_pmu_disable_event_ext, + intel_pmu_disable_event_ext); + static_call_update(intel_pmu_enable_event_ext, + intel_pmu_enable_event_ext); pr_cont("Architectural PEBS, "); + } intel_pmu_check_counters_mask(&x86_pmu.cntr_mask64, &x86_pmu.fixed_cntr_mask64,
Does this code expose us to a #GP on hybrid platforms if the CPUID check fails? For hybrid processors, update_pmu_cap() is deferred to init_hybrid_pmu(), which runs after intel_pmu_init() sets up the static calls. If update_pmu_cap() encounters an inconsistent CPUID and clears x86_pmu.arch_pebs, the static calls remain patched. This will cause intel_pmu_enable_event_ext() to execute on precise events and access MSR_IA32_PEBS_INDEX, potentially crashing the kernel.
Thanks,
Ian
Quoted 117 lines
- cstates: Remove PC3 support from LunarLake (Zhang Rui)
- cstates: Add Pantherlake support (Zhang Rui)
- cstates: Clearwater Forest support (Zide Chen)
AMD PMU driver:
- x86/amd: Check event before enable to avoid GPF (George Kennedy)
Fixes and cleanups:
-
task_work: Fix NMI race condition (Peter Zijlstra)- perf/x86: Fix NULL event access and potential PEBS record loss (Dapeng Mi)
- Misc other fixes and cleanups.
(Dapeng Mi, Ingo Molnar, Peter Zijlstra)Thanks,
Ingo
------------------>
Dapeng Mi (12):
perf/x86: Remove redundantis_x86_event()prototype perf/x86: Fix NULL event access and potential PEBS record loss perf/x86/intel: Replace x86_pmu.drain_pebs calling with static call perf/x86/intel: Correct large PEBS flag check perf/x86/intel: Initialize architectural PEBS perf/x86/intel/ds: Factor out PEBS record processing code to functions perf/x86/intel/ds: Factor out PEBS group processing code to functions perf/x86/intel: Process arch-PEBS records or record fragments perf/x86/intel: Allocate arch-PEBS buffer and initializePEBS_BASEMSR perf/x86/intel: Updatedyn_constraintbase on PEBS event precise level perf/x86/intel: Setup PEBS data configuration and enable legacy groups perf/x86/intel: Add counter group support for arch-PEBSGeorge Kennedy (1):
perf/x86/amd: Check event before enable to avoid GPFIngo Molnar (1):
perf/x86/intel: Fix and clean upintel_pmu_drain_arch_pebs()type useJosh Poimboeuf (1):
unwind_user/x86: Enable frame pointer unwinding on x86Kan Liang (1):
perf/x86/intel: Add a check for dynamic constraintsPeter Zijlstra (19):
x86/insn,uprobes,alternative: Unifyinsn_is_nop()x86/insn: Simplifyfor_each_insn_prefix()
task_work: Fix NMI race condition
unwind: Shorten lines
unwind: Add required include files
unwind: Simplifyunwind_reset_info()
unwind: Add comment tounwind_deferred_task_exit()
unwind: Fixunwind_deferred_request()vs NMI
unwind: Clarify calling context
unwind: Simplifyunwind_user_faultable()
unwind: Makeunwind_task_info::unwind_maskconsistent
unwind: Simplifyunwind_user_next_fp()alignment check
unwind: Implement compat fp unwind unwind_user/x86: Teach FP unwind about start of function
perf: Support deferred user unwind unwind_user/x86: Fix arch=um build entry,unwind/deferred: Fixunwind_reset_info()placement perf/x86/intel: Check PEBSdyn_constraintsperf/x86/intel: Optimize PEBS extended configZhang Rui (2):
perf/x86/intel/cstate: Remove PC3 support from LunarLake perf/x86/intel/cstate: Add Pantherlake supportZide Chen (1):
perf/x86/intel/cstate: Add Clearwater Forest supportarch/x86/Kconfig | 1 + arch/x86/boot/compressed/sev-handle-vc.c | 3 +- arch/x86/events/amd/core.c | 7 +- arch/x86/events/core.c | 66 +--- arch/x86/events/intel/core.c | 444 +++++++++++++++++++++-- arch/x86/events/intel/cstate.c | 18 +- arch/x86/events/intel/ds.c | 601 +++++++++++++++++++++++++------ arch/x86/events/perf_event.h | 41 ++- arch/x86/include/asm/insn-eval.h | 2 + arch/x86/include/asm/insn.h | 5 +- arch/x86/include/asm/intel_ds.h | 10 +- arch/x86/include/asm/msr-index.h | 20 + arch/x86/include/asm/perf_event.h | 116 +++++- arch/x86/include/asm/unwind_user.h | 41 +++ arch/x86/include/asm/uprobes.h | 9 + arch/x86/kernel/alternative.c | 20 +- arch/x86/kernel/kprobes/core.c | 3 +- arch/x86/kernel/uprobes.c | 70 ++-- arch/x86/lib/insn-eval.c | 151 +++++++- include/linux/irq-entry-common.h | 2 +- include/linux/perf_event.h | 2 +- include/linux/unwind_deferred.h | 52 ++- include/linux/unwind_deferred_types.h | 18 +- include/linux/unwind_user_types.h | 2 + include/uapi/linux/perf_event.h | 21 +- kernel/bpf/stackmap.c | 4 +- kernel/events/callchain.c | 14 +- kernel/events/core.c | 78 +++- kernel/exit.c | 7 +- kernel/task_work.c | 8 +- kernel/unwind/deferred.c | 44 ++- kernel/unwind/user.c | 59 ++- tools/arch/x86/include/asm/insn.h | 5 +- tools/include/uapi/linux/perf_event.h | 21 +- 34 files changed, 1627 insertions(+), 338 deletions(-) create mode 100644 arch/x86/include/asm/unwind_user.h