|
@@ -778,8 +778,10 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
|
|
static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt,
|
|
static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt,
|
|
unsigned size)
|
|
unsigned size)
|
|
{
|
|
{
|
|
- if (unlikely(ctxt->fetch.end - ctxt->fetch.ptr < size))
|
|
|
|
- return __do_insn_fetch_bytes(ctxt, size);
|
|
|
|
|
|
+ unsigned done_size = ctxt->fetch.end - ctxt->fetch.ptr;
|
|
|
|
+
|
|
|
|
+ if (unlikely(done_size < size))
|
|
|
|
+ return __do_insn_fetch_bytes(ctxt, size - done_size);
|
|
else
|
|
else
|
|
return X86EMUL_CONTINUE;
|
|
return X86EMUL_CONTINUE;
|
|
}
|
|
}
|