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 19:36:01 +0300 Message-ID: <20090419163601.GE21459@redhat.com> References: <20090419133222.GK10126@redhat.com> <49EB29E3.5030901@redhat.com> <20090419134143.GM10126@redhat.com> <49EB2A70.5020200@redhat.com> <20090419134433.GN10126@redhat.com> <87r5zoenyf.fsf@tabernacle.lan> <20090419141305.GP10126@redhat.com> <49EB3335.6030607@redhat.com> <20090419142915.GR10126@redhat.com> <49EB3BF4.50003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Julian Stecklina , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:47360 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761489AbZDSQgR (ORCPT ); Sun, 19 Apr 2009 12:36:17 -0400 Content-Disposition: inline In-Reply-To: <49EB3BF4.50003@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Apr 19, 2009 at 05:57:56PM +0300, Avi Kivity wrote: > Gleb Natapov wrote: >> On Sun, Apr 19, 2009 at 05:20:37PM +0300, Avi Kivity wrote: >> >>> Gleb Natapov wrote: >>> >>>>> 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. >>>> >>> If it doesn't call IRET, it will never see another NMI. >>> >>> But of course it will execute IRET, as part of normal execution. You >>> can't do anything without it. >>> >>> >> Boot CPU can send INIT after task switch (and I think this is what >> happens). >> > > But eventually it will execute IRET. > Yes :) But I strongly suspect that NMI window will be opened after SIPI even before first IRET. > (We need to fix INIT to clear the NMI blocking flag, not that it matters > so much) If we reset intercept mask on INIT, but don't clear NMI blocking flag we will never receive NMIs on the vcpu. -- Gleb.