From: Tim Deegan Subject: Re: [PATCH 2/4] x86/nmi: enable local irqs in wait_for_nmis() Date: Thu, 15 May 2014 13:55:09 +0200 Message-ID: <20140515115509.GH40104@deinos.phlegethon.org> References: <1400072299-2285-1-git-send-email-david.vrabel@citrix.com> <1400072299-2285-3-git-send-email-david.vrabel@citrix.com> <537392700200007800012373@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WkuFm-0000Oz-Bx for xen-devel@lists.xenproject.org; Thu, 15 May 2014 11:55:14 +0000 Content-Disposition: inline In-Reply-To: <537392700200007800012373@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel@lists.xenproject.org, Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org At 14:57 +0100 on 14 May (1400075856), Jan Beulich wrote: > >>> On 14.05.14 at 14:58, wrote: > > --- a/xen/arch/x86/nmi.c > > +++ b/xen/arch/x86/nmi.c > > @@ -111,7 +111,14 @@ int nmi_active; > > > > static void __init wait_for_nmis(void *p) > > { > > + unsigned long flags; > > + > > + local_save_flags(flags); > > + local_irq_enable(); > > + > > mdelay((10*1000)/nmi_hz); /* wait 10 ticks */ > > + > > + local_irq_restore(flags); > > } > > This being the callback for on_selected_cpus(), i.e. called out of > interrupt context, I don't think it is uniformly safe to enable > interrupts here. Yes, I think if you really need this (and I don't see what the problem is with serial interrupts being delayed as long as they're not lost), you'll have to use some sort of softirq context to do this spinning. Tim.