ia64/xen-unstable

changeset 18959:c54d6f871de8

x86, intel: Clear Error counter field when set new cmci owner

Since cmci might happened when cpu is taking down (cpu hotplug) before
setting new cmci owner while old owner is down. We need to clear the
corrected error counter field to make sure CMCI could be triggered on
the new owner.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Liping Ke <liping.ke@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Dec 29 13:30:14 2008 +0000 (2008-12-29)
parents e2f36d066b7b
children 0af9fbf3f053
files xen/arch/x86/cpu/mcheck/mce_intel.c xen/arch/x86/cpu/mcheck/x86_mca.h
line diff
     1.1 --- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Dec 22 13:48:40 2008 +0000
     1.2 +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Mon Dec 29 13:30:14 2008 +0000
     1.3 @@ -358,6 +358,12 @@ static int do_cmci_discover(int i)
     1.4          return 0;
     1.5      }
     1.6      set_bit(i, __get_cpu_var(mce_banks_owned));
     1.7 +    /* Clear Corected Error Counter field, make sure CMCI could 
     1.8 +     * be triggered on the new owner
     1.9 +     */
    1.10 +    msr = MSR_IA32_MC0_STATUS + 4 * i;
    1.11 +    rdmsrl(msr, val);
    1.12 +    wrmsrl(msr, val & ~MCi_STATUS_ERRCOUNT);
    1.13  out:
    1.14      clear_bit(i, __get_cpu_var(no_cmci_banks));
    1.15      return 1;
     2.1 --- a/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Dec 22 13:48:40 2008 +0000
     2.2 +++ b/xen/arch/x86/cpu/mcheck/x86_mca.h	Mon Dec 29 13:30:14 2008 +0000
     2.3 @@ -46,6 +46,8 @@
     2.4  #define MCi_STATUS_MSEC         0x00000000ffff0000ULL
     2.5  /* Other information */
     2.6  #define MCi_STATUS_OTHER        0x01ffffff00000000ULL
     2.7 +/*Corrected Error Count*/
     2.8 +#define MCi_STATUS_ERRCOUNT     0x001FFFC0000000000ULL 
     2.9  /* processor context corrupt */
    2.10  #define MCi_STATUS_PCC          0x0200000000000000ULL
    2.11  /* MSR_K8_MCi_ADDR register valid */