diff options
author | Gleb Natapov <gleb@redhat.com> | 2011-04-12 12:36:24 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:39:52 -0400 |
commit | 0004c7c25757f103ddb3a9e4bcfd533aad41f9a0 (patch) | |
tree | 9960053fb6ee584744cda342bcaa86dc806277b1 /arch | |
parent | 4947e7cd0ee36e1aa37dfec4f7fa71cc64a2f0fd (diff) | |
download | op-kernel-dev-0004c7c25757f103ddb3a9e4bcfd533aad41f9a0.zip op-kernel-dev-0004c7c25757f103ddb3a9e4bcfd533aad41f9a0.tar.gz |
KVM: Fix compound mmio
mmio_index should be taken into account when copying data from
userspace.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e3ac212..a9a307a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5576,7 +5576,8 @@ static int complete_mmio(struct kvm_vcpu *vcpu) if (vcpu->mmio_needed) { vcpu->mmio_needed = 0; if (!vcpu->mmio_is_write) - memcpy(vcpu->mmio_data, run->mmio.data, 8); + memcpy(vcpu->mmio_data + vcpu->mmio_index, + run->mmio.data, 8); vcpu->mmio_index += 8; if (vcpu->mmio_index < vcpu->mmio_size) { run->exit_reason = KVM_EXIT_MMIO; |