Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757218Ab0GNVpL (ORCPT ); Wed, 14 Jul 2010 17:45:11 -0400 Received: from eddie.linux-mips.org ([78.24.191.182]:34657 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752187Ab0GNVpJ (ORCPT ); Wed, 14 Jul 2010 17:45:09 -0400 Date: Wed, 14 Jul 2010 22:45:07 +0100 (BST) From: "Maciej W. Rozycki" To: Linus Torvalds cc: Mathieu Desnoyers , LKML , Andrew Morton , Ingo Molnar , Peter Zijlstra , Steven Rostedt , Steven Rostedt , Frederic Weisbecker , Thomas Gleixner , Christoph Hellwig , Li Zefan , Lai Jiangshan , Johannes Berg , Masami Hiramatsu , Arnaldo Carvalho de Melo , Tom Zanussi , KOSAKI Motohiro , Andi Kleen , "H. Peter Anvin" , Jeremy Fitzhardinge , "Frank Ch. Eigler" , Tejun Heo Subject: Re: [patch 1/2] x86_64 page fault NMI-safe In-Reply-To: Message-ID: References: <20100714154923.947138065@efficios.com> <20100714155804.049012415@efficios.com> <20100714170617.GB4955@Krystal> <20100714203940.GC22096@Krystal> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1233 Lines: 41 On Wed, 14 Jul 2010, Linus Torvalds wrote: > No. As mentioned, there is no such counter in real hardware either. There is a 1-bit counter or actually a latch. > Look at what happens for the not-nested case: > > - NMI1 triggers. The CPU takes a fault, and runs the NMI handler with > NMI's disabled Correct. > - NMI2 triggers. Nothing happens, the NMI's are disabled. The NMI latch records the second NMI. Note this is edge-sensitive like the NMI line itself. > - NMI3 triggers. Again, nothing happens, the NMI's are still disabled Correct. > - the NMI handler returns. > > - What happens now? NMI2 latched above causes the NMI handler to be invoked as the next instruction after IRET. The latch is cleared as the interrupt is taken. > How many NMI interrupts do you get? ONE. Exactly like my "emulate it > in software" approach. The hardware doesn't have any counters for > pending NMI's either. Why should the software emulation have them? Two. :) Maciej -- 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/