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 19:20:58 +0000	[thread overview]
Message-ID: <4F6CCD1A.4090505@citrix.com> (raw)
In-Reply-To: <20120323114425.07bd6db7@mantra.us.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Patch attached.

Not tested, but seems logically correct.

@Mukesh: Do you mind testing please?

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


[-- Attachment #2: x86_emulate_nop.patch --]
[-- Type: text/x-patch, Size: 801 bytes --]

# HG changeset patch
# Parent 0ecb8ffe61b2ffff4331fcf49487c956ccb297a0
x86_emulate: Force #UD if lock prefix used with NOP instruction.

DTRACE uses 0xF0 0x90 0x90 0x90 0x90 (LOCK NOP NOP NOP NOP) to try and recieve a
#UD, but currently get GPF instead.

Fix x86_emulate, as #UD is the correct exception in this case.

Reported-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 0ecb8ffe61b2 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2255,6 +2255,7 @@ x86_emulate(
         break;
 
     case 0x90: /* nop / xchg %%r8,%%rax */
+        generate_exception_if(lock_prefix, EXC_UD, -1);
         if ( !(rex_prefix & 1) )
             break; /* nop */
 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

  parent reply	other threads:[~2012-03-23 19:20 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
2012-03-23 19:17 ` Keir Fraser
2012-03-23 19:28   ` Mukesh Rathor
2012-03-23 19:20 ` Andrew Cooper [this message]
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=4F6CCD1A.4090505@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.