r = 0;
@@ -1195,11 +1232,16 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
        gfn = unalias_gfn(kvm, gfn);
        memslot = gfn_to_memslot_unaliased(kvm, gfn);
        if (memslot&&  memslot->dirty_bitmap) {
-               unsigned long rel_gfn = gfn - memslot->base_gfn;
+               int nr = generic_le_bit_offset(gfn - memslot->base_gfn);

-               generic___set_le_bit(rel_gfn, memslot->dirty_bitmap);
+               if (kvm_set_bit_user(nr, memslot->dirty_bitmap))
+                       goto out_fault;

mark_page_dirty is called with the mmu_lock spinlock held in set_spte.
Must find a way to move it outside of the spinlock section.


Oh, it's a serious problem. I have to consider it.


Thanks,
  Takuya
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to