diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-03-15 16:38:28 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 12:15:45 +0300 |
commit | d6d367d6783e38634377bc66b62bff3ffd717e5f (patch) | |
tree | df3c4765336149622ce4255afede8c285a025907 /arch | |
parent | 08e850c6536db302050c0287649e68e3bbdfe2c7 (diff) | |
download | linux-stable-d6d367d6783e38634377bc66b62bff3ffd717e5f.tar.gz linux-stable-d6d367d6783e38634377bc66b62bff3ffd717e5f.tar.bz2 linux-stable-d6d367d6783e38634377bc66b62bff3ffd717e5f.zip |
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')
-rw-r--r-- | arch/x86/kvm/emulate.c | 7 |
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: break; case DstAcc: c->dst.type = OP_REG; - c->dst.bytes = c->op_bytes; + c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; c->dst.ptr = &c->regs[VCPU_REGS_RAX]; - switch (c->op_bytes) { + switch (c->dst.bytes) { case 1: c->dst.val = *(u8 *)c->dst.ptr; break; @@ -1206,6 +1206,9 @@ done_prefixes: case 4: c->dst.val = *(u32 *)c->dst.ptr; break; + case 8: + c->dst.val = *(u64 *)c->dst.ptr; + break; } c->dst.orig_val = c->dst.val; break; |