Commit 0004c7c2 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

KVM: Fix compound mmio

mmio_index should be taken into account when copying data from
userspace.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 4947e7cd
...@@ -5576,7 +5576,8 @@ static int complete_mmio(struct kvm_vcpu *vcpu) ...@@ -5576,7 +5576,8 @@ static int complete_mmio(struct kvm_vcpu *vcpu)
if (vcpu->mmio_needed) { if (vcpu->mmio_needed) {
vcpu->mmio_needed = 0; vcpu->mmio_needed = 0;
if (!vcpu->mmio_is_write) 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; vcpu->mmio_index += 8;
if (vcpu->mmio_index < vcpu->mmio_size) { if (vcpu->mmio_index < vcpu->mmio_size) {
run->exit_reason = KVM_EXIT_MMIO; run->exit_reason = KVM_EXIT_MMIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment