[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.2-testing] x86_emulate: Handle rep_ins, rep_outs, rep_movs hook failure and fall



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1203343524 0
# Node ID d590e594453015229747425753b4ef2ef0930b62
# Parent  e08d00f0c3e33a879123abeee19da95f1b5b2193
x86_emulate: Handle rep_ins, rep_outs, rep_movs hook failure and fall
back to slow path.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   16996:5e08872c24f791921be8bbea3419a8e85da22148
xen-unstable date:        Thu Feb 07 18:56:47 2008 +0000
---
 xen/arch/x86/x86_emulate.c |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff -r e08d00f0c3e3 -r d590e5944530 xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c        Mon Feb 18 14:04:57 2008 +0000
+++ b/xen/arch/x86/x86_emulate.c        Mon Feb 18 14:05:24 2008 +0000
@@ -2225,11 +2225,12 @@ x86_emulate(
         dst.bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes;
         dst.mem.seg = x86_seg_es;
         dst.mem.off = truncate_ea(_regs.edi);
-        if ( (nr_reps > 1) && (ops->rep_ins != NULL) )
-        {
-            if ( (rc = ops->rep_ins((uint16_t)_regs.edx, dst.mem.seg,
-                                    dst.mem.off, dst.bytes,
-                                    &nr_reps, ctxt)) != 0 )
+        if ( (nr_reps > 1) && (ops->rep_ins != NULL) &&
+             ((rc = ops->rep_ins((uint16_t)_regs.edx, dst.mem.seg,
+                                 dst.mem.off, dst.bytes,
+                                 &nr_reps, ctxt)) != X86EMUL_UNHANDLEABLE) )
+        {
+            if ( rc != 0 )
                 goto done;
         }
         else
@@ -2252,11 +2253,12 @@ x86_emulate(
         unsigned long nr_reps = get_rep_prefix();
         generate_exception_if(!mode_iopl(), EXC_GP);
         dst.bytes = !(b & 1) ? 1 : (op_bytes == 8) ? 4 : op_bytes;
-        if ( (nr_reps > 1) && (ops->rep_outs != NULL) )
-        {
-            if ( (rc = ops->rep_outs(ea.mem.seg, truncate_ea(_regs.esi),
-                                     (uint16_t)_regs.edx, dst.bytes,
-                                     &nr_reps, ctxt)) != 0 )
+        if ( (nr_reps > 1) && (ops->rep_outs != NULL) &&
+             ((rc = ops->rep_outs(ea.mem.seg, truncate_ea(_regs.esi),
+                                  (uint16_t)_regs.edx, dst.bytes,
+                                  &nr_reps, ctxt)) != X86EMUL_UNHANDLEABLE) )
+        {
+            if ( rc != 0 )
                 goto done;
         }
         else
@@ -2403,11 +2405,12 @@ x86_emulate(
         dst.bytes = (d & ByteOp) ? 1 : op_bytes;
         dst.mem.seg = x86_seg_es;
         dst.mem.off = truncate_ea(_regs.edi);
-        if ( (nr_reps > 1) && (ops->rep_movs != NULL) )
-        {
-            if ( (rc = ops->rep_movs(ea.mem.seg, truncate_ea(_regs.esi),
-                                     dst.mem.seg, dst.mem.off, dst.bytes,
-                                     &nr_reps, ctxt)) != 0 )
+        if ( (nr_reps > 1) && (ops->rep_movs != NULL) &&
+             ((rc = ops->rep_movs(ea.mem.seg, truncate_ea(_regs.esi),
+                                  dst.mem.seg, dst.mem.off, dst.bytes,
+                                  &nr_reps, ctxt)) != X86EMUL_UNHANDLEABLE) )
+        {
+            if ( rc != 0 )
                 goto done;
         }
         else

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.