Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759407Ab0GPWeq (ORCPT ); Fri, 16 Jul 2010 18:34:46 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:51522 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755252Ab0GPWep (ORCPT ); Fri, 16 Jul 2010 18:34:45 -0400 MIME-Version: 1.0 In-Reply-To: <20100716220730.GH7338@basil.fritz.box> References: <4C408D0C.5050709@redhat.com> <20100716165855.GA3836@Krystal> <4C409CBA.1050709@redhat.com> <4C409F62.6030303@zytor.com> <4C40A1BD.4040507@redhat.com> <4C40A227.6000207@zytor.com> <4C40A4E8.5090605@redhat.com> <4C40B277.9030408@redhat.com> <20100716220730.GH7338@basil.fritz.box> Date: Fri, 16 Jul 2010 15:26:32 -0700 Message-ID: Subject: Re: [patch 2/2] x86 NMI-safe INT3 and Page Fault From: Linus Torvalds To: Andi Kleen Cc: Avi Kivity , "H. Peter Anvin" , 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 , Jeremy Fitzhardinge , "Frank Ch. Eigler" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1397 Lines: 31 On Fri, Jul 16, 2010 at 3:07 PM, Andi Kleen wrote: > > One issue I have with nesting NMIs is that you need > a nesting limit, otherwise you'll overflow the NMI stack. Have you actually looked at the suggestion I (and now Mathieu) suggested code for? The nesting is very limited. NMI's would nest just once, and when that happens, the nested NMI would never use more than something like a hundred bytes of stack (most of which is what the CPU pushes directly). And there would be no device interrupts that nest, and practically the faults that nest obviously aren't going to be complex faults either (ie the page fault would be the simple case that never calls to 'handle_vm_fault()', but handles it all in arch/x86/mm/fault.c. IOW, there is absolutely _no_ issues with nesting. It's two levels deep, and a much smaller stack footprint than our regular exception nesting for those two levels too. And your argument that there would be more and more NMI usage only makes it more important that we handle NMI's without going crazy. Just handle them cleanly instead of making them something totally special. Linus -- 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/