From mboxrd@z Thu Jan 1 00:00:00 1970 From: Balaji Rao Subject: Re: [RFC] nmi watchdog in kvm Date: Wed, 30 Jan 2008 19:52:57 +0530 Message-ID: <200801301952.57604.balajirrao@gmail.com> References: <200801281348.41010.balajirrao@gmail.com> <47A054EE.6010408@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <47A054EE.6010408-atKUWr5tajBWk0Htik3J/w@public.gmane.org> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Wednesday 30 January 2008 04:13:58 pm Avi Kivity wrote: > > @@ -790,6 +795,18 @@ static int apic_mmio_range(struct kvm_io_device > > *this, gpa_t addr) return ret; > > } > > > > +static int nmi_notify(struct notifier_block *self,unsigned long val, > > void *data) { + > > + struct kvm *kvm; > > + kvm =3D list_entry(vm_list.next, struct kvm, vm_list); > > + kvm_x86_ops->inject_nmi(kvm->vcpus[0]); > > + return NOTIFY_STOP; > > +} > > You're not guaranteed to be in vcpu context here, that's what's causing > the vmwrite errors. > I intended to do this here. Looks like its not the right way to check for = presence in vcpu context. How do i do it ? please explain. +static void vmx_inject_nmi(struct kvm_vcpu *vcpu) { + +=A0=A0=A0=A0=A0=A0=A0struct vcpu_vmx * vmx =3D to_vmx(vcpu); +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if (vmx->launched) +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0vmcs_write32(VM_ENTRY_INTR_IN= FO_FIELD, +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A02 | I= NTR_TYPE_NMI | INTR_INFO_VALID_MASK); +} regards, balaji rao ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/