From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38041 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcXD7-0001T0-1Q for qemu-devel@nongnu.org; Tue, 11 Jan 2011 00:56:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcXD5-000341-Vy for qemu-devel@nongnu.org; Tue, 11 Jan 2011 00:56:00 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:39413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcXD5-00033u-Mr for qemu-devel@nongnu.org; Tue, 11 Jan 2011 00:55:59 -0500 Message-ID: <4D2BF0EB.3020007@web.de> Date: Tue, 11 Jan 2011 06:55:55 +0100 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B9067.5080401@codemonkey.ws> In-Reply-To: <4D2B9067.5080401@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig05CFB8CF0B056D12E449855D" Sender: jan.kiszka@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Glauber Costa , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig05CFB8CF0B056D12E449855D Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 11.01.2011 00:04, Anthony Liguori wrote: >>> kvmclock should be created with >>> kvm_state as a parameter and kvm_vm_ioctl() is passed the stored >>> reference. Taking a global reference to kvm_state in machine_init i= s >>> not a bad thing, obviously the machine initialization function needs >>> access to the kvm_state. >>> =20 >> This would also require changing sysbus interfaces for the sake of KVM= 's >> "abstraction". If this is the only way forward, I could look into this= =2E >> >> Still, I do not see any benefit for the affected code. You then either= >> need to "steal" a kvm_state reference from the first cpu or introduce = a >> marvelous interface like kvm_get_state() to make this work from outsid= e >> of the KVM core. >> =20 >=20 > Or move kvm_init() to pc_init() and then pc_init() has the kvm_state > reference. Or pass the reference to the machine_init service to avoid duplicating kvm_init logic for every KVM arch. That alone would still be consistent. But as long as we do not pass a kvm_state to each and every memory registration (for kvm_setup_guest_memory), this all is like putting a fence around half of your yard and only declaring it closed. Jan --------------enig05CFB8CF0B056D12E449855D 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/ iEYEARECAAYFAk0r8OsACgkQitSsb3rl5xTLfwCeMF57LHsgNtGXJb/GDyyEgzHz nWwAnRupryp+i+kNkx9+Cf8HrgiMPvF5 =pmlQ -----END PGP SIGNATURE----- --------------enig05CFB8CF0B056D12E449855D--