From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [Qemu-devel] [PATCH] kvm: First step to push iothread lock out of inner run loop Date: Sun, 24 Jun 2012 16:08:04 +0200 Message-ID: <4FE71F44.9020800@web.de> References: <4FE4F56D.1020201@web.de> <4FE4F7F5.7030400@web.de> <20120623002259.GA13440@amt.cnet> <20120623090646.GA21908@amt.cnet> <4FE5AC75.1020504@web.de> <4FE6D4A6.9080708@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5F7CB309A119D271A0E2B325" Cc: Marcelo Tosatti , Liu Ping Fan , kvm , qemu-devel , Alexander Graf , Anthony Liguori To: Avi Kivity Return-path: Received: from mout.web.de ([212.227.15.4]:54491 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755917Ab2FXOIO (ORCPT ); Sun, 24 Jun 2012 10:08:14 -0400 In-Reply-To: <4FE6D4A6.9080708@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5F7CB309A119D271A0E2B325 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-06-24 10:49, Avi Kivity wrote: > On 06/23/2012 02:45 PM, Jan Kiszka wrote: >> >> Hmm, we may need the iothread lock around cpu_set_apic_tpr for >> !kvm_irqchip_in_kernel(). And as we are at it, apic_base manipulation >> can be but there as well. >> >> With in-kernel irqchip, there is no such need. Also, no one accesses >> eflags outside of the vcpu thread, independent of the irqchip mode. >=20 > In fact !kvm_irqchip_in_kernel() is broken wrt the tpr. Interrupt > injection needs to be done atomically, but currently we check the tpr > from the injecting thread, which means the cpu thread can race with it.= > We need to move the check to the vcpu thread so that the guest vcpu is= > halted. So apic_set_irq basically needs to be deferred to vcpu context, right? Will have a look. Jan --------------enig5F7CB309A119D271A0E2B325 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/ iEYEARECAAYFAk/nH0gACgkQitSsb3rl5xRPiACfQupgxaMzZeNdZhNAGwxkAuU6 A34AnjYyTPotTmN07EUpibeRVxCJ1vhr =12Y8 -----END PGP SIGNATURE----- --------------enig5F7CB309A119D271A0E2B325-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SinUI-0004YV-BV for qemu-devel@nongnu.org; Sun, 24 Jun 2012 10:08:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SinUF-0005AO-M0 for qemu-devel@nongnu.org; Sun, 24 Jun 2012 10:08:25 -0400 Received: from mout.web.de ([212.227.15.4]:63589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SinUF-00059v-CX for qemu-devel@nongnu.org; Sun, 24 Jun 2012 10:08:23 -0400 Message-ID: <4FE71F44.9020800@web.de> Date: Sun, 24 Jun 2012 16:08:04 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4FE4F56D.1020201@web.de> <4FE4F7F5.7030400@web.de> <20120623002259.GA13440@amt.cnet> <20120623090646.GA21908@amt.cnet> <4FE5AC75.1020504@web.de> <4FE6D4A6.9080708@redhat.com> In-Reply-To: <4FE6D4A6.9080708@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5F7CB309A119D271A0E2B325" Subject: Re: [Qemu-devel] [PATCH] kvm: First step to push iothread lock out of inner run loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Liu Ping Fan , kvm , Marcelo Tosatti , qemu-devel , Alexander Graf , Anthony Liguori This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5F7CB309A119D271A0E2B325 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-06-24 10:49, Avi Kivity wrote: > On 06/23/2012 02:45 PM, Jan Kiszka wrote: >> >> Hmm, we may need the iothread lock around cpu_set_apic_tpr for >> !kvm_irqchip_in_kernel(). And as we are at it, apic_base manipulation >> can be but there as well. >> >> With in-kernel irqchip, there is no such need. Also, no one accesses >> eflags outside of the vcpu thread, independent of the irqchip mode. >=20 > In fact !kvm_irqchip_in_kernel() is broken wrt the tpr. Interrupt > injection needs to be done atomically, but currently we check the tpr > from the injecting thread, which means the cpu thread can race with it.= > We need to move the check to the vcpu thread so that the guest vcpu is= > halted. So apic_set_irq basically needs to be deferred to vcpu context, right? Will have a look. Jan --------------enig5F7CB309A119D271A0E2B325 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/ iEYEARECAAYFAk/nH0gACgkQitSsb3rl5xRPiACfQupgxaMzZeNdZhNAGwxkAuU6 A34AnjYyTPotTmN07EUpibeRVxCJ1vhr =12Y8 -----END PGP SIGNATURE----- --------------enig5F7CB309A119D271A0E2B325--