From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwDmU-00005i-5H for qemu-devel@nongnu.org; Sat, 11 Feb 2012 09:18:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwDmS-0007P2-TE for qemu-devel@nongnu.org; Sat, 11 Feb 2012 09:18:26 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:48528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwDmS-0007Oy-L4 for qemu-devel@nongnu.org; Sat, 11 Feb 2012 09:18:24 -0500 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate03.web.de (Postfix) with ESMTP id AC4021B104787 for ; Sat, 11 Feb 2012 15:18:23 +0100 (CET) Message-ID: <4F3678A8.60406@web.de> Date: Sat, 11 Feb 2012 15:18:16 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F363DB2.3080908@web.de> <4F3655E7.3090905@suse.de> <4F36626D.7020109@web.de> <4F367462.10306@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig2B8938E6F4D49AD52EA8698F" Subject: Re: [Qemu-devel] [PATCH v2 1/8] kvm: Set cpu_single_env only once List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Anthony Liguori , Gleb Natapov , kvm@vger.kernel.org, Marcelo Tosatti , qemu-devel , Avi Kivity , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2B8938E6F4D49AD52EA8698F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2012-02-11 15:11, Blue Swirl wrote: > On Sat, Feb 11, 2012 at 14:00, Jan Kiszka wrote: >> On 2012-02-11 14:54, Blue Swirl wrote: >>> On Sat, Feb 11, 2012 at 12:43, Jan Kiszka wrote: >>>> On 2012-02-11 12:49, Andreas F=C3=A4rber wrote: >>>>> Am 11.02.2012 12:25, schrieb Blue Swirl: >>>>>> I think using cpu_single_env is an indication of a problem, like p= oor >>>>>> code, layering violation or poor API (vmport). What is your use ca= se? >>>>> >>>>> I couldn't spot any in this series. Jan, note that any new use of e= nv or >>>>> cpu_single_env will need to be redone when we convert to QOM CPU. >>>> >>>> cpu_single_env should have nothing to do with QOM. >>>> >>>> The ABIs of vmport and the KVM VAPI require a reference to the calli= ng >>>> VCPU, and that's why you find tons of them in patch 5. >>> >>> Yes, this seems to be another case of a badly designed ABI. I guess >>> there is no way to change that anymore, just like vmport? >> >> Believe me, I grumbled over it more than once while porting it from >> qemu-kvm. The point is that some (Windows) VMs out there are running >> already with this option ROM loaded and working this unfortunate ABI. >=20 > Maybe in time those could be deprecated and a ROM using a sane ABI > introduced instead. After some grace time the old ABI could be finally > removed. At some point. But now we have this interface and no other even thought out. Given that we want to provide a migration path from qemu-kvm to upstream rather sooner than later, I think there is no way around this model for a certain, not too short period. >=20 >>> >>> Some of the cpu_single_env accesses in patch 5 could be avoided when >>> APIC is moved closer to CPU. VAPIC should be also close to APIC so it= >>> should be able to access the CPU directly. In some other cases the >>> current state could be passed around instead once it is known. >> >> Some callbacks are I/O-port originated, ie. not associated with the >> per-CPU MMIO area or some MSR. So we would have to pass down the causi= ng >> CPU to every I/O handler - not sure if that is desired... >=20 > I meant things like vapic_enable_tpr_reporting(), current CPUState > could be passed via vapic_prepare() easily. Oh, there is in fact dead code in vapic_enable_tpr_reporting. It just iterates over all VCPUs, no need to know the current one. Jan --------------enig2B8938E6F4D49AD52EA8698F 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/ iEUEARECAAYFAk82eKkACgkQitSsb3rl5xQ/mwCWJcyIKM7mKVFmE2NElA7HpG+t sACg397meFwsh1AEWJNDzD2m68nB1kM= =fre6 -----END PGP SIGNATURE----- --------------enig2B8938E6F4D49AD52EA8698F--