Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753305AbbKQNPn (ORCPT ); Tue, 17 Nov 2015 08:15:43 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:39254 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbbKQNPl (ORCPT ); Tue, 17 Nov 2015 08:15:41 -0500 Date: Tue, 17 Nov 2015 14:15:38 +0100 From: Peter Zijlstra To: Vineet Gupta Cc: arcml , Alexey Brodkin , lkml Subject: Re: NMI for ARC Message-ID: <20151117131538.GZ3816@twins.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564B2341.4030409@synopsys.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1821 Lines: 40 On Tue, Nov 17, 2015 at 06:23:21PM +0530, Vineet Gupta wrote: > On Tuesday 17 November 2015 05:55 PM, Peter Zijlstra wrote: > > > This is assuming you now have these NMIs we talked about earlier. If all > > you have are regular IRQs this is not possible, for we should be calling > > ->read() with IRQs disabled. > > > > No we don't yet. The first stab at it fell flat on floor. > > The NMI support from hardware is that is it provides different priorities, higher > one obviously able to interrupt lower one. However instructions like CLRI (disable > interrupts) will still lock out all interrupts. > > Thus local_irq_save()/restore() and local_irq_enable()/disable() now need to be > contextual. > > - When running in prio 0 mode, they only need to enable 0 > - In prio 1, they need to enable both 0 and 1 > > For irq_save()/restore() this is achievable by doing an additional STATUS32 read > at the time of save and passing that value to restore - so there's an additional > overhead - but ignoring that for now. > > Bummer is irq_disable()/enable() case: there's need to pass old prio state from > enable to disabled, so we need some sort of global state tracking - which in case > of SMP needs to be per cpu.... either keep something hot in a reg or pay the cost > of additional mem/cache line miss. > > I've not investigated how other arches do that. PPC seems to be using some sort of > soft irq state anyways. 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(). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/