From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] kvm tools: Add 'kvm nmi' command Date: Wed, 7 Dec 2011 12:41:50 +0200 Message-ID: <20111207104150.GQ12507@redhat.com> References: <1323204175-17234-1-git-send-email-levinsasha928@gmail.com> <20111207102152.GP12507@redhat.com> <20111207103111.GC21678@moon> <20111207103305.GA25618@redhat.com> <20111207103725.GD21678@moon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , penberg@kernel.org, mingo@elte.hu, asias.hejun@gmail.com, kvm@vger.kernel.org To: Cyrill Gorcunov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18401 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825Ab1LGKl5 (ORCPT ); Wed, 7 Dec 2011 05:41:57 -0500 Content-Disposition: inline In-Reply-To: <20111207103725.GD21678@moon> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Dec 07, 2011 at 02:37:25PM +0400, Cyrill Gorcunov wrote: > On Wed, Dec 07, 2011 at 12:33:05PM +0200, Gleb Natapov wrote: > > On Wed, Dec 07, 2011 at 02:31:11PM +0400, Cyrill Gorcunov wrote: > > > On Wed, Dec 07, 2011 at 12:21:52PM +0200, Gleb Natapov wrote: > > > > On Tue, Dec 06, 2011 at 10:42:55PM +0200, Sasha Levin wrote: > > > > > +static void handle_nmi(int fd, u32 type, u32 len, u8 *msg) > > > > > +{ > > > > > + u32 vcpu = *(u32 *)msg; > > > > > + > > > > > + ioctl(kvm_cpus[vcpu]->vcpu_fd, KVM_NMI); > > > > > > > > You need to check that vcpu apic's LINT1 is configured to receive > > > > NMI (and not masked obviously) before injecting NMI. > > > > > > > > > > I've been configuring mptable to have lint1 as nmi receiver, > > > so it should remain so I suppose (if only we've not masked it > > > somewhere else ;) > > > > > > > That's up to the guest. mptable is just a hint to an OS on how things is > > wired in HW. > > > > Yup, but while we support linux kernels only it should be fine. Still > of course on long term we need a check. > Tomorrow someone will send a patch to change how Linux behaves and slightly older kvmtool will not be able to run newer kernels :) No need to wait for long term, a couple of lines of code will fix the issue in the patch. Look here for reference: http://article.gmane.org/gmane.comp.emulators.kvm.devel/80339 -- Gleb.