[Xen-changelog] [xen-unstable] Fix push/jmp/call <reg/mem> to check whether the operand is register

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Xen-changelog] [xen-unstable] Fix push/jmp/call <reg/mem> to check whether the operand is register

Xen patchbot-unstable
# HG changeset patch
# User [hidden email]
# Date 1174990855 -3600
# Node ID b685bb321d1e7c70a9d1a23879b7a0425d6d7532
# Parent  70f4d99d1aed928a5db5344c589d8ae854f050dc
Fix push/jmp/call <reg/mem> to check whether the operand is register
or memory when expanding the operand to 8 bytes on x86/64.

Based on original patch by Dexuan Cui <[hidden email]>

Signed-off-by: Keir Fraser <[hidden email]>
---
 xen/arch/x86/x86_emulate.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 70f4d99d1aed -r b685bb321d1e xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c Mon Mar 26 17:22:45 2007 +0100
+++ b/xen/arch/x86/x86_emulate.c Tue Mar 27 11:20:55 2007 +0100
@@ -1565,8 +1565,10 @@ x86_emulate(
             if ( ((op_bytes = dst.bytes) != 8) && mode_64bit() )
             {
                 dst.bytes = op_bytes = 8;
-                if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
-                                     &dst.val, 8, ctxt)) != 0 )
+                if ( dst.type == OP_REG )
+                    dst.val = *dst.reg;
+                else if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
+                                          &dst.val, 8, ctxt)) != 0 )
                     goto done;
             }
             src.val = _regs.eip;
@@ -1579,8 +1581,10 @@ x86_emulate(
             if ( mode_64bit() && (dst.bytes == 4) )
             {
                 dst.bytes = 8;
-                if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
-                                     &dst.val, 8, ctxt)) != 0 )
+                if ( dst.type == OP_REG )
+                    dst.val = *dst.reg;
+                else if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
+                                          &dst.val, 8, ctxt)) != 0 )
                     goto done;
             }
             if ( (rc = ops->write(x86_seg_ss, sp_pre_dec(dst.bytes),

_______________________________________________
Xen-changelog mailing list
[hidden email]
http://lists.xensource.com/xen-changelog