From: tip-bot for Stephane Eranian <eranian@google.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, eranian@google.com, hpa@zytor.com,
mingo@kernel.org, tglx@linutronix.de, borislav.petkov@amd.com
Subject: [tip:perf/urgent] perf/x86: Fix microcode revision check for SNB-PEBS
Date: Mon, 27 Aug 2012 10:18:21 -0700 [thread overview]
Message-ID: <tip-e3e45c01ae690e65f2650e5288b9af802e95a136@git.kernel.org> (raw)
In-Reply-To: <20120824133434.GA8014@quad>
Commit-ID: e3e45c01ae690e65f2650e5288b9af802e95a136
Gitweb: http://git.kernel.org/tip/e3e45c01ae690e65f2650e5288b9af802e95a136
Author: Stephane Eranian <eranian@google.com>
AuthorDate: Fri, 24 Aug 2012 15:34:34 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 27 Aug 2012 08:48:19 +0200
perf/x86: Fix microcode revision check for SNB-PEBS
The following patch makes the microcode update code path
actually invoke the perf_check_microcode() function and
thus potentially renabling SNB PEBS.
By default, CONFIG_MICROCODE_OLD_INTERFACE is
forced to Y in arch/x86/Kconfig. There is no
way to disable this. That means that the code
path used in arch/x86/kernel/microcode_core.c
did not include the call to perf_check_microcode().
Thus, even though the microcode was updated to a
version that fixes the SNB PEBS problem, perf_event
would still return EOPNOTSUPP when enabling precise
sampling.
This patch simply adds a call to perf_check_microcode()
in the call path used when OLD_INTERFACE=y.
Signed-off-by: Stephane Eranian <eranian@google.com>
Acked-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: peterz@infradead.org
Cc: andi@firstfloor.org
Link: http://lkml.kernel.org/r/20120824133434.GA8014@quad
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/microcode_core.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 4873e62..9e5bcf1 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -225,6 +225,9 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,
if (do_microcode_update(buf, len) == 0)
ret = (ssize_t)len;
+ if (ret > 0)
+ perf_check_microcode();
+
mutex_unlock(µcode_mutex);
put_online_cpus();
prev parent reply other threads:[~2012-08-27 17:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-24 13:34 [PATCH] perf/x86: fix microcode revision check for SNB-PEBS Stephane Eranian
2012-08-24 16:08 ` Borislav Petkov
2012-08-24 16:14 ` Stephane Eranian
2012-08-24 16:26 ` Borislav Petkov
2012-08-27 17:18 ` tip-bot for Stephane Eranian [this message]
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=tip-e3e45c01ae690e65f2650e5288b9af802e95a136@git.kernel.org \
--to=eranian@google.com \
--cc=borislav.petkov@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@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.