From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsFdy-0004Je-GR for qemu-devel@nongnu.org; Wed, 04 Jun 2014 14:10:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsFds-0001ww-Oa for qemu-devel@nongnu.org; Wed, 04 Jun 2014 14:10:33 -0400 Message-ID: <538F610F.8040106@redhat.com> Date: Wed, 04 Jun 2014 12:10:23 -0600 From: Eric Blake MIME-Version: 1.0 References: <1401891961-17292-1-git-send-email-aik@ozlabs.ru> <1401891961-17292-2-git-send-email-aik@ozlabs.ru> In-Reply-To: <1401891961-17292-2-git-send-email-aik@ozlabs.ru> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vfJDeBwU9Ut1RE8URdDl66h78SwCmxwO7" Subject: Re: [Qemu-devel] [PATCH v4 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 , qemu-ppc@nongnu.org, Alexander Graf , Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vfJDeBwU9Ut1RE8URdDl66h78SwCmxwO7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/04/2014 08:25 AM, Alexey Kardashevskiy wrote: > This introduces an NMI (non maskable interrupt) nmi_monitor_handler() > callback to the CPU class. It is called from QMP's "nmi" command and > performs an action required to cause debug crash dump on in-kernel > debugger invocation. >=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 > --- > + int ret =3D -1; > + > + if (cs && cc->nmi_monitor_handler) { > + ret =3D cc->nmi_monitor_handler(cs); > + } > + if (ret) { > + error_set(errp, QERR_UNSUPPORTED); If there is a cc->nmi_monitor_handler installed, is it allowed to return a value other than -1? What's more, if the monitor handler fails, QERR_UNSUPPORTED no longer seems like the best error. I think that means that your nmi_monitor_handler() callback needs to take an Error **errp parameter, and return the proper failure message, rather than relying on this caller botching it into an unrelated failure message. > +++ 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. Pre-existing, but as long as you are touching this line: s/an Non/a Non/ "given guest's VCPU" is awkward - since 'inject-nmi' doesn't take any parameters, how do you control which guest VCPU is given the interrupt? Is the interrupt delivered to all VCPUs, or just VCPU 0? Or does this mean the "VCPU of the given guest", in which case it is redundant (a monitor is associated with only one guest, so that guest is always the "given guest" of any command - a "given guest" only matters if we had an interface that could control multiple guests at once). > # > # Returns: If successful, nothing > # > # Since: 0.14.0 > -# > -# Notes: Only x86 Virtual Machines support this command. Rather than completely deleting this line, it might be worth stating: Note: prior to 2.1, this command was only supported for x86 VMs > =20 > -Inject an NMI on guest's CPUs. > +Inject an NMI on the given guest's CPU. Why the inconsistency between "CPU" vs. "VCPU" in the different doc locations? Can we pick one that works for all cases? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --vfJDeBwU9Ut1RE8URdDl66h78SwCmxwO7 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/ iQEcBAEBCAAGBQJTj2EPAAoJEKeha0olJ0NqE0YIAJGlQPmR80f5WnuBOGXGlevy xfPgio+uoOHXyf/AoR30osuEh3++VWcZVXKZHAvlLjKNxpjkdhN3zysh9e7kinhP MrlfMXZsmUNgpKPEgzHk1HZazrs1PcCD60VgL5ATskaIpu9cYbH+qmqmfRK02seq CdWS/lyXDT0UKsD9txeN6BMNgLs/oKzGoG5sqOp7a8ynIR2IjSTu6SFcjvkol55H 46QqtG/AYO5/Kblc1j3W69VDMrH4YaUrdyUDKMjK5sGOsrfv0mc+NLa1qlETEnGX Ff8J97Ss4MocruOvqVcLp51lO19LIr1jQVbg/XC+j1d88ipLXJkFRFUM0oyCuNc= =nKnl -----END PGP SIGNATURE----- --vfJDeBwU9Ut1RE8URdDl66h78SwCmxwO7--