lkml.org 
[lkml]   [2008]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86: re-enable MCE on secondary CPUS after suspend/resume
On Mon, Dec 15, 2008 at 11:33:10PM +0100, Andi Kleen wrote:
> > void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
> > {
> > static cpumask_t mce_cpus = CPU_MASK_NONE;
> >
> > mce_cpu_quirks(c);
> >
> > if (mce_dont_init ||
> > cpu_test_and_set(smp_processor_id(), mce_cpus) ||
> > !mce_available(c))
> > => return;
> >
> > mce_init(NULL);
> > mce_cpu_features(c);
> > }
> >
> > But we need to call mce_init to clear all MCE state.
> > IMHO the best location to call mce_init for APs is the cpu notifier.
>
> Ah got it. Thanks that makes sense.
>
> But I think the better fix is to just drop the mce_cpus check and
> then handly it naturally in the standard bootup path. I'm not
> sure what it was good for anyways. I copied it into the 64bit code
> from 32bit, but I suppose even there it isn't really needed and on
> 32bit it is already gone even.
>
> How about this patch. Does it fix the problem for you too?

Yup, works as well:

Tested-by: Andreas Herrmann <andreas.herrmann3@amd.com>


Thanks,

Andreas

> -Andi
>
> --
>
>
> Don't prevent multiple initialization of MCEs.
>
> Back from early prehistory mcheck_init() has a reentry check. Presumably
> that was needed in very old kernels to prevent it entering twice.
>
> But as Andreas points out this prevents CPU hotplug (and therefore resume)
> to correctly reinitialize MCEs when a AP boots again after being
> offlined.
>
> Just drop the check.
>
> Based on a report from Andreas Herrmann
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> ---
> arch/x86/kernel/cpu/mcheck/mce_64.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> Index: linux/arch/x86/kernel/cpu/mcheck/mce_64.c
> ===================================================================
> --- linux.orig/arch/x86/kernel/cpu/mcheck/mce_64.c 2008-12-15 23:13:02.000000000 +0100
> +++ linux/arch/x86/kernel/cpu/mcheck/mce_64.c 2008-12-15 23:13:44.000000000 +0100
> @@ -510,12 +510,9 @@
> */
> void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
> {
> - static cpumask_t mce_cpus = CPU_MASK_NONE;
> -
> mce_cpu_quirks(c);
>
> if (mce_dont_init ||
> - cpu_test_and_set(smp_processor_id(), mce_cpus) ||
> !mce_available(c))
> return;
>
>




\
 
 \ /
  Last update: 2008-12-15 23:45    [W:1.517 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site