From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WumDK-0003wj-By for qemu-devel@nongnu.org; Wed, 11 Jun 2014 13:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WumDF-0000ca-ML for qemu-devel@nongnu.org; Wed, 11 Jun 2014 13:21:30 -0400 Message-ID: <53989009.1000300@redhat.com> Date: Wed, 11 Jun 2014 11:21:13 -0600 From: Eric Blake MIME-Version: 1.0 References: <1402506183-29736-1-git-send-email-aik@ozlabs.ru> <1402506183-29736-2-git-send-email-aik@ozlabs.ru> In-Reply-To: <1402506183-29736-2-git-send-email-aik@ozlabs.ru> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uIHdSSJ7lSqfRmCFg2LWSI0EIxIqcgfEw" Subject: Re: [Qemu-devel] [PATCH v6 1/4] cpus: Define callback for QEMU "nmi" command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: Peter Maydell , Alex Bligh , Markus Armbruster , Luiz Capitulino , Alexander Graf , qemu-ppc@nongnu.org, Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Richard Henderson This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uIHdSSJ7lSqfRmCFg2LWSI0EIxIqcgfEw Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 interf= ace > 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**. >=20 > This adds support for it in qmp_inject_nmi(). Since no architecture > supports it at the moment, there is no change in behaviour. >=20 > This changes inject-nmi command description for HMP and QMP. >=20 > Signed-off-by: Alexey Kardashevskiy > --- > +++ 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 modi= fy > + * 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 . > + */ 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 =3D opaque; > + NMI *n =3D (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 > ---------- > =20 > -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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --uIHdSSJ7lSqfRmCFg2LWSI0EIxIqcgfEw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTmJAJAAoJEKeha0olJ0NqKToH/iKq2yb86G4IZwLYfDzS2wGH fC2VJ7WWwWTQoHTEKqzid8zfZcfru9jbThSh3cvCrBCf2DpkWzqJiKmEF+eIAFfX fbzJ9w1mLNNYKz+aiTO75jjAIdHErjEToPv1vplfTYBjpSYdydebhaklnfudAIaS CL4h1FbrAuye9RllfljqcLcx3myYwtnOSl9pE/3oTg5ztK0FOiBmUoAODTb46D7J YNsiD3d18TQSY+RtNA+wvMnhKbjzUdhN2VJR3Vecbp1YzWN9RaUncauHocsA3YYZ N2XkHjxwpsy0iiszEv7PZ71x6rcAo6/utarHjh1aodRlFdijpeQEBqjyw1BJ4E8= =vcqO -----END PGP SIGNATURE----- --uIHdSSJ7lSqfRmCFg2LWSI0EIxIqcgfEw--