Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934504Ab0GOTIM (ORCPT ); Thu, 15 Jul 2010 15:08:12 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:36263 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934488Ab0GOTIJ (ORCPT ); Thu, 15 Jul 2010 15:08:09 -0400 MIME-Version: 1.0 In-Reply-To: <20100715183153.GA9276@Krystal> References: <20100714155804.049012415@efficios.com> <20100714170617.GB4955@Krystal> <20100714203940.GC22096@Krystal> <20100714222115.GA30122@Krystal> <20100715183153.GA9276@Krystal> Date: Thu, 15 Jul 2010 11:43:10 -0700 Message-ID: Subject: Re: [patch 1/2] x86_64 page fault NMI-safe From: Linus Torvalds To: Mathieu Desnoyers Cc: 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 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: 1498 Lines: 33 On Thu, Jul 15, 2010 at 11:31 AM, Mathieu Desnoyers wrote: > > Hrm, we could probably get away with only keeping the nmi_stack_nested per-cpu > variable. The nmi_stack_ptr could be known statically if we set it at a fixed > offset from the bottom of stack rather than using an offset relative to the top > (which can change depending if we are nested over the kernel or userspace). > We just have to reserve enough space for the bottom of stack. I thought about trying that, but I don't think it's true. At least not for the 32-bit case. The thing is, the 32-bit case will re-use the kernel stack if it happens in kernel space, and will thus start from a random space (and won't push all the information anyway). So a nested NMI really doesn't know where the original NMI stack is to be found unless we save it off. In the case of x86-64, I think the stack will always be at a fixed address, and push a fixed amount of data (because we use the IST thing). So there you could probably just use the flag, but you'd still have to handle the 32-bit case, and quite frankly, I think it would be much nicer if the logic could be shared for the 32-bit and 64-bit cases. But maybe I'm missing something. 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/