From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH] x86/mce: CPU notifiers must not be registered a second time during resume Date: Fri, 18 Mar 2011 16:35:54 +0000 Message-ID: <4D8397FA0200007800037494@vpn.id2.novell.com> References: <4D8383340200007800037412@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Jinsong Liu , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 18.03.11 at 16:43, Keir Fraser wrote: > On 18/03/2011 15:07, "Jan Beulich" wrote: >=20 >> While c/s 22964:f71212f712fd and 23051:93c864c16ab1 fixed issues with >> CPU onlining, they introduced a problem with resume: mcheck_init() is >> also being called on that path, and hence checking whether it's running >> on CPU 0, which is generally not a really good thing, is particularly >> inappropriate here. >=20 > Just have a 'static bool_t early_init_done' or similar in > intel_mcheck_init(). And another in mcheck_init(). If the proliferates, an alternative I would like a little better would be to just have a global variable (e.g. extending early_boot). > if ( !early_init_done ) { > BUG_ON(smp_processor_id() !=3D 0); > ... > early_init_done =3D 1; > } >=20 > It's clearer anyway -- we're simply protecting one-time-only early-boot-t= ime > initialisation stuff. What's wrong with doing the protection by passing down the necessary information? Jan