Skip to content

Commit

Permalink
KVM: Fix compound mmio
Browse files Browse the repository at this point in the history
mmio_index should be taken into account when copying data from
userspace.

Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
Gleb Natapov authored and avikivity committed May 22, 2011
1 parent 4947e7c commit 0004c7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0004c7c

Please sign in to comment.