From: Andi Kleen <andi@firstfloor.org>
To: speck@linutronix.de
Cc: Andi Kleen <ak@linux.intel.com>
Subject: [MODERATED] [PATCH v3 0/6] PERFv3
Date: Thu, 7 Feb 2019 15:41:02 -0800 [thread overview]
Message-ID: <cover.1549582769.git.ak@linux.intel.com> (raw)
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 <elena.reshetova@intel.com>
-Andi
v1: Initial post
v2: Minor updates in code (see individual patches)
Removed optimization to not change MSR for update. This caused missing
MSR updates in some cases.
Redid KVM code to always intercept MSR and pass correct flag
to host perf.
v3: Use Peter's scheduling patch, with some changes and cleanups.
Dropped some obsolete patches.
KVM now always forces the guest state and doesn't rely on the host state.
Andi Kleen (6):
x86/pmu/intel: Export number of counters in caps
x86/pmu/intel: Handle TSX with counter 3 on Skylake
x86/pmu/intel: Add perf event attribute to control RTM
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 | 24 ++++++++
arch/x86/events/intel/core.c | 94 +++++++++++++++++++++++++++++-
arch/x86/events/perf_event.h | 13 ++++-
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/msr-index.h | 5 ++
arch/x86/kvm/cpuid.c | 3 +-
arch/x86/kvm/pmu.c | 19 +++---
arch/x86/kvm/pmu.h | 6 +-
arch/x86/kvm/pmu_amd.c | 2 +-
arch/x86/kvm/vmx/pmu_intel.c | 20 ++++++-
tools/perf/builtin-stat.c | 38 ++++++++----
tools/perf/util/pmu.c | 10 ++++
tools/perf/util/pmu.h | 1 +
14 files changed, 211 insertions(+), 26 deletions(-)
--
2.17.2
next reply other threads:[~2019-02-07 23:43 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 23:41 Andi Kleen [this message]
2019-02-07 23:41 ` [MODERATED] [PATCH v3 1/6] PERFv3 Andi Kleen
2019-02-08 8:45 ` [MODERATED] " Peter Zijlstra
2019-02-07 23:41 ` [MODERATED] [PATCH v3 2/6] PERFv3 Andi Kleen
2019-02-08 0:51 ` [MODERATED] Re: [SUSPECTED SPAM][PATCH " Andrew Cooper
2019-02-08 9:01 ` Peter Zijlstra
2019-02-08 9:31 ` [MODERATED] Re: [PATCH " Andrew Cooper
2019-02-08 9:39 ` [MODERATED] Re: [SUSPECTED SPAM][PATCH " Peter Zijlstra
2019-02-08 10:53 ` [MODERATED] [RFC][PATCH] performance walnuts Peter Zijlstra
2019-02-08 18:07 ` [MODERATED] " Andi Kleen
2019-02-11 10:40 ` Peter Zijlstra
2019-02-11 14:06 ` Thomas Gleixner
2019-02-11 20:17 ` [MODERATED] " Konrad Rzeszutek Wilk
2019-02-11 23:39 ` Thomas Gleixner
2019-02-09 0:28 ` [MODERATED] " Linus Torvalds
2019-02-09 4:34 ` Andi Kleen
2019-02-09 8:57 ` Peter Zijlstra
2019-02-13 2:56 ` mark gross
2019-02-15 17:32 ` mark gross
2019-02-15 17:44 ` Peter Zijlstra
2019-02-15 20:47 ` mark gross
2019-02-15 21:33 ` Thomas Gleixner
2019-02-19 13:35 ` [MODERATED] [RFC][PATCH v2] " Peter Zijlstra
2019-02-15 23:45 ` [MODERATED] Encrypted Message Jon Masters
2019-02-08 8:50 ` [MODERATED] Re: [PATCH v3 2/6] PERFv3 Peter Zijlstra
2019-02-08 17:26 ` Andi Kleen
2019-02-07 23:41 ` [MODERATED] [PATCH v3 3/6] PERFv3 Andi Kleen
2019-02-08 9:02 ` [MODERATED] " Peter Zijlstra
2019-02-07 23:41 ` [MODERATED] [PATCH v3 4/6] PERFv3 Andi Kleen
2019-02-07 23:41 ` [MODERATED] [PATCH v3 5/6] PERFv3 Andi Kleen
2019-02-08 0:54 ` [MODERATED] " Andrew Cooper
2019-02-07 23:41 ` [MODERATED] [PATCH v3 6/6] PERFv3 Andi Kleen
2019-02-08 9:07 ` [MODERATED] " Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1549582769.git.ak@linux.intel.com \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=speck@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.