From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvTjA-00071U-RS for qemu-devel@nongnu.org; Sun, 19 Apr 2009 05:54:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvTj5-0006wm-IL for qemu-devel@nongnu.org; Sun, 19 Apr 2009 05:54:20 -0400 Received: from [199.232.76.173] (port=36320 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvTj5-0006wY-C0 for qemu-devel@nongnu.org; Sun, 19 Apr 2009 05:54:15 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:52317) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LvTj4-00071p-M1 for qemu-devel@nongnu.org; Sun, 19 Apr 2009 05:54:15 -0400 Message-ID: <49EAF4C5.1000301@web.de> Date: Sun, 19 Apr 2009 11:54:13 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <49EAF46F.9060203@web.de> In-Reply-To: <49EAF46F.9060203@web.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig012103912A9EB07AAA0BCF24" Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH 2/2] kvm: Rework VCPU reset Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig012103912A9EB07AAA0BCF24 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Use standard callback with highest order to synchronize VCPU on reset after all device callbacks were execute. This allows to remove the special kvm hook in qemu_system_reset. Signed-off-by: Jan Kiszka --- kvm-all.c | 8 ++++++++ vl.c | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 9e9b462..1128bee 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -22,6 +22,7 @@ =20 #include "qemu-common.h" #include "sysemu.h" +#include "hw/hw.h" #include "gdbstub.h" #include "kvm.h" =20 @@ -321,6 +322,11 @@ int kvm_uncoalesce_mmio_region(target_phys_addr_t st= art, ram_addr_t size) return ret; } =20 +static void kvm_reset_vcpus(void *opaque) +{ + kvm_sync_vcpus(); +} + int kvm_init(int smp_cpus) { KVMState *s; @@ -411,6 +417,8 @@ int kvm_init(int smp_cpus) if (ret < 0) goto err; =20 + qemu_register_reset(kvm_reset_vcpus, INT_MAX, NULL); + kvm_state =3D s; =20 return 0; diff --git a/vl.c b/vl.c index 4a064bf..3cf8331 100644 --- a/vl.c +++ b/vl.c @@ -3627,8 +3627,6 @@ void qemu_system_reset(void) for(re =3D first_reset_entry; re !=3D NULL; re =3D re->next) { re->func(re->opaque); } - if (kvm_enabled()) - kvm_sync_vcpus(); } =20 void qemu_system_reset_request(void) --------------enig012103912A9EB07AAA0BCF24 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.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAknq9MUACgkQniDOoMHTA+n2pQCdFV3Mp66/oBxqkuFEOWYfFu/j XyAAnjufb5Hg2rT1N96GcMYT2so7h0LT =9v3L -----END PGP SIGNATURE----- --------------enig012103912A9EB07AAA0BCF24--