Re: [PATCH 3.0] perf,x86: fix kernel crash with PEBS/BTS aftersuspend/resume

From: Ben Hutchings
Date: Wed Mar 20 2013 - 22:42:33 EST

On Fri, 2013-03-15 at 18:57 -0600, Shuah Khan wrote:
> This patch fixes a kernel crash when using precise sampling (PEBS)
> after a suspend/resume. Turns out the CPU notifier code is not invoked
> on CPU0 (BP). Therefore, the DS_AREA (used by PEBS) is not restored properly
> by the kernel and keeps it power-on/resume value of 0 causing any PEBS
> measurement to crash when running on CPU0.
> The workaround is to add a hook in the actual resume code to restore
> the DS Area MSR value. It is invoked for all CPUS. So for all but CPU0,
> the DS_AREA will be restored twice but this is harmless.
> Upstream commit id: 1d9d8639c063caf6efc2447f5f26aa637f844ff6
> Reported-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Shuah Khan <shuah.khan@xxxxxx>
> CC: stable@xxxxxxxxxxxxxxx 3.0

I've queued this up for 3.2 (though context was different again), along
with the following fix-ups:

commit 2a6e06b2aed6995af401dcd4feb5e79a0c7ea554
Author: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Sun Mar 17 15:44:43 2013 -0700

perf,x86: fix wrmsr_on_cpu() warning on suspend/resume

commit 6c4d3bc99b3341067775efd4d9d13cc8e655fd7c
Author: David Rientjes <rientjes@xxxxxxxxxx>
Date: Sun Mar 17 15:49:10 2013 -0700

perf,x86: fix link failure for non-Intel configs


Ben Hutchings
It is easier to write an incorrect program than to understand a correct one.

Attachment: signature.asc
Description: This is a digitally signed message part