diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2012-03-01 05:34:45 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-04-08 05:50:01 -0400 |
commit | 93474b25af1eabf5b14743793156e8d307bfcd6b (patch) | |
tree | a670a601bc0f470e95d38b84a77b0de79735b491 /virt/kvm | |
parent | 60c34612b70711fb14a8dcbc6a79509902450d2e (diff) |
KVM: Remove unused dirty_bitmap_head and nr_dirty_pages
Now that we do neither double buffering nor heuristic selection of the
write protection method these are not needed anymore.
Note: some drivers have their own implementation of set_bit_le() and
making it generic needs a bit of work; so we use test_and_set_bit_le()
and will later replace it with generic set_bit_le().
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/kvm_main.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a612bc8c921c..6bd34a6ecca1 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -522,12 +522,11 @@ static void kvm_destroy_dirty_bitmap(struct kvm_memory_slot *memslot) | |||
522 | return; | 522 | return; |
523 | 523 | ||
524 | if (2 * kvm_dirty_bitmap_bytes(memslot) > PAGE_SIZE) | 524 | if (2 * kvm_dirty_bitmap_bytes(memslot) > PAGE_SIZE) |
525 | vfree(memslot->dirty_bitmap_head); | 525 | vfree(memslot->dirty_bitmap); |
526 | else | 526 | else |
527 | kfree(memslot->dirty_bitmap_head); | 527 | kfree(memslot->dirty_bitmap); |
528 | 528 | ||
529 | memslot->dirty_bitmap = NULL; | 529 | memslot->dirty_bitmap = NULL; |
530 | memslot->dirty_bitmap_head = NULL; | ||
531 | } | 530 | } |
532 | 531 | ||
533 | /* | 532 | /* |
@@ -611,8 +610,7 @@ static int kvm_vm_release(struct inode *inode, struct file *filp) | |||
611 | 610 | ||
612 | /* | 611 | /* |
613 | * Allocation size is twice as large as the actual dirty bitmap size. | 612 | * Allocation size is twice as large as the actual dirty bitmap size. |
614 | * This makes it possible to do double buffering: see x86's | 613 | * See x86's kvm_vm_ioctl_get_dirty_log() why this is needed. |
615 | * kvm_vm_ioctl_get_dirty_log(). | ||
616 | */ | 614 | */ |
617 | static int kvm_create_dirty_bitmap(struct kvm_memory_slot *memslot) | 615 | static int kvm_create_dirty_bitmap(struct kvm_memory_slot *memslot) |
618 | { | 616 | { |
@@ -627,8 +625,6 @@ static int kvm_create_dirty_bitmap(struct kvm_memory_slot *memslot) | |||
627 | if (!memslot->dirty_bitmap) | 625 | if (!memslot->dirty_bitmap) |
628 | return -ENOMEM; | 626 | return -ENOMEM; |
629 | 627 | ||
630 | memslot->dirty_bitmap_head = memslot->dirty_bitmap; | ||
631 | memslot->nr_dirty_pages = 0; | ||
632 | #endif /* !CONFIG_S390 */ | 628 | #endif /* !CONFIG_S390 */ |
633 | return 0; | 629 | return 0; |
634 | } | 630 | } |
@@ -1476,8 +1472,8 @@ void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot, | |||
1476 | if (memslot && memslot->dirty_bitmap) { | 1472 | if (memslot && memslot->dirty_bitmap) { |
1477 | unsigned long rel_gfn = gfn - memslot->base_gfn; | 1473 | unsigned long rel_gfn = gfn - memslot->base_gfn; |
1478 | 1474 | ||
1479 | if (!test_and_set_bit_le(rel_gfn, memslot->dirty_bitmap)) | 1475 | /* TODO: introduce set_bit_le() and use it */ |
1480 | memslot->nr_dirty_pages++; | 1476 | test_and_set_bit_le(rel_gfn, memslot->dirty_bitmap); |
1481 | } | 1477 | } |
1482 | } | 1478 | } |
1483 | 1479 | ||