Skip to content

Commit

Permalink
perf/x86: Fix microcode revision check for SNB-PEBS
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/20120824133434.GA8014@quad
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Stephane Eranian authored and Ingo Molnar committed Aug 27, 2012
1 parent 9acb172 commit e3e45c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kernel/microcode_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit e3e45c0

Please sign in to comment.