From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39337 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbH7I-0003AC-3L for qemu-devel@nongnu.org; Fri, 07 Jan 2011 13:32:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbH7F-0002iO-TE for qemu-devel@nongnu.org; Fri, 07 Jan 2011 13:32:47 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:35861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbH7F-0002gG-Ex for qemu-devel@nongnu.org; Fri, 07 Jan 2011 13:32:45 -0500 Message-ID: <4D275C4B.6040001@web.de> Date: Fri, 07 Jan 2011 19:32:43 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4D2737EB.6070002@web.de> <20110107165359.GA10205@redhat.com> <4D274676.6000803@web.de> <20110107171653.GB10205@redhat.com> <4D274DD1.1020702@web.de> <20110107175307.GD10205@redhat.com> <4D275A40.9050106@web.de> In-Reply-To: <4D275A40.9050106@web.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE234416EF67DB8D1009A4315" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: qemu-kvm vs. qemu: Terminate cpu loop on reset? List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel , kvm This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE234416EF67DB8D1009A4315 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 07.01.2011 19:24, Jan Kiszka wrote: > Am 07.01.2011 18:53, Gleb Natapov wrote: >> On Fri, Jan 07, 2011 at 06:30:57PM +0100, Jan Kiszka wrote: >>> Am 07.01.2011 18:16, Gleb Natapov wrote: >>>> On Fri, Jan 07, 2011 at 05:59:34PM +0100, Jan Kiszka wrote: >>>>> Am 07.01.2011 17:53, Gleb Natapov wrote: >>>>>> On Fri, Jan 07, 2011 at 04:57:31PM +0100, Jan Kiszka wrote: >>>>>>> Hi, >>>>>>> >>>>>>> does anyone immediately know if this hunk from vl.c >>>>>>> >>>>>>> @@ -1278,6 +1197,10 @@ void qemu_system_reset_request(void) >>>>>>> } else { >>>>>>> reset_requested =3D 1; >>>>>>> } >>>>>>> + if (cpu_single_env) { >>>>>>> + cpu_single_env->stopped =3D 1; >>>>>>> + cpu_exit(cpu_single_env); >>>>>>> + } >>>>>>> qemu_notify_event(); >>>>>>> } >>>>>>> >>>>>>> is (semantically) relevant for upstream as well? IIUC, it ensures= that >>>>>>> the kvm cpu loop is not continued if an IO access called into >>>>>>> qemu_system_reset_request. >>>>>>> >>>>>> I don't know TCG enough to tell. If TCG can continue vcpu executio= n >>>>>> after io without checking reset_requested then it is relevant for >>>>>> upstream too. >>>>> >>>>> I was first of all thinking about kvm upstream, but their handling >>>>> differ much less upstream than in current qemu-kvm. Anyway, need to= dig >>>>> into the details. >>>>> >>>>>> >>>>>>> If yes, then it would be a good time to push a patch: these bits = will >>>>>>> fall to dust on next merge from upstream (vl.c no longer has acce= ss to >>>>>>> the cpu state). >>>>>>> >>>>>> On a next merge cpu state will have to be exposed to vl.c then. Th= is >>>>>> code cannot be dropped in qemu-kvm. >>>>> >>>>> I think a cleaner approach, even if it's only temporarily required,= is >>>>> to move that code to cpus.c. That's likely also the way when we nee= d it >>>>> upstream.=20 >>>> It doesn't matter where the code resides as long as it is called on >>>> reset. >>> >>> It technically matters for the build process (vl.c is built once thes= e >>> days, cpus.c is built per target). >>> >> Yes, I understand the build requirement. Runtime behaviour should not >> change. >=20 > Yep, for sure. >=20 > BTW, the self-IPI on pending exit request is there for a reason I but. > In order to complete half-done string-io or something like that? Would > be the next patch for upstream then. >=20 Yeah, it is, just found the confirming commit. It was just not pushed upstream as well. Jan --------------enigE234416EF67DB8D1009A4315 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.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0nXEsACgkQitSsb3rl5xQGhgCdGiJdiqv5E6t3g1UMHeBiOckX 5lkAoLDTo3alXd/4DNqJfAIr59y9ljQo =BL6j -----END PGP SIGNATURE----- --------------enigE234416EF67DB8D1009A4315--