Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cd1a4a982a78e793125db2f386e91dc7c89c9ed1
Commit:     cd1a4a982a78e793125db2f386e91dc7c89c9ed1
Parent:     ab51a434c5816e1ca3f033791c1cc5c6594998ec
Author:     Uri Lublin <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 22 16:43:09 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Sun Mar 4 11:12:42 2007 +0200

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index edff405..e710810 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to