All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	"kris.van.hees@oracle.com" <kris.van.hees@oracle.com>,
	Keir Fraser <keir.xen@gmail.com>
Subject: Re: Invalid op code emulation for HVM guest and GPF
Date: Fri, 23 Mar 2012 18:58:08 +0000	[thread overview]
Message-ID: <4F6CC7C0.2000700@citrix.com> (raw)
In-Reply-To: <20120323114425.07bd6db7@mantra.us.oracle.com>



On 23/03/12 18:44, Mukesh Rathor wrote:
> Hey Keir,
>
> DTRACE in linux/solaris guests use invalid op code sequence:
>
> opcode trap is: 0xF0 0x90 0x90 0x90 0x90 (LOCK NOP NOP NOP NOP) 
>
> to receive UD, but they get GPF instead. (xen 4.1.2)
>
> Looking at hvm_emulate_one() I see place where it generates GPF if not
> expected sequence. Do you know quickly what can be done to deliver UD
> for the above sequence, or what single byte they can use to generate
> UD? (int 6 is two byte instr and doesn't work for them).
>
> thanks a lot,
> Mukesh

There is the UD2 instruction 0x0F 0x0B which is specifically designed to
cause a #UD exception.

I am not sure what you mean by "single byte", as the example sequence is
not a single byte instruction.  The LOCK is an instruction prefix,
making the first NOP a 2 byte instruction, followed by three 1byte
instructions.

As for the operation of LOCK NOP, Intel manual 2B defines this to cause
an #UD exception, so that is a bug in Xen.

It has been long time since I have played about in that code - I will
see if I can remember enough to fix this issue, but others will probably
be faster.

~Andrew

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

  reply	other threads:[~2012-03-23 18:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 18:44 Invalid op code emulation for HVM guest and GPF Mukesh Rathor
2012-03-23 18:58 ` Andrew Cooper [this message]
2012-03-23 19:17 ` Keir Fraser
2012-03-23 19:28   ` Mukesh Rathor
2012-03-23 19:20 ` Andrew Cooper
2012-03-23 19:30   ` Mukesh Rathor
2012-03-23 19:38     ` Andrew Cooper
2012-03-23 19:58       ` Andrew Cooper
2012-03-23 20:40         ` Keir Fraser

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=4F6CC7C0.2000700@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=keir.xen@gmail.com \
    --cc=kris.van.hees@oracle.com \
    --cc=mukesh.rathor@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.