Skip to content

Commit

Permalink
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Mar 17, 2019
2 parents c5b5138 + c634dc6 commit 69ebf9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/x86/events/intel/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,7 @@ tfa_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
/*
* Without TFA we must not use PMC3.
*/
if (!allow_tsx_force_abort && test_bit(3, c->idxmsk)) {
if (!allow_tsx_force_abort && test_bit(3, c->idxmsk) && idx >= 0) {
c = dyn_constraint(cpuc, c, idx);
c->idxmsk64 &= ~(1ULL << 3);
c->weight--;
Expand Down Expand Up @@ -4179,7 +4179,7 @@ static struct attribute *intel_pmu_caps_attrs[] = {
NULL
};

DEVICE_BOOL_ATTR(allow_tsx_force_abort, 0644, allow_tsx_force_abort);
static DEVICE_BOOL_ATTR(allow_tsx_force_abort, 0644, allow_tsx_force_abort);

static struct attribute *intel_pmu_attrs[] = {
&dev_attr_freeze_on_smi.attr,
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/events/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -1033,12 +1033,12 @@ static inline int intel_pmu_init(void)
return 0;
}

static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
static inline int intel_cpuc_prepare(struct cpu_hw_events *cpuc, int cpu)
{
return 0;
}

static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
static inline void intel_cpuc_finish(struct cpu_hw_events *cpuc)
{
}

Expand Down

0 comments on commit 69ebf9a

Please sign in to comment.