From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgLw2-0003XG-Qq for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:33:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgLw1-0003Wm-75 for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:33:06 -0400 Received: from [199.232.76.173] (port=58579 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgLw1-0003Wh-2z for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:33:05 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:48612) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LgLw0-00040z-Ba for qemu-devel@nongnu.org; Sun, 08 Mar 2009 12:33:04 -0400 Message-ID: <49B3F333.4060504@web.de> Date: Sun, 08 Mar 2009 17:32:51 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <49B3EAA8.6050900@web.de> <49B3EE01.3090402@codemonkey.ws> In-Reply-To: <49B3EE01.3090402@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig410CAEC0FF86F5C72FDE5207" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [6684] Fix "info registers" under kvm. 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@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig410CAEC0FF86F5C72FDE5207 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > Jan Kiszka wrote: >> Andrzej Zaborowski wrote: >> =20 >>> Revision: 6684 >>> http://svn.sv.gnu.org/viewvc/?view=3Drev&root=3Dqemu&revisi= on=3D6684 >>> Author: balrog >>> Date: 2009-03-04 21:00:07 +0000 (Wed, 04 Mar 2009) >>> Log Message: >>> ----------- >>> Fix "info registers" under kvm. >>> >>> Modified Paths: >>> -------------- >>> trunk/target-i386/helper.c >>> >>> Modified: trunk/target-i386/helper.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- trunk/target-i386/helper.c 2009-03-04 19:25:22 UTC (rev 6683) >>> +++ trunk/target-i386/helper.c 2009-03-04 21:00:07 UTC (rev 6684) >>> @@ -578,6 +578,9 @@ >>> char cc_op_name[32]; >>> static const char *seg_name[6] =3D { "ES", "CS", "SS", "DS", "FS= ", >>> "GS" }; >>> =20 >>> + if (kvm_enabled()) >>> + kvm_arch_get_registers(env); >>> + >>> eflags =3D env->eflags; >>> #ifdef TARGET_X86_64 >>> if (env->hflags & HF_CS64_MASK) { >>> >>> =20 >> >> On the one hand, this patch also takes care of sync'ing with KVM in ca= se >> of cpu_dump_state on fatal exists. On the other hand, it only solves o= ne >> part of monitor issue. See [1] for a more complete sync. >> >> I'm just still waiting for a reply from Anthony on how to embed best a= ll >> the "if (kvm_enabled()) foo();" patterns [2]. That would also allow us= >> to merge gdbstub support for upstream kvm. >> =20 >=20 > I really don't have a great suggestion. I've been hoping we could come= > up with something better than if (kvm_enabled()) foo(). If we can't, w= e > can't. We could do static inline void kvm_get_registers(CPUState *env) { if (kvm_enabled()) kvm_arch_get_registers(env); } in kvm.h (and kvm_put_registers analogously). That would still be kvm-specific, though, but it would reduce the impact on the code that has to be extended this way. Generic hooks is something I would really like to postpone here until we start working on some accelerator abstraction. Jan --------------enig410CAEC0FF86F5C72FDE5207 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 iEYEARECAAYFAkmz8zsACgkQniDOoMHTA+lOMACZAeqJHRIAK0p76YGcR4lNSTdk IIMAn0XtlX93BXyvOybMxZP+0Ir3HK45 =l67m -----END PGP SIGNATURE----- --------------enig410CAEC0FF86F5C72FDE5207--