From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhU38-0008Cw-FM for qemu-devel@nongnu.org; Wed, 11 Mar 2009 15:25:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhU37-0008C8-0U for qemu-devel@nongnu.org; Wed, 11 Mar 2009 15:25:06 -0400 Received: from [199.232.76.173] (port=45870 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhU36-0008C3-Mv for qemu-devel@nongnu.org; Wed, 11 Mar 2009 15:25:04 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:54688) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhU36-00005R-2A for qemu-devel@nongnu.org; Wed, 11 Mar 2009 15:25:04 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate03.web.de (Postfix) with ESMTP id 676FBF923396 for ; Wed, 11 Mar 2009 20:25:00 +0100 (CET) Received: from [88.64.18.79] (helo=[192.168.1.2]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1LhU31-000348-00 for qemu-devel@nongnu.org; Wed, 11 Mar 2009 20:24:59 +0100 Message-ID: <49B8100B.7030803@web.de> Date: Wed, 11 Mar 2009 20:24:59 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <49B7C31F.5030201@siemens.com> <20090311161010.GB18390@shareable.org> <49B7E760.2090100@siemens.com> <20090311164053.GC18390@shareable.org> In-Reply-To: <20090311164053.GC18390@shareable.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4D7B09F12BE00FBD3B5C10E2" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [RESEND][PATCH] x86: Enhanced dump of segment registers Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4D7B09F12BE00FBD3B5C10E2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Jamie Lokier wrote: > Jan Kiszka wrote: >> Jamie Lokier wrote: >>> Jan Kiszka wrote: >>>> FS =3D0000 00000000 00000000 00000000 >>>> LDT=3D0000 00000000 00000000 00008200 DPL=3D0 LDT >>> Both are =3D0000, but different descriptors - is that right? >> Good question. My patch only parses to descriptor cache content withou= t >> evaluating the selector. I guess that 0x00008200 is a leftover from a >> previous, valid LDT descriptor. >> >>> Also I'm thinking the null descriptor doesn't need to show offset and= >>> size: >>> >>> FS =3D0000 >>> >>> is enough? >> Yes, makes sense. IOW: stop parsing if selector =3D=3D 0. Will post an= update. >=20 > Hmm. >=20 > Does a real x86 look at the selector value ever (except when loading > it), or does it base all decisions on the descriptor cache? >=20 > It's an accuracy of emulation thing, as you can legitimately put the > CPU into states where the descriptor cache and selector values are > inconsistent, and it does have a well-defined behaviour. Yeah, there is some truth in this. While you can't load NULL into the task register e.g., it may still work based on its boot-up cache content.= >=20 > If a real x86 always uses the descriptor cache, presumably there > shouldn't be a leftover value in it when LDT is loaded with 0, and > perhaps choosing to show a null descriptor should depend on the > descriptor cache entry rather than the selector value. Let's don't try to be too clever here (even 0 in all cache fields can have a meaning in 64-bit mode) and simply keep the output as is. However, your suggestion led to a nice code cleanup as I folded all descriptor dumping into a single helper. :) Jan --------------enig4D7B09F12BE00FBD3B5C10E2 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 iEYEARECAAYFAkm4EAsACgkQniDOoMHTA+lkRwCfdGYJ1b+CL1w/DuC8bSYn5hxi AncAn2yEY6pfmsTOfAwa3C2TEqootCo4 =/H7+ -----END PGP SIGNATURE----- --------------enig4D7B09F12BE00FBD3B5C10E2--