From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40781 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbGyu-0000TL-L6 for qemu-devel@nongnu.org; Fri, 07 Jan 2011 13:24:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbGyo-0000iO-Uj for qemu-devel@nongnu.org; Fri, 07 Jan 2011 13:24:08 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:57380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbGyo-0000i2-IB for qemu-devel@nongnu.org; Fri, 07 Jan 2011 13:24:02 -0500 Message-ID: <4D275A40.9050106@web.de> Date: Fri, 07 Jan 2011 19:24:00 +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> In-Reply-To: <20110107175307.GD10205@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC079C98A438558A7BF331E63" 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) --------------enigC079C98A438558A7BF331E63 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 execution= >>>>> 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 w= ill >>>>>> fall to dust on next merge from upstream (vl.c no longer has acces= s to >>>>>> the cpu state). >>>>>> >>>>> On a next merge cpu state will have to be exposed to vl.c then. Thi= s >>>>> 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 need= 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 these= >> days, cpus.c is built per target). >> > Yes, I understand the build requirement. Runtime behaviour should not > change. Yep, for sure. 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 >> In any case, we apparently need to fix upstream, I'm playing with some= >> approach. >> >>> >>>> If upstream does not need it, we have to understand why a= nd >>>> maybe adopt its pattern (the ultimate goal is unification anyway). >>>> >>> I don't consider kvm upstream as working product. The goal should be >>> moving to qemu-kvm code in upstream preserving all the knowledge we >>> acquired while making it production grade code. >> >> We had this discussion before. My goal remains to filter the remaining= >> upstream fixes out of the noise, adjust both versions so that they are= >> apparently identical, and then switch to a single version. >> > I thought there was an agreement to accept qemu-kvm implementation as i= s > into upstream (without some parts like device assignment). If you look > at qemu-kvm you'll see that upstream implementation is marked as > OBSOLETE_KVM_IMPL. You can't merge both trees without introducing regressions, either in the kvm part or some other section that qemu-kvm did not stress. IMO, there is no way around understanding all the nice little "fixes" that piled up over the years and translate them into proper, documented patche= s. >=20 >> We are on a good track now. I predict that we will be left with only o= ne >> or two major additional features in qemu-kvm in a few months from now,= >> no more duplications with subtle differences, and production-grade kvm= >> upstream stability. >> > You are optimistic. My prediction is that it will take at least one maj= or RHEL > release until such merged code base will become production-grade. That > is when most bugs that were introduced by eliminating subtle difference= s > between working and non-working version will be found :) The more upstream code qemu-kvm stresses, the faster this convergence will become. And there is really not that much left. E.g, I've a qemu-kvm-x86.c here that is <400 LOC. >=20 > BTW Do you have a plan how to move upstream to thread per vcpu? Upstream has this already, but it's - once again - a different implementation. Understanding those differences is one of the next steps.= In fact, as posted recently, unifying the execution model implementations is the only big problem I see. In-kernel irqchips and device assignment are things that can live in qemu-kvm without much conflicts until they are finally mergable. Jan --------------enigC079C98A438558A7BF331E63 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/ iEUEARECAAYFAk0nWkAACgkQitSsb3rl5xRqvACg3qNaFSrRNjPdO6uhrxDGRrkO K4gAmMhfDEF/CUcEBISomFgC3h096cI= =q7LB -----END PGP SIGNATURE----- --------------enigC079C98A438558A7BF331E63--