Skip to content

PERFv1 0

Andi Kleen historical-speck 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9PERFv1 7arch/x86/events/core.c+20 -00 replies
2/9PERFv1 6arch/x86/events/core.c arch/x86/events/intel/core.c arch/x86/events/intel/knc.c +3 more+9 -92 replies
3/9PERFv1 9arch/x86/events/core.c arch/x86/events/intel/uncore.c arch/x86/events/perf_event.h +1 more+21 -91 reply
4/9PERFv1 2arch/x86/events/intel/core.c arch/x86/events/perf_event.h arch/x86/include/asm/cpufeatures.h +1 more+52 -15 replies
5/9PERFv1 8arch/x86/events/intel/core.c arch/x86/events/perf_event.h+23 -00 replies
6/9PERFv1 5arch/x86/events/core.c arch/x86/events/intel/core.c arch/x86/events/perf_event.h+22 -22 replies
7/9PERFv1 1tools/perf/builtin-stat.c+5 -30 replies
8/9PERFv1 4tools/perf/builtin-stat.c tools/perf/util/pmu.c tools/perf/util/pmu.h+33 -80 replies
9/9PERFv1 3arch/x86/events/intel/core.c arch/x86/include/asm/perf_event.h arch/x86/kvm/cpuid.c +3 more+53 -55 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [MODERATED] [PATCH v1 0/9] PERFv1 0

Walnut is an functional (not security) issue with TSX. The upcoming microcode updates on Skylake may corrupt perfmon counter 3 when RTM transactions are used.

There is a new MSR that allows to force abort RTM, and free counter 3.

The following patchkit adds the support to perf to avoid using counter 3, or disabling TSX when counter 3 is needed for perf.

There are per perf event and global options to set the default.

This patch sets the default to TSX enabled, but
that could be easily changed.

We can have a discussion on the trade offs of the default setting. I suspect it's a decision that should be made by Linus, as it may impact user programs either way.

The trade offs for setting the option default are:

Using 4 (or 8 with HT off) events in perf versus
allowing RTM usage while perf is active.

- Existing programs that use perf groups with 4 counters may not retrieve perfmon data anymore. Perf usages that use less than four (or 7 with HT off) counters are not impacted. Perf usages that don't use group will still work, but will see increase multiplexing.

- TSX programs should not functionally break from forcing RTM to abort because they always need a valid fall back path. However they will see significantly lower performance if they rely on TSX for performance (all RTM transactions will run and only abort at the end), potentially slowing them down so much that it is equivalent to functional breakage.

Patches are against tip/perf/core as of
commit ca3bb3d027f69ac3ab1dafb32bde2f5a3a44439c (tip/perf/core)
Author: Elena Reshetova <[email protected]>

-Andi

v1: Initial post

Andi Kleen (9):
x86/pmu/intel: Export number of counters in caps x86/pmu/intel: Add flags argument to x86_pmu::disable x86/pmu/intel: Support excluding GP counters in scheduler x86/pmu/intel: Handle TSX with counter 3 on Skylake x86/pmu/intel: Add perf event attribute to enable counter 3 x86/pmu/intel: Add global option for enable all counters perf stat: Make all existing groups weak
perf stat: Don't count EL for --transaction with three counters
kvm: vmx: Support TSX_FORCE_ABORT in KVM guests

 arch/x86/events/core.c             | 52 ++++++++++++++++---
 arch/x86/events/intel/core.c       | 82 ++++++++++++++++++++++++++++--
 arch/x86/events/intel/knc.c        |  2 +-
 arch/x86/events/intel/p4.c         |  4 +-
 arch/x86/events/intel/p6.c         |  2 +-
 arch/x86/events/intel/uncore.c     |  2 +-
 arch/x86/events/perf_event.h       | 19 +++++--
 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/include/asm/msr-index.h   |  3 ++
 arch/x86/include/asm/perf_event.h  |  2 +-
 arch/x86/kvm/cpuid.c               |  3 +-
 arch/x86/kvm/vmx/nested.c          | 11 +++-
 arch/x86/kvm/vmx/vmx.c             | 37 +++++++++++++-
 arch/x86/kvm/vmx/vmx.h             |  1 +
 include/linux/perf_event.h         |  1 +
 tools/perf/builtin-stat.c          | 38 ++++++++++----
 tools/perf/util/pmu.c              | 10 ++++
 tools/perf/util/pmu.h              |  1 +
 18 files changed, 236 insertions(+), 35 deletions(-)
Signature · 1 line
2.17.2