From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751201AbcI1HQx (ORCPT ); Wed, 28 Sep 2016 03:16:53 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42798 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbcI1HQq (ORCPT ); Wed, 28 Sep 2016 03:16:46 -0400 Date: Wed, 28 Sep 2016 09:16:42 +0200 From: Peter Zijlstra To: Vineet Gupta Cc: arcml , Alexey Brodkin , lkml , Andy Lutomirski Subject: Re: NMI for ARC Message-ID: <20160928071642.GU2794@worktop> References: <1445286926.3913.13.camel@synopsys.com> <20151117110749.GT3816@twins.programming.kicks-ass.net> <564B0E18.3040207@synopsys.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b23d64c-2579-b72e-645a-e7ece3c1a3c6@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 Tue, Sep 27, 2016 at 05:22:13PM -0700, Vineet Gupta wrote: > > Yeah, Sparc64 might be a better example, it more closely matches your > > hardware. See > > arch/sparc/include/asm/irqflags_64.h:arch_local_irq_save(). > > So I finally got around to doing this and as expected has turned out to be quite > some fun. I have a couple of questions and would really appreciate your inputs there. > > 1. Is it OK in general to short-circuit preemption off irq checks for NMI style > interrupts. Yes. If the NMI returns to kernel space you must not attempt preemption for reasons you found :-), if the NMI returns to userspace you should do the normal return to user bits, I think. > 2. The low level return code, resume_user_mode_begin and/or resume_kernel_mode > require interrupt safety, does that need to be NMI safe as well. We ofcourse want > the very late register restore parts to be non-interruptible, but is this required > before we call prrempt_schedule_irq() off of asm code. Urgh, I'm never quite sure on the details here, I've Cc'ed Andy who might actually know this off the top of his head. I'll try and dig through x86 to see what it does.