From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [Android-virt] [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support Date: Sun, 05 Jun 2011 20:19:20 +0200 Message-ID: <4DEBC8A8.6000501@web.de> References: <20110603150318.17011.82777.stgit@ubuntu> <4DE8FE38.6030405@siemens.com> <4DE90397.5080801@siemens.com> <4DEB74DA.2040909@redhat.com> <4DEB8F22.1020802@web.de> <4DEB9033.9060109@redhat.com> <4DEB998E.1010805@web.de> <4DEB9C60.1030001@redhat.com> <4DEB9D4A.9060702@web.de> <4DEBAE9F.2010400@redhat.com> <21338E26-01D2-4A1A-816B-2D596EC557B8@suse.de> <4DEBAFD4.7040208@redhat.com> <4136FD10-CE47-47B6-9C38-78BE2EA89028@suse.de> <4DEBC175.4060007@web.de> <9CFA1D37-ADE6-4AC8-870A-5B76C42D1A9F@suse.de> <4DEBC34D.9060106@web.de> <4DEBC53E.2020301@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig46935DC423E786246EC87C0D" Cc: Avi Kivity , Christoffer Dall , kvm@vger.kernel.org, a.costa@virtualopensystems.com, android-virt@lists.cs.columbia.edu, s.raho@virtualopensystems.com To: Alexander Graf Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:52377 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755292Ab1FESTu (ORCPT ); Sun, 5 Jun 2011 14:19:50 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig46935DC423E786246EC87C0D Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-06-05 20:12, Alexander Graf wrote: >=20 > On 05.06.2011, at 20:04, Jan Kiszka wrote: >=20 >> On 2011-06-05 20:00, Alexander Graf wrote: >>> >>> On 05.06.2011, at 19:56, Jan Kiszka wrote: >>> >>>> On 2011-06-05 19:54, Alexander Graf wrote: >>>>> >>>>> On 05.06.2011, at 19:48, Jan Kiszka wrote: >>>>> >>>>>> On 2011-06-05 19:19, Alexander Graf wrote: >>>>>>> >>>>>>> On 05.06.2011, at 18:33, Avi Kivity wrote: >>>>>>> >>>>>>>> On 06/05/2011 07:30 PM, Alexander Graf wrote: >>>>>>>>>>> >>>>>>>>>>> Could you elaborate what you mean here? I'm not really follow= ing. Are >>>>>>>>>>> you suggesting a new arch-generic interface? (Pardon my ignor= ance). >>>>>>>>>> >>>>>>>>>> Using KVM_IRQ_LINE everywhere except s390, not just in x86 and= ARM. >>>>>>>>> >>>>>>>>> An in-kernel MPIC implementation is coming for PPC, so I don't = see any reason to switch from something that works now. >>>>>>>> >>>>>>>> Right, this is spilled milk. >>>>>>>> >>>>>>>> Does the ppc qemu implementation raise KVM_INTERRUPT solely from= the vcpu thread? >>>>>>> >>>>>>> Well, without iothread it used to obviously. Now that we have an = iothread, it calls ioctl(KVM_INTERRUPT) from a separate thread. The code = also doesn't forcefully wake up the vcpu thread, so yes, I think here's a= chance for at least delaying interrupt delivery. Chances are pretty slim= we don't get out of the vcpu thread at all :). >>>>>> >>>>>> There are good chances to run into a deadlock when calling a per-v= cpu >>>>>> IOCTL over a foreign context: calling thread holds qemu_mutex and = blocks >>>>>> on kvm_mutex inside the kernel, target vcpu is running endless gue= st >>>>>> loop, holding kvm_mutex, all other qemu threads will sooner or lat= er >>>>>> block on the global lock. That's at least one pattern you can get = on x86 >>>>>> (we had a few of such bugs in the past). >>>>> >>>>> Any recommendations? Should we just signal the main thread when we = want to inject an interrupt? >>>> >>>> Yep. That's also what x86 does (when using user space irqchips). >>> >>> Hrm, ok :). I guess the main reason we don't see major issues is that= >>> >>> 1) people don't use iothread too often yet - is it even enabled by d= efault? >> >> Nope (unless you use qemu-kvm.git next). >=20 > Any plans on finally doing that step? Code that isn't enabled by defaul= t is pretty prone to not be tested ;). It's a good way to slowly move cod= e upstream, stabilize it there and then finally have it enabled by defaul= t. But I don't think this process should last more than 1/2 year. And IIR= C with iothread, we're way past that point. That's getting a bit off-topic for this thread now: The good news is that 'next' will become 'master' fairly soon (unless some regression is found), and then we are using QEMU upstream's iothread code in qemu-kvm. By default. For upstream, we are still facing TCG performance regressions in iothread mode, thus it's still default off. $Someone would have to sort them out, and then we could flip defaults there as well. Jan --------------enig46935DC423E786246EC87C0D 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/ iEYEARECAAYFAk3ryKgACgkQitSsb3rl5xTuNgCfU5J2TamHcewITB2NKHfJDK1N AkgAn24ZjV7HLjTOYquKXl2KjxZWu3nt =jOCM -----END PGP SIGNATURE----- --------------enig46935DC423E786246EC87C0D--