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>

authored by Uri Lublin and committed by Avi Kivity cd1a4a98 ab51a434

+2 -2
+2 -2
drivers/kvm/kvm_main.c
··· 792 if (!memslot->dirty_bitmap) 793 goto out; 794 795 - n = ALIGN(memslot->npages, 8) / 8; 796 797 - for (i = 0; !any && i < n; ++i) 798 any = memslot->dirty_bitmap[i]; 799 800 r = -EFAULT;
··· 792 if (!memslot->dirty_bitmap) 793 goto out; 794 795 + n = ALIGN(memslot->npages, BITS_PER_LONG) / 8; 796 797 + for (i = 0; !any && i < n/sizeof(long); ++i) 798 any = memslot->dirty_bitmap[i]; 799 800 r = -EFAULT;