From: Mats Petersson Subject: Re: NMI Race Date: Thu, 02 Aug 2007 15:23:49 +0100 Message-ID: <46b1e90a.0116300a.322f.ffffc4f5@mx.google.com> References: <011501c7d50f$c6af6e40$ad11800a@eeyore> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Return-path: In-Reply-To: <011501c7d50f$c6af6e40$ad11800a@eeyore> References: <011501c7d50f$c6af6e40$ad11800a@eeyore> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Peter Teoh , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org At 15:16 02/08/2007, Peter Teoh wrote: >I saw the following in xen\arch\x86\domain.c: > > /* > * Map Xen segments into every VCPU's GDT, irrespective of whether every > * VCPU will actually be used. This avoids an NMI race during context > * switch: if we take an interrupt after switching CR3 but > before switching > * GDT, and the old VCPU# is invalid in the new domain, we > would otherwise > * try to load CS from an invalid table. > */ >Can someone please elaborate on this "NMI race"? Ie, Between which >functions called, for example? Not sure if there is a "function call" as such - it's more a case of "if someone changes CR3, followed by an NMI", then if not all GDT are in visible on all VCPU's, the NMI will fail because it's trying to read the GDT, and the GDT is unavailable in the memory map pointed to by CR3. So the race is between setting CR3 and setting GDT and NMI's. -- Mats > >(X-Ref: >http://osdir.com/ml/emulators.xen.cvs/2005-10/msg00300.html >for more details). > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel