]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i386: Handle P6s without performance counters in nmi watchdog
authorAndi Kleen <ak@suse.de>
Wed, 15 Aug 2007 10:38:58 +0000 (12:38 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Aug 2007 23:23:27 +0000 (16:23 -0700)
I got an oops while booting a 32bit kernel on KVM because it doesn't
implement performance counters used by the NMI watchdog. Handle this
case.

Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/i386/kernel/cpu/perfctr-watchdog.c

index 4d26d514c56f97aa37d8977b280565682fd4a2aa..996f6f89ce8e8c7d9ca43c3a72a09df4f8893359 100644 (file)
@@ -346,7 +346,9 @@ static int setup_p6_watchdog(unsigned nmi_hz)
        perfctr_msr = MSR_P6_PERFCTR0;
        evntsel_msr = MSR_P6_EVNTSEL0;
 
-       wrmsrl(perfctr_msr, 0UL);
+       /* KVM doesn't implement this MSR */
+       if (wrmsr_safe(perfctr_msr, 0, 0) < 0)
+               return 0;
 
        evntsel = P6_EVNTSEL_INT
                | P6_EVNTSEL_OS