From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57080 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6jSz-0000kH-Gh for qemu-devel@nongnu.org; Mon, 04 Apr 2011 09:05:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6jSw-0002yj-KB for qemu-devel@nongnu.org; Mon, 04 Apr 2011 09:05:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6jSw-0002y5-8O for qemu-devel@nongnu.org; Mon, 04 Apr 2011 09:05:10 -0400 Date: Mon, 4 Apr 2011 10:04:58 -0300 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH 2/2 V7] qemu,qmp: add inject-nmi qmp command Message-ID: <20110404100458.79467ef2@doriath> In-Reply-To: References: <4D74A8C9.2020408@cn.fujitsu.com> <4D74A974.6090509@cn.fujitsu.com> <20110404105949.GA30324@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Lai Jiangshan , Lai Jiangshan , kvm@vger.kernel.org, qemu-devel@nongnu.org, Avi Kivity On Mon, 04 Apr 2011 14:19:58 +0200 Markus Armbruster wrote: > [Note cc: Anthony] > > "Daniel P. Berrange" writes: > > > On Mon, Mar 07, 2011 at 05:46:28PM +0800, Lai Jiangshan wrote: > >> From: Lai Jiangshan > >> Date: Mon, 7 Mar 2011 17:05:15 +0800 > >> Subject: [PATCH 2/2] qemu,qmp: add inject-nmi qmp command > >> > >> inject-nmi command injects an NMI on all CPUs of guest. > >> It is only supported for x86 guest currently, it will > >> returns "Unsupported" error for non-x86 guest. > >> > >> --- > >> hmp-commands.hx | 2 +- > >> monitor.c | 18 +++++++++++++++++- > >> qmp-commands.hx | 29 +++++++++++++++++++++++++++++ > >> 3 files changed, 47 insertions(+), 2 deletions(-) > > > > Does anyone have any feedback on this addition, or are all new > > QMP patch proposals blocked pending Anthony's QAPI work ? No, we agreed on merging stuff against current QMP. > That would be bad. Anthony, what's holding this back? I remember Anthony asked for errors descriptions. > > > We'd like to support it in libvirt and thus want it to be > > available in QMP, as well as HMP. > > > >> @@ -2566,6 +2566,22 @@ static void do_inject_nmi(Monitor *mon, const QDict *qdict) > >> break; > >> } > >> } > >> + > >> +static int do_inject_nmi(Monitor *mon, const QDict *qdict, QObject **ret_data) > >> +{ > >> + CPUState *env; > >> + > >> + for (env = first_cpu; env != NULL; env = env->next_cpu) > >> + cpu_interrupt(env, CPU_INTERRUPT_NMI); > >> + > >> + return 0; > >> +} > >> +#else > >> +static int do_inject_nmi(Monitor *mon, const QDict *qdict, QObject **ret_data) > >> +{ > >> + qerror_report(QERR_UNSUPPORTED); > >> + return -1; > >> +} > >> #endif > >> > > > > Interesting that with HMP you need to specify a single CPU index, but > > with QMP it is injecting to all CPUs at once. Is there any compelling > > reason why we'd ever need the ability to only inject to a single CPU > > from an app developer POV ? > > Quoting my own executive summary on this issue: > > * Real hardware's NMI button injects all CPUs. This is the primary use > case. > > * Lai said injecting a single CPU can be useful for debugging. Was > deemed acceptable as secondary use case. > > Lai also pointed out that the human monitor's nmi command injects a > single CPU. That was dismissed as irrelevant for QMP. > > * No other use cases have been presented. >