From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754731AbcI2Gnz (ORCPT ); Thu, 29 Sep 2016 02:43:55 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46450 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752029AbcI2Gnq (ORCPT ); Thu, 29 Sep 2016 02:43:46 -0400 Date: Thu, 29 Sep 2016 08:43:41 +0200 From: Peter Zijlstra To: Vineet Gupta Cc: Andy Lutomirski , Alexey Brodkin , arcml , Vineet Gupta , lkml Subject: Re: NMI for ARC Message-ID: <20160929064341.GH3318@worktop.controleur.wifipass.org> References: <20151117122401.GY3816@twins.programming.kicks-ass.net> <20151117122540.GL11639@twins.programming.kicks-ass.net> <564B2341.4030409@synopsys.com> <20151117131538.GZ3816@twins.programming.kicks-ass.net> <3b23d64c-2579-b72e-645a-e7ece3c1a3c6@synopsys.com> <20160928071642.GU2794@worktop> <20160928203748.GU5012@twins.programming.kicks-ass.net> <75783d4b-98bf-5d60-a844-20d4eec88ac9@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75783d4b-98bf-5d60-a844-20d4eec88ac9@synopsys.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 28, 2016 at 06:20:29PM -0700, Vineet Gupta wrote: > On 09/28/2016 03:26 PM, Andy Lutomirski wrote: > >> Right, so what I think Vineet is asking is if we need to disable NMIs as > >> > well, we cannot on x86 disable NMIs so no. > >> > > > The same argument works here, too: an NMI won't set TIF_NEED_RESCHED > > without sending an IPI, so we can't miss a wakeup. > > But what exact wakeup miss are we taking about here. If intr were NOT disabled, > how could this happen. Just trying to understand the need for "irqs-disabled" in > resume_{user,kernel}_* > > The intr disabled before reg file restore makes complete sense though. user irq nmi | | `-----> . | | | `-----> . | | . <-----' . <-----' | | So what Andy is saying is that NMI context never sets TIF_NEED_RESCHED, this means that return from NMI never needs to check for preemption etc.. Now your return from IRQ obviously should, the normal way. If the IRQ return gets interrupted by the NMI nothing special should occur. The return from NMI should simply resume the return from IRQ. So I'm a little confused by your timer interrupt example, it _should_ do the preemption, the nested interrupt (NMI) will return to the regular interrupt which should resume its normal return preemption or not.