From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wueg3-0006qg-Nc for qemu-devel@nongnu.org; Wed, 11 Jun 2014 05:18:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wuefv-0004pu-Fg for qemu-devel@nongnu.org; Wed, 11 Jun 2014 05:18:39 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:60859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wuefv-0004pX-6x for qemu-devel@nongnu.org; Wed, 11 Jun 2014 05:18:31 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Jun 2014 10:18:29 +0100 Date: Wed, 11 Jun 2014 11:18:22 +0200 From: Cornelia Huck Message-ID: <20140611111822.3968d010.cornelia.huck@de.ibm.com> In-Reply-To: <20140611103814.059eac57.cornelia.huck@de.ibm.com> References: <1401869330-32449-1-git-send-email-aik@ozlabs.ru> <1401869330-32449-2-git-send-email-aik@ozlabs.ru> <20140610093951.6dd64ea4@redhat.com> <20140610164107.249d8290.cornelia.huck@de.ibm.com> <5397FC3B.8010203@ozlabs.ru> <20140611103814.059eac57.cornelia.huck@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/4] cpus: Define NMI callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alex Bligh , Alexey Kardashevskiy , Markus Armbruster , Alexander Graf , Luiz Capitulino , qemu-ppc@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , Andreas =?UTF-8?B?RsOkcmJlcg==?= , Richard Henderson On Wed, 11 Jun 2014 10:38:14 +0200 Cornelia Huck wrote: > On Wed, 11 Jun 2014 16:50:35 +1000 > Alexey Kardashevskiy wrote: > > > On 06/11/2014 12:41 AM, Cornelia Huck wrote: > > > On Tue, 10 Jun 2014 09:39:51 -0400 > > > Luiz Capitulino wrote: > > > > > >> On Wed, 4 Jun 2014 18:08:47 +1000 > > >> Alexey Kardashevskiy wrote: > > >> > > >>> This introduces an NMI (non maskable interrupt) callback per CPU class > > >>> which QMP's "nmi" command may use to issue NMI on a CPU. > > >>> > > >>> This adds support for it in qmp_inject_nmi(). Since no architecture > > >>> supports it at the moment, there is no change in behaviour. > > >>> > > >>> This changes inject-nmi command description for HMP and QMP. > > >>> > > >>> Signed-off-by: Alexey Kardashevskiy > > >>> --- > > >>> Changes: > > >>> v3: > > >>> * actual nmi() enablement moved from last patch to first patch > > >>> * changed description for QMP command too > > >>> --- > > >>> cpus.c | 11 ++++++++++- > > >>> hmp-commands.hx | 6 ++---- > > >>> include/qom/cpu.h | 1 + > > >>> qapi-schema.json | 4 +--- > > >>> qmp-commands.hx | 3 +-- > > >>> 5 files changed, 15 insertions(+), 10 deletions(-) > > >>> > > > >>> diff --git a/qapi-schema.json b/qapi-schema.json > > >>> index 7bc33ea..dcf6642 100644 > > >>> --- a/qapi-schema.json > > >>> +++ b/qapi-schema.json > > >>> @@ -1748,13 +1748,11 @@ > > >>> ## > > >>> # @inject-nmi: > > >>> # > > >>> -# Injects an Non-Maskable Interrupt into all guest's VCPUs. > > >>> +# Injects an Non-Maskable Interrupt into the given guest's VCPU. > > >> > > >> QMP doesn't have the concept of "current monitored CPU" you talk in the > > >> intro email. In QMP you have to specify the CPU. You have to choices: > > >> > > >> - Add a new command that takes a CPU parameter (seems the best to me, as > > >> people were asking for a different command anyways) > > >> > > >> - Add an optional parameter to inject-nmi. When the CPU parameter is > > >> not specified, the command sends the NMI to all CPUs > > > > > > The s390 restart interrupt is a per-vcpu interrupt, which we really > > > don't want to inject on _all_ vcpus. OTOH, we want to inject that > > > interrupt on any vcpu - we don't care which one it is. So I'd really > > > like an "inject nmi on default cpu" option. > > > > > > Interesting thing. I was pushing "nmi" for ppc which did nmi only on the > > current cpu but according to our architect Ben, I should inject NMI on all > > CPUs because although XMON (inkernel debugger) tries to stop other CPUs, it > > may fail to do that because of some interrupt deadlock. And - this is > > important for us - this is what pHyp (native IBM hypervisor) does. > > > > Now I wonder how you are getting away with injecting NMI on one CPU only > > and what will happen if we inject NMI on all? > > The Linux restart handler does stop the other cpus before doing any > other work - see restart_int_handler in arch/s390/kernel/entry64.S and > do_restart in arch/s390/kernel/ipl.c for the gory details ;) > > Other operating systems need to have something similar in place, as the > restart interrupt is always directed to a single cpu (for example, z/VM > has SYSTEM RESTART, which is always directed either to the default cpu > or to a specified cpu). FWIW (just checked): On the HMC (i.e., when working with LPARs), the restart is always directed to "the first available cpu", with no way to select a specific cpu. So I guess a machine callback that just grabs any cpu to inject the restart interrupt on would be fine for s390.