From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RESEND][PATCH] x86: Enhanced dump of segment registers
Date: Wed, 11 Mar 2009 20:24:59 +0100 [thread overview]
Message-ID: <49B8100B.7030803@web.de> (raw)
In-Reply-To: <20090311164053.GC18390@shareable.org>
[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]
Jamie Lokier wrote:
> Jan Kiszka wrote:
>> Jamie Lokier wrote:
>>> Jan Kiszka wrote:
>>>> FS =0000 00000000 00000000 00000000
>>>> LDT=0000 00000000 00000000 00008200 DPL=0 LDT
>>> Both are =0000, but different descriptors - is that right?
>> Good question. My patch only parses to descriptor cache content without
>> 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 =0000
>>>
>>> is enough?
>> Yes, makes sense. IOW: stop parsing if selector == 0. Will post an update.
>
> Hmm.
>
> Does a real x86 look at the selector value ever (except when loading
> it), or does it base all decisions on the descriptor cache?
>
> 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.
>
> 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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-03-11 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-11 13:56 [Qemu-devel] [RESEND][PATCH] x86: Enhanced dump of segment registers Jan Kiszka
2009-03-11 16:10 ` Jamie Lokier
2009-03-11 16:31 ` [Qemu-devel] " Jan Kiszka
2009-03-11 16:40 ` Jamie Lokier
2009-03-11 19:18 ` malc
2009-03-11 19:24 ` Jan Kiszka [this message]
2009-03-12 14:37 ` Avi Kivity
2009-03-12 14:57 ` Jan Kiszka
2009-03-12 17:58 ` Jamie Lokier
2009-03-12 18:21 ` Jan Kiszka
2009-03-11 19:40 ` [Qemu-devel] [PATCH v2] " Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49B8100B.7030803@web.de \
--to=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).