All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Alex Bligh <alex@alex.org.uk>,
	Markus Armbruster <armbru@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	qemu-ppc@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v6 1/4] cpus: Define callback for QEMU "nmi" command
Date: Wed, 11 Jun 2014 11:21:13 -0600	[thread overview]
Message-ID: <53989009.1000300@redhat.com> (raw)
In-Reply-To: <1402506183-29736-2-git-send-email-aik@ozlabs.ru>

[-- Attachment #1: Type: text/plain, Size: 3347 bytes --]

On 06/11/2014 11:03 AM, Alexey Kardashevskiy wrote:
> This introduces an NMI (Non Maskable Interrupt) interface with
> a single nmi_monitor_handler() method. A machine or a device can
> implement it. This searches for an QOM object which supports the interface
> and if it is implemented , calls it. The callback implements an action
> required to cause debug crash dump on in-kernel debugger invocation.
> The callback returns Error**.
> 
> 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>
> ---

> +++ b/hw/core/nmi.c
> @@ -0,0 +1,81 @@
> +/*
> + *  NMI monitor handler class and helpers.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License,
> + *  or (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, see <http://www.gnu.org/licenses/>.
> + */

For the GPL license to work, there has to be a Copyright line.

> +static int do_nmi(Object *o, void *opaque)
> +{
> +    struct do_nmi_s *ns = opaque;
> +    NMI *n = (NMI *) object_dynamic_cast(o, TYPE_NMI);

Is the cast to (NMI *) necessary, or does object_dynamic_cast() already
return something that can be assigned to an arbitrary pointer type?


> +++ b/include/hw/nmi.h
> @@ -0,0 +1,46 @@
> +/*
> + *  NMI monitor handler class and helpers definitions.

Same comment about Copyright.


> +#define TYPE_NMI "nmi"
> +
> +#define NMI_CLASS(klass) \
> +     OBJECT_CLASS_CHECK(NMIClass, (klass), TYPE_NMI)
> +#define NMI_GET_CLASS(obj) \
> +    OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI)
> +#define NMI(obj) \
> +     INTERFACE_CHECK(NMI, (obj), TYPE_NMI)
> +
> +typedef struct NMI {
> +    Object parent_obj;
> +} NMI;

Eww.  This is declaring both 'NMI' as a type, and 'NMI()' as a macro.
Is that going to trip people up?  Is 'NMIState' a better name?


> +++ b/qapi-schema.json
> @@ -1116,13 +1116,13 @@
>  ##
>  # @inject-nmi:
>  #
> -# Injects an Non-Maskable Interrupt into all guest's VCPUs.
> +# Injects an Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).

s/an Non/a Non/

> +++ b/qmp-commands.hx
> @@ -477,7 +477,7 @@ SQMP
>  inject-nmi
>  ----------
>  
> -Inject an NMI on guest's CPUs.
> +Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).

Oh, I see the problem.  The acronym 'NMI' is pronounced with a leading
vowel (an "en-em-eye"), but the expansion is pronounced with a consonant
(a non-maskable interrupt), so the correct article depends on whether
you are spelling things out.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-06-11 17:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 17:02 [Qemu-devel] [PATCH v6 0/4] cpus: Add generic "nmi" monitor command support Alexey Kardashevskiy
2014-06-11 17:03 ` [Qemu-devel] [PATCH v6 1/4] cpus: Define callback for QEMU "nmi" command Alexey Kardashevskiy
2014-06-11 17:21   ` Eric Blake [this message]
2014-06-12  0:10     ` Alexey Kardashevskiy
2014-06-12  1:46       ` Eric Blake
2014-06-12  3:29         ` Alexey Kardashevskiy
2014-06-12 13:42           ` Eric Blake
2014-06-11 17:03 ` [Qemu-devel] [PATCH v6 2/4] target-s390x: Migrate to new NMI interface Alexey Kardashevskiy
2014-06-11 17:29   ` Paolo Bonzini
2014-06-12  0:08     ` Alexey Kardashevskiy
2014-06-12  7:42       ` Paolo Bonzini
2014-06-12  8:35         ` Alexey Kardashevskiy
2014-06-12  8:41           ` Paolo Bonzini
2014-06-12  6:31   ` Cornelia Huck
2014-06-12  9:38     ` Alexey Kardashevskiy
2014-06-12  9:39       ` Alexander Graf
2014-06-12  9:55         ` Alexey Kardashevskiy
2014-06-12 11:02       ` Cornelia Huck
2014-06-12 12:33         ` Alexey Kardashevskiy
2014-06-11 17:03 ` [Qemu-devel] [PATCH v6 3/4] target-i386: " Alexey Kardashevskiy
2014-06-11 17:03 ` [Qemu-devel] [PATCH v6 4/4] target-ppc: Add support for " 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=53989009.1000300@redhat.com \
    --to=eblake@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alex@alex.org.uk \
    --cc=armbru@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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.