ia64/xen-unstable

changeset 18652:4129f0f2f2ba

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>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Oct 17 14:15:37 2008 +0100 (2008-10-17)
parents 3411819435b9
children cbc254c59dd0
files xen/arch/x86/nmi.c
line diff
     1.1 --- a/xen/arch/x86/nmi.c	Fri Oct 17 12:12:50 2008 +0100
     1.2 +++ b/xen/arch/x86/nmi.c	Fri Oct 17 14:15:37 2008 +0100
     1.3 @@ -72,8 +72,8 @@ int nmi_active;
     1.4  #define P6_EVNTSEL_INT		(1 << 20)
     1.5  #define P6_EVNTSEL_OS		(1 << 17)
     1.6  #define P6_EVNTSEL_USR		(1 << 16)
     1.7 -#define P6_EVENT_CPU_CLOCKS_NOT_HALTED	0x79
     1.8 -#define P6_NMI_EVENT		P6_EVENT_CPU_CLOCKS_NOT_HALTED
     1.9 +#define P6_EVENT_CPU_CLOCKS_NOT_HALTED	 0x79
    1.10 +#define CORE_EVENT_CPU_CLOCKS_NOT_HALTED 0x3c
    1.11  
    1.12  #define P4_ESCR_EVENT_SELECT(N)	((N)<<25)
    1.13  #define P4_CCCR_OVF_PMI0	(1<<26)
    1.14 @@ -248,7 +248,7 @@ static void __pminit setup_k7_watchdog(v
    1.15      wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
    1.16  }
    1.17  
    1.18 -static void __pminit setup_p6_watchdog(void)
    1.19 +static void __pminit setup_p6_watchdog(unsigned counter)
    1.20  {
    1.21      unsigned int evntsel;
    1.22  
    1.23 @@ -260,7 +260,7 @@ static void __pminit setup_p6_watchdog(v
    1.24      evntsel = P6_EVNTSEL_INT
    1.25          | P6_EVNTSEL_OS
    1.26          | P6_EVNTSEL_USR
    1.27 -        | P6_NMI_EVENT;
    1.28 +        | counter;
    1.29  
    1.30      wrmsr(MSR_P6_EVNTSEL0, evntsel, 0);
    1.31      write_watchdog_counter("P6_PERFCTR0");
    1.32 @@ -326,7 +326,9 @@ void __pminit setup_apic_nmi_watchdog(vo
    1.33      case X86_VENDOR_INTEL:
    1.34          switch (boot_cpu_data.x86) {
    1.35          case 6:
    1.36 -            setup_p6_watchdog();
    1.37 +            setup_p6_watchdog((boot_cpu_data.x86_model < 14) 
    1.38 +                              ? P6_EVENT_CPU_CLOCKS_NOT_HALTED
    1.39 +                              : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
    1.40              break;
    1.41          case 15:
    1.42              if (!setup_p4_watchdog())