All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/x86: fix microcode revision check for SNB-PEBS
@ 2012-08-24 13:34 Stephane Eranian
  2012-08-24 16:08 ` Borislav Petkov
  2012-08-27 17:18 ` [tip:perf/urgent] perf/x86: Fix " tip-bot for Stephane Eranian
  0 siblings, 2 replies; 5+ messages in thread
From: Stephane Eranian @ 2012-08-24 13:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, andi, borislav.petkov


The following patch, relative to 3.6.0-rc3, 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>
---

--- 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(&microcode_mutex);
 	put_online_cpus();
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-27 17:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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:perf/urgent] perf/x86: Fix " tip-bot for Stephane Eranian

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.