aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-03-15 10:38:28 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:15:45 -0400
commitd6d367d6783e38634377bc66b62bff3ffd717e5f (patch)
treedf3c4765336149622ce4255afede8c285a025907 /arch/x86/kvm
parent08e850c6536db302050c0287649e68e3bbdfe2c7 (diff)
KVM: x86 emulator: Fix DstAcc decoding.
Set correct operation length. Add RAX (64bit) handling. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 2832a8c07c6a..0b70a364f0f4 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1194,9 +1194,9 @@ done_prefixes:
1194 break; 1194 break;
1195 case DstAcc: 1195 case DstAcc:
1196 c->dst.type = OP_REG; 1196 c->dst.type = OP_REG;
1197 c->dst.bytes = c->op_bytes; 1197 c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
1198 c->dst.ptr = &c->regs[VCPU_REGS_RAX]; 1198 c->dst.ptr = &c->regs[VCPU_REGS_RAX];
1199 switch (c->op_bytes) { 1199 switch (c->dst.bytes) {
1200 case 1: 1200 case 1:
1201 c->dst.val = *(u8 *)c->dst.ptr; 1201 c->dst.val = *(u8 *)c->dst.ptr;
1202 break; 1202 break;
@@ -1206,6 +1206,9 @@ done_prefixes:
1206 case 4: 1206 case 4:
1207 c->dst.val = *(u32 *)c->dst.ptr; 1207 c->dst.val = *(u32 *)c->dst.ptr;
1208 break; 1208 break;
1209 case 8:
1210 c->dst.val = *(u64 *)c->dst.ptr;
1211 break;
1209 } 1212 }
1210 c->dst.orig_val = c->dst.val; 1213 c->dst.orig_val = c->dst.val;
1211 break; 1214 break;