From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 10/11] VMX: work around lacking VNMI support Date: Wed, 24 Sep 2008 16:20:47 +0300 Message-ID: <20080924132047.GI3072@minantech.com> References: <48D74CE6.5060008@siemens.com> <200809231742.03316.sheng.yang@intel.com> <20080923094544.GE3072@minantech.com> <200809231750.49882.sheng.yang@intel.com> <48DA3532.9040306@siemens.com> <20080924125057.GF3072@minantech.com> <48DA3908.2000204@siemens.com> <20080924130236.GG3072@minantech.com> <48DA3C88.1050906@siemens.com> <20080924131700.GH3072@minantech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Yang, Sheng" , kvm-devel , Avi Kivity To: Jan Kiszka Return-path: Received: from il.qumranet.com ([212.179.150.194]:29628 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbYIXNUs (ORCPT ); Wed, 24 Sep 2008 09:20:48 -0400 Content-Disposition: inline In-Reply-To: <20080924131700.GH3072@minantech.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Sep 24, 2008 at 04:17:00PM +0300, Gleb Natapov wrote: > On Wed, Sep 24, 2008 at 03:11:36PM +0200, Jan Kiszka wrote: > > >> OK, I just think we are not supposed to set GUEST_INTR_STATE_NMI without > > >> cpu_has_virtual_nmis(). Otherwise looks reasonable. Have you tested > > >> this? Does it make your 2003 power-off? > > >> > > > It does power-off, but hands during reboot. Looking at it right now. > > > > Yeah, with your patch I'm getting a totally different Blue Screen on > > spurious manual NMI injection: > > > > "Hardware Malfunction > > > > Call your hardware vendor for support" > > > > 8) > > > Cool! > BTW I have this is also needed in case CPU was reseted before it had a chance to handle NMI: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 5927b79..106e16d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2234,6 +2234,8 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) } vmx->vcpu.arch.rmode.active = 0; + vcpu->arch.nmi_pending = false; + vcpu->arch.nmi_injected = false; vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val(); kvm_set_cr8(&vmx->vcpu, 0); -- Gleb.