Received: from eggs.gnu.org ([2001:4830:134:3::10]:53765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn8x0-0003ei-F1 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 14:42:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn8wv-0006AE-Fz for qemu-devel@nongnu.org; Thu, 22 Sep 2016 14:42:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn8wv-00069w-9a for qemu-devel@nongnu.org; Thu, 22 Sep 2016 14:42:21 -0400 Date: Thu, 22 Sep 2016 15:42:17 -0300 From: Eduardo Habkost Message-ID: <20160922184217.GC5885@thinpad.lan.raisama.net> References: <20160921202036.GA5885@thinpad.lan.raisama.net> <9dc16834-6b15-6f22-f169-47d7131ac2c5@mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9dc16834-6b15-6f22-f169-47d7131ac2c5@mvista.com> Subject: Re: [Qemu-devel] Default CPU for NMI injection (QMP and IPMI) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Minyard Cc: qemu-devel@nongnu.org, Alexey Kardashevskiy , Alexander Graf , Bandan Das On Wed, Sep 21, 2016 at 03:38:25PM -0500, Corey Minyard wrote: > On 09/21/2016 03:20 PM, Eduardo Habkost wrote: > > Hi, > > > > I was looking at the monitor code handling the "current CPU", and > > noticed that qmp_inject_nmi() looks suspicious: it is a QMP > > command, but uses monitor_get_cpu_index(). > > > > In addition to the "inject-nmi" QMP command, qmp_inject_nmi() is > > used at: > > * hmp_inject_nmi() > > * ipmi_do_hw_op() (IPMI_SEND_NMI operation) > > > > This confused me, so I would like to know: > > > > 1) What exactly "default CPU" is supposed to mean in the > > "inject-nmi" QMP command documentation? > > 2) To which CPU(s) are NMIs supposed to be sent when triggered by > > IPMI messages? I don't know how to test the IPMI code, but it > > looks like it will crash if QEMU runs without any monitor. > > > It doesn't matter which CPU it goes to. OK, so in the case of IPMI we can make it send the NMI to the first CPU. > I haven't tested without a monitor, so I'm not sure. Does > another interface into the NMI code need to be added? There's another interface, already: nmi_monitor_handle() already gets a cpu_index argument and doesn't depend on the monitor code. We could change the IPMI code to call nmi_monitor_handle(first_cpu->cpu_index) directly. In the case of the inject-nmi QMP command, I need to understand what "default CPU" is supposed to mean in the inject-nmi documentation. Maybe it can be changed to use the first CPU, too (that's probably the existing behavior because there's no way to change cur_mon->mon_cpu in a QMP monitor). -- Eduardo