Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758671Ab2EVOhx (ORCPT ); Tue, 22 May 2012 10:37:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3114 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061Ab2EVOhv (ORCPT ); Tue, 22 May 2012 10:37:51 -0400 Message-ID: <4FBBA4A2.2070501@redhat.com> Date: Tue, 22 May 2012 17:37:22 +0300 From: Avi Kivity User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Steven Rostedt CC: linux-kernel , Ingo Molnar , Linus Torvalds , "H. Peter Anvin" , Thomas Gleixner , Paul Turner , Peter Zijlstra , Frederic Weisbecker , Mathieu Desnoyers Subject: Re: NMI vs #PF clash References: <4FBB8C40.6080304@redhat.com> <1337693441.13348.36.camel@gandalf.stny.rr.com> <4FBB986F.5030306@redhat.com> <1337695780.13348.41.camel@gandalf.stny.rr.com> <4FBBA094.3090703@redhat.com> <1337696825.13348.44.camel@gandalf.stny.rr.com> In-Reply-To: <1337696825.13348.44.camel@gandalf.stny.rr.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1184 Lines: 48 On 05/22/2012 05:27 PM, Steven Rostedt wrote: > On Tue, 2012-05-22 at 17:20 +0300, Avi Kivity wrote: >> On 05/22/2012 05:09 PM, Steven Rostedt wrote: >> >> > >> >> > Or we could just have the NMI always restore the cr2 register. >> >> >> >> IMO that's best. >> > >> > OK, I can whip up a patch, but I wont push that in till 3.6. >> > >> >> Thanks. Something I've noticed is that writing cr2 is slow, so you may >> want to write it only if it has changed (which should be very rare). >> > > Is reading it fast? Then we could do a two reads and only write when > needed. The upside is 70 cycles on one machine, see d3edefc0035669. > > Something like this pseudo assembly > > mov cr2, rax > push rax > > call do_nmi > > pop rax > mov cr2, rbx > cmp rax, rbx > be skip > mov rax, cr2 > skip: > Yes, provided no exceptions can happen at those points. -- error compiling committee.c: too many arguments to function -- 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/