aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2011-06-07 21:58:35 -0400
committerBorislav Petkov <borislav.petkov@amd.com>2011-06-16 06:10:12 -0400
commit3a97fc34130326da87b20de5d0259c35406707ce (patch)
tree819dd0a1734bbd88aa25241eb229123f2e1cb1eb
parentb8325c5b110d7ff460b79588e7e9afdcc73d5c3c (diff)
x86, mce: Check the result of ancient_init()
Because "ancient CPUs" like p5 and winchip don't have X86_FEATURE_MCA (I suppose so), mcheck_cpu_init() on such CPUs will return at check of mce_available() after __mcheck_cpu_ancient_init(). It is hard to know this implicit behavior without knowing the CPUs well. So make it clear that we leave mcheck_cpu_init() when the CPU is initialized in __mcheck_cpu_ancient_init(). Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Acked-by: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/4DEED74B.20502@jp.fujitsu.com Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index a18287567865..2cc98d517f36 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1332,18 +1332,23 @@ static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
1332 return 0; 1332 return 0;
1333} 1333}
1334 1334
1335static void __cpuinit __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c) 1335static int __cpuinit __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
1336{ 1336{
1337 if (c->x86 != 5) 1337 if (c->x86 != 5)
1338 return; 1338 return 0;
1339
1339 switch (c->x86_vendor) { 1340 switch (c->x86_vendor) {
1340 case X86_VENDOR_INTEL: 1341 case X86_VENDOR_INTEL:
1341 intel_p5_mcheck_init(c); 1342 intel_p5_mcheck_init(c);
1343 return 1;
1342 break; 1344 break;
1343 case X86_VENDOR_CENTAUR: 1345 case X86_VENDOR_CENTAUR:
1344 winchip_mcheck_init(c); 1346 winchip_mcheck_init(c);
1347 return 1;
1345 break; 1348 break;
1346 } 1349 }
1350
1351 return 0;
1347} 1352}
1348 1353
1349static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c) 1354static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
@@ -1397,7 +1402,8 @@ void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
1397 if (mce_disabled) 1402 if (mce_disabled)
1398 return; 1403 return;
1399 1404
1400 __mcheck_cpu_ancient_init(c); 1405 if (__mcheck_cpu_ancient_init(c))
1406 return;
1401 1407
1402 if (!mce_available(c)) 1408 if (!mce_available(c))
1403 return; 1409 return;