mce: Clean-up mcheck_init handler
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 9 Jun 2010 06:42:19 +0000 (07:42 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 9 Jun 2010 06:42:19 +0000 (07:42 +0100)
commit741367e77d6c895e51c9cd5fc0ca202ed0416c1b
tree808a40a3a1452778392029b626b8b604f606f645
parent41570d67e79bb3f5be5a8ec96bbc3f7b26e435c4
mce: Clean-up mcheck_init handler

Firstly and most importantly, the maxium MCA banks are hard-coded as
MAX_NR_BANKS, which is 30. This is not architecture correct. This
patch removes this definition, replacig the cpu_banks_t with
mca_banks, and provide some basic function, like
set/clear/test/alloc/free for mcabanks_t.

Secondly, remove the broadcast_check code to intel specific, since
only Intel platform support broadcast now.

Thirdly, the X86_FEATURE_MCA check and CR4_MCE enable is done in every
vendor-specifc callback, that's redundant, move it to
mcheck_init. Also, we should enable CR4_MCE only in the end of the
mcheck_init, to close the small window between CR4_enable and the mca
setup.

And we also move vmce specific code to vmce.c as vmce_init, to make
code clean.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Acked-By: Christoph Egger <Christoph.Egger@amd.com>
xen/arch/x86/cpu/mcheck/amd_k8.c
xen/arch/x86/cpu/mcheck/k7.c
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/cpu/mcheck/mce.h
xen/arch/x86/cpu/mcheck/mce_intel.c
xen/arch/x86/cpu/mcheck/non-fatal.c
xen/arch/x86/cpu/mcheck/vmce.c
xen/arch/x86/cpu/mcheck/x86_mca.h
xen/include/asm-x86/mce.h