summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86_emulate.c
diff options
context:
space:
mode:
authorAvi Kivity2008-04-14 22:27:07 +0200
committerAvi Kivity2008-04-27 17:21:33 +0200
commit66b85505736dbd3a3a0ed5ae38c12bb218b231c0 (patch)
tree1515cb412b64efc4b45db4e861943f211f8688f2 /arch/x86/kvm/x86_emulate.c
parentKVM: SVM: force a new asid when initializing the vmcb (diff)
downloadkernel-qcow2-linux-66b85505736dbd3a3a0ed5ae38c12bb218b231c0.tar.gz
kernel-qcow2-linux-66b85505736dbd3a3a0ed5ae38c12bb218b231c0.tar.xz
kernel-qcow2-linux-66b85505736dbd3a3a0ed5ae38c12bb218b231c0.zip
KVM: x86 emulator: initialize src.val and dst.val for register operands
This lets us treat the case where mod == 3 in the same manner as other cases. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/x86_emulate.c')
-rw-r--r--arch/x86/kvm/x86_emulate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index f59ed93f5d24..8e1b32f2cd5e 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -1001,6 +1001,7 @@ done_prefixes:
*/
if ((c->d & ModRM) && c->modrm_mod == 3) {
c->src.type = OP_REG;
+ c->src.val = c->modrm_val;
break;
}
c->src.type = OP_MEM;
@@ -1044,6 +1045,7 @@ done_prefixes:
case DstMem:
if ((c->d & ModRM) && c->modrm_mod == 3) {
c->dst.type = OP_REG;
+ c->dst.val = c->dst.orig_val = c->modrm_val;
break;
}
c->dst.type = OP_MEM;