aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/nmi.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-10-17 14:15:37 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-10-17 14:15:37 +0100
commit8203a294d45014a2a21247ce2c58943cacb196e8 (patch)
treea541702fb216999e428a16dac76b87071d44b4da /xen/arch/x86/nmi.c
parent958646ea2e4ab4c1f3a78efd16bb961aabfe87b1 (diff)
downloadxen-8203a294d45014a2a21247ce2c58943cacb196e8.tar.gz
xen-8203a294d45014a2a21247ce2c58943cacb196e8.tar.bz2
xen-8203a294d45014a2a21247ce2c58943cacb196e8.zip
NMI watchdog: use new counter on Core/Core2 CPUs
The old CPU_CLK_UNHALTED performance counter no longer runs on Core or Core2 CPUs. Use the new CPU_CLK_UNHALTED.CORE_P one. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'xen/arch/x86/nmi.c')
-rw-r--r--xen/arch/x86/nmi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 8f20735805..47e53b2a2a 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -72,8 +72,8 @@ int nmi_active;
#define P6_EVNTSEL_INT (1 << 20)
#define P6_EVNTSEL_OS (1 << 17)
#define P6_EVNTSEL_USR (1 << 16)
-#define P6_EVENT_CPU_CLOCKS_NOT_HALTED 0x79
-#define P6_NMI_EVENT P6_EVENT_CPU_CLOCKS_NOT_HALTED
+#define P6_EVENT_CPU_CLOCKS_NOT_HALTED 0x79
+#define CORE_EVENT_CPU_CLOCKS_NOT_HALTED 0x3c
#define P4_ESCR_EVENT_SELECT(N) ((N)<<25)
#define P4_CCCR_OVF_PMI0 (1<<26)
@@ -248,7 +248,7 @@ static void __pminit setup_k7_watchdog(void)
wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
}
-static void __pminit setup_p6_watchdog(void)
+static void __pminit setup_p6_watchdog(unsigned counter)
{
unsigned int evntsel;
@@ -260,7 +260,7 @@ static void __pminit setup_p6_watchdog(void)
evntsel = P6_EVNTSEL_INT
| P6_EVNTSEL_OS
| P6_EVNTSEL_USR
- | P6_NMI_EVENT;
+ | counter;
wrmsr(MSR_P6_EVNTSEL0, evntsel, 0);
write_watchdog_counter("P6_PERFCTR0");
@@ -326,7 +326,9 @@ void __pminit setup_apic_nmi_watchdog(void)
case X86_VENDOR_INTEL:
switch (boot_cpu_data.x86) {
case 6:
- setup_p6_watchdog();
+ setup_p6_watchdog((boot_cpu_data.x86_model < 14)
+ ? P6_EVENT_CPU_CLOCKS_NOT_HALTED
+ : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
break;
case 15:
if (!setup_p4_watchdog())