mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
Fix PEBS-via-PT crash.
Signed-off-by: Ingo Molnar <mingo@kernel.org> -----BEGIN PGP SIGNATURE----- iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmgojiQRHG1pbmdvQGtl cm5lbC5vcmcACgkQEnMQ0APhK1iEbQ//QHdlVe7okE2RZylcIeg8SwqSJWp3cSoB GNKJ9qkU8zPzwT1efHdvPp8y6r53o8IT0muCarju5He+CdTfktGnZqrVdUU6visV axoPREHaY3MDOKxzt/2I5M7L+/rMKOYga4mF8j/B3po1/D3ELxPVavIAsb/Ort31 4W2dUbAY3My23dKxQyEgpJTQ/PUn0+9DJvs/edKUEquK3UQBcrhbVhF840cU44Li 89AVdYzgcrE+TwlsDfVdH/2cmPoCB+COEAep7coVZaxEWcoI6VPJonr77kOQZ1Vk KWxmiXRsHJGueOJcAdhuxQ03AbVjOcCsP5fIGjpw1xXDIh/+Vezaz+H4fh7XJILZ J3Sg1XYxgnrgm6BPturABlDRP7ckBtI45vwCjAUUtADHWPdsP+lG55lfqSlze7lR boERhzPHZOlbsQQnzjPxvJVk36m3PISubJaZziw9CyyTsl8X5c8/aEolP9skpgd1 6iLojiJek7xtwqdQgvMK6WyllvCEed8mcxn4zsXDivmO/8nbTGb8FfaiSeZ9B4Aw 9owFgDOUh4hy68KcFbonX4Cifrym9zTqanweV7yMJRZYWpnVZQr2WrAfTTPz+qLE y3ItiQNg15ZDp3ekDtq+RHMHhkjR5CICVKgF4kXM99kahqhGJuOvjeJGiZLPEkSO QVIFekPClls= =tcS/ -----END PGP SIGNATURE----- Merge tag 'perf-urgent-2025-05-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 perf event fix from Ingo Molnar: "Fix PEBS-via-PT crash" * tag 'perf-urgent-2025-05-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel: Fix segfault with PEBS-via-PT with sample_freq
This commit is contained in:
commit
4bcaa59009
|
|
@ -2465,8 +2465,9 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs, struct perf_sample_
|
|||
setup_pebs_fixed_sample_data);
|
||||
}
|
||||
|
||||
static void intel_pmu_pebs_event_update_no_drain(struct cpu_hw_events *cpuc, int size)
|
||||
static void intel_pmu_pebs_event_update_no_drain(struct cpu_hw_events *cpuc, u64 mask)
|
||||
{
|
||||
u64 pebs_enabled = cpuc->pebs_enabled & mask;
|
||||
struct perf_event *event;
|
||||
int bit;
|
||||
|
||||
|
|
@ -2477,7 +2478,7 @@ static void intel_pmu_pebs_event_update_no_drain(struct cpu_hw_events *cpuc, int
|
|||
* It needs to call intel_pmu_save_and_restart_reload() to
|
||||
* update the event->count for this case.
|
||||
*/
|
||||
for_each_set_bit(bit, (unsigned long *)&cpuc->pebs_enabled, size) {
|
||||
for_each_set_bit(bit, (unsigned long *)&pebs_enabled, X86_PMC_IDX_MAX) {
|
||||
event = cpuc->events[bit];
|
||||
if (event->hw.flags & PERF_X86_EVENT_AUTO_RELOAD)
|
||||
intel_pmu_save_and_restart_reload(event, 0);
|
||||
|
|
@ -2512,7 +2513,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d
|
|||
}
|
||||
|
||||
if (unlikely(base >= top)) {
|
||||
intel_pmu_pebs_event_update_no_drain(cpuc, size);
|
||||
intel_pmu_pebs_event_update_no_drain(cpuc, mask);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2626,7 +2627,7 @@ static void intel_pmu_drain_pebs_icl(struct pt_regs *iregs, struct perf_sample_d
|
|||
(hybrid(cpuc->pmu, fixed_cntr_mask64) << INTEL_PMC_IDX_FIXED);
|
||||
|
||||
if (unlikely(base >= top)) {
|
||||
intel_pmu_pebs_event_update_no_drain(cpuc, X86_PMC_IDX_MAX);
|
||||
intel_pmu_pebs_event_update_no_drain(cpuc, mask);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user