All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: "Alex Bligh" <alex@alex.org.uk>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Alexander Graf" <agraf@suse.de>,
	"Luiz Capitulino" <lcapitulino@redhat.com>,
	qemu-ppc@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 1/4] cpus: Define NMI callback
Date: Wed, 11 Jun 2014 11:18:22 +0200	[thread overview]
Message-ID: <20140611111822.3968d010.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <20140611103814.059eac57.cornelia.huck@de.ibm.com>

On Wed, 11 Jun 2014 10:38:14 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:

> On Wed, 11 Jun 2014 16:50:35 +1000
> Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> 
> > On 06/11/2014 12:41 AM, Cornelia Huck wrote:
> > > On Tue, 10 Jun 2014 09:39:51 -0400
> > > Luiz Capitulino <lcapitulino@redhat.com> wrote:
> > > 
> > >> On Wed,  4 Jun 2014 18:08:47 +1000
> > >> Alexey Kardashevskiy <aik@ozlabs.ru> 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 <aik@ozlabs.ru>
> > >>> ---
> > >>> 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.

  reply	other threads:[~2014-06-11  9:18 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04  8:08 [Qemu-devel] [PATCH v3 0/4] cpus: Add generic NMI support Alexey Kardashevskiy
2014-06-04  8:08 ` [Qemu-devel] [PATCH v3 1/4] cpus: Define NMI callback Alexey Kardashevskiy
2014-06-10 13:39   ` Luiz Capitulino
2014-06-10 14:41     ` Cornelia Huck
2014-06-10 14:48       ` Luiz Capitulino
2014-06-10 16:29         ` Paolo Bonzini
2014-06-10 18:09           ` Alexander Graf
2014-06-11  0:12             ` Alexey Kardashevskiy
2014-06-11  0:21               ` Alexander Graf
2014-06-11  0:23             ` Peter Maydell
2014-06-11  0:28               ` Alexander Graf
2014-06-11  4:59                 ` Paolo Bonzini
2014-06-11  8:01                   ` Alexander Graf
2014-06-11  8:27                     ` Paolo Bonzini
2014-06-11  8:29                       ` Alexander Graf
2014-06-11  8:37                         ` Paolo Bonzini
2014-06-11  8:42                           ` Alexander Graf
2014-06-11 10:47                             ` Paolo Bonzini
2014-06-11 10:59                               ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2014-06-11 12:04                               ` [Qemu-devel] " Alexander Graf
2014-06-11  9:04                 ` Alexey Kardashevskiy
2014-06-11  9:19                   ` Alexander Graf
2014-06-11 13:10           ` Luiz Capitulino
2014-06-11 13:36             ` Cornelia Huck
2014-06-11 13:42               ` Luiz Capitulino
2014-06-11  6:50       ` Alexey Kardashevskiy
2014-06-11  7:57         ` Paolo Bonzini
2014-06-11  8:38         ` Cornelia Huck
2014-06-11  9:18           ` Cornelia Huck [this message]
2014-06-10 15:13     ` Eric Blake
2014-06-10 15:40     ` Alexey Kardashevskiy
2014-06-11 12:50       ` Luiz Capitulino
2014-06-04  8:08 ` [Qemu-devel] [PATCH v3 2/4] target-s390x: Migrate to new nmi() CPU callback Alexey Kardashevskiy
2014-06-04  8:08 ` [Qemu-devel] [PATCH v3 3/4] target-i386: " Alexey Kardashevskiy
2014-06-04  8:08 ` [Qemu-devel] [PATCH v3 4/4] target-ppc: Add support for " Alexey Kardashevskiy
2014-06-04  9:11 ` [Qemu-devel] [PATCH v3 0/4] cpus: Add generic NMI support Paolo Bonzini
2014-06-04  9:16 ` Peter Maydell
2014-06-04  9:30   ` Alexey Kardashevskiy
2014-06-04  9:33     ` Peter Maydell
2014-06-04  9:38       ` Alexander Graf
2014-06-04  9:39       ` Alexey Kardashevskiy
2014-06-04  9:39       ` Paolo Bonzini
2014-06-04  9:47         ` Peter Maydell
2014-06-04  9:50           ` Alexander Graf
2014-06-04 10:44             ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-06-04 10:51               ` Cornelia Huck
2014-06-04 11:34             ` [Qemu-devel] " Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140611111822.3968d010.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alex@alex.org.uk \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.