mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
KVM: Fix dirty page log bitmap size/access calculation
Since dirty_bitmap is an unsigned long array, the alignment and size need to take that into account. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
ab51a434c5
commit
cd1a4a982a
1 changed files with 2 additions and 2 deletions
|
@ -792,9 +792,9 @@ static int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
|
|||
if (!memslot->dirty_bitmap)
|
||||
goto out;
|
||||
|
||||
n = ALIGN(memslot->npages, 8) / 8;
|
||||
n = ALIGN(memslot->npages, BITS_PER_LONG) / 8;
|
||||
|
||||
for (i = 0; !any && i < n; ++i)
|
||||
for (i = 0; !any && i < n/sizeof(long); ++i)
|
||||
any = memslot->dirty_bitmap[i];
|
||||
|
||||
r = -EFAULT;
|
||||
|
|
Loading…
Reference in a new issue