xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Tim Deegan <tim@xen.org>, Eddie Dong <eddie.dong@intel.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH for-4.5 2/2] x86/hvm: Improve "Emulation failed @" error messages
Date: Fri, 26 Sep 2014 13:53:37 +0100	[thread overview]
Message-ID: <542561D1.2080201@citrix.com> (raw)
In-Reply-To: <542579F40200007800039A62@mail.emea.novell.com>

On 26/09/14 13:36, Jan Beulich wrote:
>>>> On 26.09.14 at 14:04, <andrew.cooper3@citrix.com> wrote:
>> On 26/09/14 12:39, Jan Beulich wrote:
>>>>>> On 26.09.14 at 12:10, <andrew.cooper3@citrix.com> wrote:
>>>> @@ -1449,6 +1441,37 @@ struct segment_register *hvmemul_get_seg_reg(
>>>>      return &hvmemul_ctxt->seg_reg[seg];
>>>>  }
>>>>  
>>>> +static const char *guest_x86_mode_to_str(int mode)
>>>> +{
>>>> +    switch ( mode )
>>>> +    {
>>>> +    case 0:
>>>> +        return "Real";
>>>> +    case 1:
>>>> +        return "v8086";
>>>> +    case 2:
>>> return "16bit";
>> case 2 is 32bit mode code in a 16bit segment.  Therefore, 32bit is still
>> the correct text when aiding decode of the instruction.
> It's specifically not: Operand and address size (and respective
> prefixes) have different meaning. You really don't care about
> the mode the CPU as a whole is in, but the kind of instructions
> it executes.
>
>> What I want to avoid is the confusing statement of "16bit mode" which is
>> easily confused as "Real mode" and a set of bytes which should be
>> decoded as 32bit instructions.
> But instructions in a 16-bit segment should be decoded as 16-bit
> instructions, not 32-bit ones. Yes, OS/2 and 16-bit Windows are
> long gone, but this hasn't changed.

I am indeed getting confused.

>
>>>> +    printk("%s emulation failed: %pv %s mode, %u bytes @ %04x:%lx: %*ph\n",
>>>> +           prefix, curr, mode_str, hvmemul_ctxt->insn_buf_bytes,
>>> Do you really need to print the byte count as a number when the
>>> new formatting will suitably limit output anyway?
>> I considered that, but thought that "@ xxxx:xxxx:\n" might be a little
>> obscure.  On the other hand, it might be ok.  I am happy dropping the
>> "%u bytes" if that is considered ok.
> Just make it "%04x:%08lx -> %*ph"? (Intentionally not using %lx
> as you did - I'd really dislike seeing addresses like 0000:12, while I'd
> be much less concerned for digit counts between 8 and 16 to vary.)

Looks better - I shall go with that.

~Andrew

  reply	other threads:[~2014-09-26 12:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 10:10 [PATCH for-4.5 0/2] Improve "Emulation failed" error message Andrew Cooper
2014-09-26 10:10 ` [PATCH for-4.5 1/2] xen/vsprintf: Introduce %*ph extended format specifier for hex buffers Andrew Cooper
2014-09-26 11:32   ` Jan Beulich
2014-09-26 12:16     ` Andrew Cooper
2014-09-26 12:31       ` Jan Beulich
2014-09-26 12:32         ` Andrew Cooper
2014-09-26 11:49   ` Tim Deegan
2014-09-26 11:57     ` Jan Beulich
2014-09-26 10:10 ` [PATCH for-4.5 2/2] x86/hvm: Improve "Emulation failed @" error messages Andrew Cooper
2014-09-26 11:39   ` Jan Beulich
2014-09-26 12:04     ` Andrew Cooper
2014-09-26 12:36       ` Jan Beulich
2014-09-26 12:53         ` Andrew Cooper [this message]
2014-09-26 12:05   ` Tim Deegan
2014-09-26 12:09     ` Andrew Cooper
2014-09-26 12:41       ` Tim Deegan
2014-09-26 12:57         ` Andrew Cooper
2014-09-26 13:06           ` Jan Beulich
2014-09-26 13:16             ` Andrew Cooper
2014-09-26 13:32               ` Jan Beulich
2014-09-26 14:15 ` [PATCH for-4.5 0/2] Improve "Emulation failed" error message Konrad Rzeszutek Wilk

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=542561D1.2080201@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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).