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:58:19 +0000 [thread overview]
Message-ID: <4F6CD5DB.6090806@citrix.com> (raw)
In-Reply-To: <4F6CD14B.4020701@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
On 23/03/12 19:38, Andrew Cooper wrote:
> Sadly, given your other email, I doubt it will work, because of the big
> catch all regarding the lock prefix.
>
> A brief scan over the Intel manuals and I cant see a case where an
> incorrect LOCK prefix would cause #GPF rather than #UD.
>
> Perhaps try changing it to EXP_UD instead of EXP_GP. (Although I make
> no guarantee that this wont cause a lot of things to break.)
Try this patch instead.
I have still yet to find a single example in either manual 2A or B where
an invalid lock prefix would cause a #GPF rather than #UD
--
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: 1252 bytes --]
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
@@ -1429,7 +1429,7 @@ x86_emulate(
}
/* Lock prefix is allowed only on RMW instructions. */
- generate_exception_if((d & Mov) && lock_prefix, EXC_GP, 0);
+ generate_exception_if((d & Mov) && lock_prefix, EXC_UD, 0);
/* ModRM and SIB bytes. */
if ( d & ModRM )
@@ -1712,12 +1712,12 @@ x86_emulate(
lock_prefix &&
((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */
(b != 0xc7), /* CMPXCHG{8,16}B */
- EXC_GP, 0);
+ EXC_UD, 0);
dst.type = OP_NONE;
break;
case DstReg:
- generate_exception_if(lock_prefix, EXC_GP, 0);
+ generate_exception_if(lock_prefix, EXC_UD, 0);
dst.type = OP_REG;
if ( d & ByteOp )
{
@@ -1773,7 +1773,7 @@ x86_emulate(
dst = ea;
if ( dst.type == OP_REG )
{
- generate_exception_if(lock_prefix, EXC_GP, 0);
+ generate_exception_if(lock_prefix, EXC_UD, 0);
switch ( dst.bytes )
{
case 1: dst.val = *(uint8_t *)dst.reg; break;
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-03-23 19: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
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 [this message]
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=4F6CD5DB.6090806@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.