summaryrefslogtreecommitdiff
path: root/drivers/kvm/x86_emulate.c
diff options
context:
space:
mode:
authorGuillaume Thouvenin <guillaume.thouvenin@ext.bull.net>2007-11-22 10:32:09 (GMT)
committerAvi Kivity <avi@qumranet.com>2008-01-30 15:53:14 (GMT)
commit90e0a28f6b7241c7793f2ebd540c349580170446 (patch)
treee0e92ea3bd13298ac99529e54d1be98d306eb8f0 /drivers/kvm/x86_emulate.c
parente9f85cde99fa011db256f6683ba81d155e0d3f57 (diff)
downloadlinux-90e0a28f6b7241c7793f2ebd540c349580170446.tar.xz
KVM: x86 emulator: Make a distinction between repeat prefixes F3 and F2
cmps and scas instructions accept repeat prefixes F3 and F2. So in order to emulate those prefixed instructions we need to be able to know if prefixes are REP/REPE/REPZ or REPNE/REPNZ. Currently kvm doesn't make this distinction. This patch introduces this distinction. Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86_emulate.c')
-rw-r--r--drivers/kvm/x86_emulate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 6e7f774..9f8d59a 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -824,8 +824,10 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
c->lock_prefix = 1;
break;
case 0xf2: /* REPNE/REPNZ */
+ c->rep_prefix = REPNE_PREFIX;
+ break;
case 0xf3: /* REP/REPE/REPZ */
- c->rep_prefix = 1;
+ c->rep_prefix = REPE_PREFIX;
break;
default:
goto done_prefixes;