]> git.baikalelectronics.ru Git - kernel.git/commit
perf,x86: fix wrmsr_on_cpu() warning on suspend/resume
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Mar 2013 22:44:43 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Mar 2013 22:44:43 +0000 (15:44 -0700)
commit2cffa37353d883aaef121fab0dfca7de0aebfda7
treee8bfb4d2895a8857ab28a833b11c39bc961a1d65
parent126f9982740fdd2f65d801b018a1f86e9078a52a
perf,x86: fix wrmsr_on_cpu() warning on suspend/resume

Commit 596747e930f2 ("perf,x86: fix kernel crash with PEBS/BTS after
suspend/resume") fixed a crash when doing PEBS performance profiling
after resuming, but in using init_debug_store_on_cpu() to restore the
DS_AREA mtrr it also resulted in a new WARN_ON() triggering.

init_debug_store_on_cpu() uses "wrmsr_on_cpu()", which in turn uses CPU
cross-calls to do the MSR update.  Which is not really valid at the
early resume stage, and the warning is quite reasonable.  Now, it all
happens to _work_, for the simple reason that smp_call_function_single()
ends up just doing the call directly on the CPU when the CPU number
matches, but we really should just do the wrmsr() directly instead.

This duplicates the wrmsr() logic, but hopefully we can just remove the
wrmsr_on_cpu() version eventually.

Reported-and-tested-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/kernel/cpu/perf_event_intel_ds.c