From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933503AbcKGSpi (ORCPT ); Mon, 7 Nov 2016 13:45:38 -0500 Received: from mail.skyhub.de ([78.46.96.112]:53702 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932965AbcKGSpe (ORCPT ); Mon, 7 Nov 2016 13:45:34 -0500 Date: Mon, 7 Nov 2016 19:45:32 +0100 From: Borislav Petkov To: Sebastian Andrzej Siewior , Tony Luck Cc: linux-kernel@vger.kernel.org, rt@linutronix.de, Tony Luck , linux-edac@vger.kernel.org, x86@kernel.org, Thomas Gleixner Subject: Re: [PATCH 22/25] x86/mcheck: Do the init in one place Message-ID: <20161107184532.xj6wzdjlzwhshcmf@pd.tnic> References: <20161103145021.28528-1-bigeasy@linutronix.de> <20161103145021.28528-23-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161103145021.28528-23-bigeasy@linutronix.de> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 03, 2016 at 03:50:18PM +0100, Sebastian Andrzej Siewior wrote: > Part of the init (memory allocation and so on) is done > in mcheck_cpu_init(). While moving the the allocation to > mcheck_init_device() (where the hotplug calls are initialized) it > becomes necessary to move the callback (mcheck_cpu_init()), too. > > The callback is now removed from identify_cpu() and registered as a > hotplug event which is invoked as the very first one which is shortly > after the original point of invocation (look at smp_store_cpu_info() and > notify_cpu_starting() in smp_callin()). > One "visible" difference is that MCE for the boot CPU is not enabled at > identify_boot_cpu() time but at device_initcall_sync() time. Either way, > both times we had no userland around. Uh, hm, I'm not sure about this: so the issue I see with this is that the more we're delaying the enabling or MCE reporting - and especially setting CR4[MCE] - the more we're increasing the window where a MCE during early boot will cause a shutdown. (This is what happens if CR4[MCE]=0b). Perhaps we should split the init into a very early init which doesn't need to be part of hotplug and the rest, which can do mce_disable_cpu() and mce_reenable_cpu(). Tony, how do you see this? > Cc: Tony Luck > Cc: Borislav Petkov > Cc: linux-edac@vger.kernel.org > Cc: x86@kernel.org > Signed-off-by: Sebastian Andrzej Siewior > Signed-off-by: Thomas Gleixner > --- ... > @@ -2584,11 +2580,26 @@ static __init int mcheck_init_device(void) > goto err_out; > } > > + err = __mcheck_cpu_mce_banks_init(); ^^^^^^^^ I guess you can merge this one... > + if (err) > + goto err_out_mem; > + > mce_init_banks(); ^^^^^^^^ into this one now. But let's sort out the bigger issue first. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.