Commit 1d6b114f authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: do not munge rep prefix

Currently we store a rep prefix as 1 or 2 depending on whether it is a REPE or
REPNE.  Since sse instructions depend on the prefix value, store it as the
original opcode to simplify things further on.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent cef4dea0
...@@ -249,8 +249,8 @@ struct x86_emulate_ctxt { ...@@ -249,8 +249,8 @@ struct x86_emulate_ctxt {
}; };
/* Repeat String Operation Prefix */ /* Repeat String Operation Prefix */
#define REPE_PREFIX 1 #define REPE_PREFIX 0xf3
#define REPNE_PREFIX 2 #define REPNE_PREFIX 0xf2
/* Execution mode, passed to the emulator. */ /* Execution mode, passed to the emulator. */
#define X86EMUL_MODE_REAL 0 /* Real mode. */ #define X86EMUL_MODE_REAL 0 /* Real mode. */
......
...@@ -2692,10 +2692,8 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) ...@@ -2692,10 +2692,8 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
c->lock_prefix = 1; c->lock_prefix = 1;
break; break;
case 0xf2: /* REPNE/REPNZ */ case 0xf2: /* REPNE/REPNZ */
c->rep_prefix = REPNE_PREFIX;
break;
case 0xf3: /* REP/REPE/REPZ */ case 0xf3: /* REP/REPE/REPZ */
c->rep_prefix = REPE_PREFIX; c->rep_prefix = c->b;
break; break;
default: default:
goto done_prefixes; goto done_prefixes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment