From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 13/15] Add NMI injection support to SVM. Date: Sun, 19 Apr 2009 17:13:05 +0300 Message-ID: <20090419141305.GP10126@redhat.com> References: <1239616545-25199-14-git-send-email-gleb@redhat.com> <49E8DEC1.4030802@web.de> <20090419131735.GG10126@redhat.com> <49EB26BA.9020200@web.de> <20090419133222.GK10126@redhat.com> <49EB29E3.5030901@redhat.com> <20090419134143.GM10126@redhat.com> <49EB2A70.5020200@redhat.com> <20090419134433.GN10126@redhat.com> <87r5zoenyf.fsf@tabernacle.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Julian Stecklina Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59702 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751862AbZDSONd (ORCPT ); Sun, 19 Apr 2009 10:13:33 -0400 Content-Disposition: inline In-Reply-To: <87r5zoenyf.fsf@tabernacle.lan> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Apr 19, 2009 at 04:07:52PM +0200, Julian Stecklina wrote: > Gleb Natapov writes: > > > On Sun, Apr 19, 2009 at 04:43:12PM +0300, Avi Kivity wrote: > >> Gleb Natapov wrote: > >>> On Sun, Apr 19, 2009 at 04:40:51PM +0300, Avi Kivity wrote: > >>> > >>>> Gleb Natapov wrote: > >>>> > >>>>>> It's OK as a first step towards correct NMI emulation. Additionally, you > >>>>>> could enable the IRQ window interception in case the is an NMI pending. > >>>>>> The resulting behavior should then much like the VNMI mask emulation for > >>>>>> vmx. > >>>>>> > >>>>>> > >>>>> Yeah, but the question is if IRQ windows is already opened will exit > >>>>> happens before or after IRET. > >>>>> > >>>> You mean if the NMI handler enabled interrupts? > >>>> > >>>> > >>> Yes. > >>> > >>> > >> > >> Then the guest deserves whatever it gets... > >> > > I suspect windows may do this since it uses NMI for task switching. > > Could you elaborate on that? How/why does it use NMIs for task > switching? > During WHQL testing (or if you just enable verifier on windows 2003) windows changes hibernate to not power down a PC, but resume immediately. During this immediate resume it sends NMI to non-boot CPUs while IDT for nmi is configured as a task gate. I am not sure it actually calls IRET after that. -- Gleb.