]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: x86 emulator: Update c->dst.bytes in decode instruction
authorGuillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Tue, 27 May 2008 08:22:20 +0000 (10:22 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 20 Jul 2008 09:42:27 +0000 (12:42 +0300)
Update c->dst.bytes in decode instruction instead of instruction
itself.  It's needed because if c->dst.bytes is equal to 0, the
instruction is not emulated.

Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Signed-off-by: Laurent Vivier <laurent.vivier@bull.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/x86_emulate.c

index 932f216d890c343bc5ca4ebfd8a15e1955334969..a928aa6cdad2fb5f4e606423f261903bf7d9cd98 100644 (file)
@@ -1049,6 +1049,7 @@ done_prefixes:
                break;
        case DstMem:
                if ((c->d & ModRM) && c->modrm_mod == 3) {
+                       c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
                        c->dst.type = OP_REG;
                        c->dst.val = c->dst.orig_val = c->modrm_val;
                        c->dst.ptr = c->modrm_ptr;