From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH V3] Guest stop notification Date: Fri, 02 Dec 2011 21:20:43 +0100 Message-ID: <4ED9331B.9060708@web.de> References: <1322853560-24152-1-git-send-email-emunson@mgebm.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB8A66F3290D7001B959F4CD8" Cc: "qemu-devel@nongnu.org" , Avi Kivity , Marcelo Tosatti , "ryanh@linux.vnet.ibm.com" , "aliguori@us.ibm.com" , "kvm@vger.kernel.org" To: Eric B Munson Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:53182 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751813Ab1LBUUs (ORCPT ); Fri, 2 Dec 2011 15:20:48 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate03.web.de (Postfix) with ESMTP id 46DB81AB3050E for ; Fri, 2 Dec 2011 21:20:46 +0100 (CET) In-Reply-To: <1322853560-24152-1-git-send-email-emunson@mgebm.net> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB8A66F3290D7001B959F4CD8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-12-02 20:19, Eric B Munson wrote: > Often when a guest is stopped from the qemu console, it will report spu= rious > soft lockup warnings on resume. There are kernel patches being discuss= ed that > will give the host the ability to tell the guest that it is being stopp= ed and > should ignore the soft lockup warning that generates. >=20 > Signed-off-by: Eric B Munson > Cc: Avi Kivity > Cc: Marcelo Tosatti > Cc: Jan Kiszka > Cc: ryanh@linux.vnet.ibm.com > Cc: aliguori@us.ibm.com > Cc: kvm@vger.kernel.org >=20 > --- > Changes from V2: > Move ioctl into hw/kvmclock.c so as other arches can use it as it is > implemented >=20 > Changes from V1: > Remove unnecessary encapsulating function >=20 > hw/kvmclock.c | 24 ++++++++++++++++++++++++ > 1 files changed, 24 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/kvmclock.c b/hw/kvmclock.c > index 5388bc4..756839f 100644 > --- a/hw/kvmclock.c > +++ b/hw/kvmclock.c > @@ -16,6 +16,7 @@ > #include "sysbus.h" > #include "kvm.h" > #include "kvmclock.h" > +#include "cpu-all.h" > =20 > #include > #include > @@ -69,11 +70,34 @@ static void kvmclock_vm_state_change(void *opaque, = int running, > } > } > =20 > +static void kvmclock_vm_state_change_vcpu(void *opaque, int running, > + RunState state) > +{ > + int ret; > + CPUState *penv =3D first_cpu; > + > + if (running) { > + while (penv) { or: for (cpu =3D first_cpu; cpu !=3D NULL; cpu =3D cpu->next_cpu) { > + ret =3D kvm_vcpu_ioctl(penv, KVM_GUEST_PAUSED, 0); > + if (ret) { > + if (ret !=3D ENOSYS) { > + fprintf(stderr, > + "kvmclock_vm_state_change_vcpu: %s\n", > + strerror(-ret)); > + } > + return; > + } > + penv =3D (CPUState *)penv->next_cpu; Unneeded cast. > + } > + } > +} > + Again: please use checkpatch.pl. > static int kvmclock_init(SysBusDevice *dev) > { > KVMClockState *s =3D FROM_SYSBUS(KVMClockState, dev); > =20 > qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s); > + qemu_add_vm_change_state_handler(kvmclock_vm_state_change_vcpu, NU= LL); > return 0; > } > =20 Why not extend the existing handler? I still wonder if the IOCTL interface is actually kvmclock specific. But Marcello asked for this, and we could still change it when some arch comes around that provides it independent of kvmclock. Jan --------------enigB8A66F3290D7001B959F4CD8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7ZMxsACgkQitSsb3rl5xTXugCfc+m0kw6iXLC97IYdNlY+wbek +H8AoIR6FQMtyrMmBlo+9YVh2vGxe99l =mLBw -----END PGP SIGNATURE----- --------------enigB8A66F3290D7001B959F4CD8-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWZbH-000831-3K for qemu-devel@nongnu.org; Fri, 02 Dec 2011 15:20:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWZbF-0007dQ-2a for qemu-devel@nongnu.org; Fri, 02 Dec 2011 15:20:51 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:53177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWZbE-0007dC-N0 for qemu-devel@nongnu.org; Fri, 02 Dec 2011 15:20:49 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate03.web.de (Postfix) with ESMTP id 413E41AB304F0 for ; Fri, 2 Dec 2011 21:20:46 +0100 (CET) Message-ID: <4ED9331B.9060708@web.de> Date: Fri, 02 Dec 2011 21:20:43 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1322853560-24152-1-git-send-email-emunson@mgebm.net> In-Reply-To: <1322853560-24152-1-git-send-email-emunson@mgebm.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB8A66F3290D7001B959F4CD8" Subject: Re: [Qemu-devel] [PATCH V3] Guest stop notification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric B Munson Cc: "ryanh@linux.vnet.ibm.com" , "aliguori@us.ibm.com" , "kvm@vger.kernel.org" , Marcelo Tosatti , "qemu-devel@nongnu.org" , Avi Kivity This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB8A66F3290D7001B959F4CD8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-12-02 20:19, Eric B Munson wrote: > Often when a guest is stopped from the qemu console, it will report spu= rious > soft lockup warnings on resume. There are kernel patches being discuss= ed that > will give the host the ability to tell the guest that it is being stopp= ed and > should ignore the soft lockup warning that generates. >=20 > Signed-off-by: Eric B Munson > Cc: Avi Kivity > Cc: Marcelo Tosatti > Cc: Jan Kiszka > Cc: ryanh@linux.vnet.ibm.com > Cc: aliguori@us.ibm.com > Cc: kvm@vger.kernel.org >=20 > --- > Changes from V2: > Move ioctl into hw/kvmclock.c so as other arches can use it as it is > implemented >=20 > Changes from V1: > Remove unnecessary encapsulating function >=20 > hw/kvmclock.c | 24 ++++++++++++++++++++++++ > 1 files changed, 24 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/kvmclock.c b/hw/kvmclock.c > index 5388bc4..756839f 100644 > --- a/hw/kvmclock.c > +++ b/hw/kvmclock.c > @@ -16,6 +16,7 @@ > #include "sysbus.h" > #include "kvm.h" > #include "kvmclock.h" > +#include "cpu-all.h" > =20 > #include > #include > @@ -69,11 +70,34 @@ static void kvmclock_vm_state_change(void *opaque, = int running, > } > } > =20 > +static void kvmclock_vm_state_change_vcpu(void *opaque, int running, > + RunState state) > +{ > + int ret; > + CPUState *penv =3D first_cpu; > + > + if (running) { > + while (penv) { or: for (cpu =3D first_cpu; cpu !=3D NULL; cpu =3D cpu->next_cpu) { > + ret =3D kvm_vcpu_ioctl(penv, KVM_GUEST_PAUSED, 0); > + if (ret) { > + if (ret !=3D ENOSYS) { > + fprintf(stderr, > + "kvmclock_vm_state_change_vcpu: %s\n", > + strerror(-ret)); > + } > + return; > + } > + penv =3D (CPUState *)penv->next_cpu; Unneeded cast. > + } > + } > +} > + Again: please use checkpatch.pl. > static int kvmclock_init(SysBusDevice *dev) > { > KVMClockState *s =3D FROM_SYSBUS(KVMClockState, dev); > =20 > qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s); > + qemu_add_vm_change_state_handler(kvmclock_vm_state_change_vcpu, NU= LL); > return 0; > } > =20 Why not extend the existing handler? I still wonder if the IOCTL interface is actually kvmclock specific. But Marcello asked for this, and we could still change it when some arch comes around that provides it independent of kvmclock. Jan --------------enigB8A66F3290D7001B959F4CD8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7ZMxsACgkQitSsb3rl5xTXugCfc+m0kw6iXLC97IYdNlY+wbek +H8AoIR6FQMtyrMmBlo+9YVh2vGxe99l =mLBw -----END PGP SIGNATURE----- --------------enigB8A66F3290D7001B959F4CD8--