Skip to content

Commit 69ebf9a

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Thomas Gleixner: "Three fixes for the fallout from the TSX errata workaround: - Prevent memory corruption caused by a unchecked out of bound array index. - Two trivial fixes to address compiler warnings" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel: Make dev_attr_allow_tsx_force_abort static perf/x86: Fixup typo in stub functions perf/x86/intel: Fix memory corruption
2 parents c5b5138 + c634dc6 commit 69ebf9a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/x86/events/intel/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,7 +3410,7 @@ tfa_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
34103410
/*
34113411
* Without TFA we must not use PMC3.
34123412
*/
3413-
if (!allow_tsx_force_abort && test_bit(3, c->idxmsk)) {
3413+
if (!allow_tsx_force_abort && test_bit(3, c->idxmsk) && idx >= 0) {
34143414
c = dyn_constraint(cpuc, c, idx);
34153415
c->idxmsk64 &= ~(1ULL << 3);
34163416
c->weight--;
@@ -4179,7 +4179,7 @@ static struct attribute *intel_pmu_caps_attrs[] = {
41794179
NULL
41804180
};
41814181

4182-
DEVICE_BOOL_ATTR(allow_tsx_force_abort, 0644, allow_tsx_force_abort);
4182+
static DEVICE_BOOL_ATTR(allow_tsx_force_abort, 0644, allow_tsx_force_abort);
41834183

41844184
static struct attribute *intel_pmu_attrs[] = {
41854185
&dev_attr_freeze_on_smi.attr,

arch/x86/events/perf_event.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,12 @@ static inline int intel_pmu_init(void)
10331033
return 0;
10341034
}
10351035

1036-
static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
1036+
static inline int intel_cpuc_prepare(struct cpu_hw_events *cpuc, int cpu)
10371037
{
10381038
return 0;
10391039
}
10401040

1041-
static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
1041+
static inline void intel_cpuc_finish(struct cpu_hw_events *cpuc)
10421042
{
10431043
}
10441044

0 commit comments

Comments
 (0)