diff options
author | Avi Kivity <avi@redhat.com> | 2010-01-20 09:00:35 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:56:58 -0400 |
commit | 1d6b114f20d06ac0749686e4d7b7c7913d9116db (patch) | |
tree | 2be22fb5ba4fb76a73120776488a6e7ee4ba5bdc /arch | |
parent | cef4dea07f6720b36cc93e18a2e68be4bdb71a92 (diff) |
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: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 4 | ||||
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 0f5213564326..c00aed12755d 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -249,8 +249,8 @@ struct x86_emulate_ctxt { | |||
249 | }; | 249 | }; |
250 | 250 | ||
251 | /* Repeat String Operation Prefix */ | 251 | /* Repeat String Operation Prefix */ |
252 | #define REPE_PREFIX 1 | 252 | #define REPE_PREFIX 0xf3 |
253 | #define REPNE_PREFIX 2 | 253 | #define REPNE_PREFIX 0xf2 |
254 | 254 | ||
255 | /* Execution mode, passed to the emulator. */ | 255 | /* Execution mode, passed to the emulator. */ |
256 | #define X86EMUL_MODE_REAL 0 /* Real mode. */ | 256 | #define X86EMUL_MODE_REAL 0 /* Real mode. */ |
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 0ad47b819a8b..075bb6fc73ae 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2692,10 +2692,8 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) | |||
2692 | c->lock_prefix = 1; | 2692 | c->lock_prefix = 1; |
2693 | break; | 2693 | break; |
2694 | case 0xf2: /* REPNE/REPNZ */ | 2694 | case 0xf2: /* REPNE/REPNZ */ |
2695 | c->rep_prefix = REPNE_PREFIX; | ||
2696 | break; | ||
2697 | case 0xf3: /* REP/REPE/REPZ */ | 2695 | case 0xf3: /* REP/REPE/REPZ */ |
2698 | c->rep_prefix = REPE_PREFIX; | 2696 | c->rep_prefix = c->b; |
2699 | break; | 2697 | break; |
2700 | default: | 2698 | default: |
2701 | goto done_prefixes; | 2699 | goto done_prefixes; |