]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: fix the handling of dirty bitmaps to avoid overflows
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Mon, 12 Apr 2010 10:35:35 +0000 (19:35 +0900)
committerAvi Kivity <avi@redhat.com>
Tue, 20 Apr 2010 10:06:55 +0000 (13:06 +0300)
commit5f006abfe449a1f6584d08bab415dfc0086a84fb
treeae8ce63cecab98c036c0d76422de42cf78e042f4
parent53a1b02a961831ed868587c85e427a03e7181b5d
KVM: fix the handling of dirty bitmaps to avoid overflows

Int is not long enough to store the size of a dirty bitmap.

This patch fixes this problem with the introduction of a wrapper
function to calculate the sizes of dirty bitmaps.

Note: in mark_page_dirty(), we have to consider the fact that
  __set_bit() takes the offset as int, not long.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/ia64/kvm/kvm-ia64.c
arch/powerpc/kvm/book3s.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c