]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
i386: Handle P6s without performance counters in nmi watchdog
authorAndi Kleen <ak@suse.de>
Sun, 22 Jul 2007 09:12:39 +0000 (11:12 +0200)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 22 Jul 2007 18:03:38 +0000 (11:03 -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>
arch/i386/kernel/cpu/perfctr-watchdog.c

index 30b5e48aa76b84375fc408ce866305980d2eda22..572900398def0a7bcda281aa572ebe2cb6f05cc2 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