# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202410607 0
# Node ID 5e08872c24f791921be8bbea3419a8e85da22148
# Parent 445edf4089a3ccaca977665423e903b5300832cb
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/arch/x86/x86_emulate.c | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff -r 445edf4089a3 -r 5e08872c24f7 xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c Thu Feb 07 18:00:44 2008 +0000
+++ b/xen/arch/x86/x86_emulate.c Thu Feb 07 18:56:47 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
|