Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372101
b: refs/heads/master
c: f42798c
h: refs/heads/master
i:
  372099: d1f4473
v: v3
  • Loading branch information
Marc Zyngier authored and Christoffer Dall committed Mar 7, 2013
1 parent b4b46db commit e159633
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 000d399625b4b302935508f2fc9ce93ff1bd1ba4
refs/heads/master: f42798c6898bf1e536673e798d263e492355162f
7 changes: 4 additions & 3 deletions trunk/arch/arm/kvm/mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)

if (!run->mmio.is_write) {
dest = vcpu_reg(vcpu, vcpu->arch.mmio_decode.rt);
memset(dest, 0, sizeof(int));
*dest = 0;

len = run->mmio.len;
if (len > 4)
if (len > sizeof(unsigned long))
return -EINVAL;

memcpy(dest, run->mmio.data, len);

trace_kvm_mmio(KVM_TRACE_MMIO_READ, len, run->mmio.phys_addr,
*((u64 *)run->mmio.data));

if (vcpu->arch.mmio_decode.sign_extend && len < 4) {
if (vcpu->arch.mmio_decode.sign_extend &&
len < sizeof(unsigned long)) {
mask = 1U << ((len * 8) - 1);
*dest = (*dest ^ mask) - mask;
}
Expand Down

0 comments on commit e159633

Please sign in to comment.