Lines Matching refs:slot

42 void kvm_page_track_free_memslot(struct kvm_memory_slot *slot)  in kvm_page_track_free_memslot()  argument
44 vfree(slot->arch.gfn_write_track); in kvm_page_track_free_memslot()
45 slot->arch.gfn_write_track = NULL; in kvm_page_track_free_memslot()
48 static int __kvm_page_track_write_tracking_alloc(struct kvm_memory_slot *slot, in __kvm_page_track_write_tracking_alloc() argument
51 const size_t size = sizeof(*slot->arch.gfn_write_track); in __kvm_page_track_write_tracking_alloc()
53 if (!slot->arch.gfn_write_track) in __kvm_page_track_write_tracking_alloc()
54 slot->arch.gfn_write_track = __vcalloc(npages, size, in __kvm_page_track_write_tracking_alloc()
57 return slot->arch.gfn_write_track ? 0 : -ENOMEM; in __kvm_page_track_write_tracking_alloc()
61 struct kvm_memory_slot *slot, in kvm_page_track_create_memslot() argument
67 return __kvm_page_track_write_tracking_alloc(slot, npages); in kvm_page_track_create_memslot()
70 int kvm_page_track_write_tracking_alloc(struct kvm_memory_slot *slot) in kvm_page_track_write_tracking_alloc() argument
72 return __kvm_page_track_write_tracking_alloc(slot, slot->npages); in kvm_page_track_write_tracking_alloc()
75 static void update_gfn_write_track(struct kvm_memory_slot *slot, gfn_t gfn, in update_gfn_write_track() argument
80 index = gfn_to_index(gfn, slot->base_gfn, PG_LEVEL_4K); in update_gfn_write_track()
82 val = slot->arch.gfn_write_track[index]; in update_gfn_write_track()
87 slot->arch.gfn_write_track[index] += count; in update_gfn_write_track()
90 void __kvm_write_track_add_gfn(struct kvm *kvm, struct kvm_memory_slot *slot, in __kvm_write_track_add_gfn() argument
101 update_gfn_write_track(slot, gfn, 1); in __kvm_write_track_add_gfn()
107 kvm_mmu_gfn_disallow_lpage(slot, gfn); in __kvm_write_track_add_gfn()
109 if (kvm_mmu_slot_gfn_write_protect(kvm, slot, gfn, PG_LEVEL_4K)) in __kvm_write_track_add_gfn()
114 struct kvm_memory_slot *slot, gfn_t gfn) in __kvm_write_track_remove_gfn() argument
124 update_gfn_write_track(slot, gfn, -1); in __kvm_write_track_remove_gfn()
130 kvm_mmu_gfn_allow_lpage(slot, gfn); in __kvm_write_track_remove_gfn()
137 const struct kvm_memory_slot *slot, gfn_t gfn) in kvm_gfn_is_write_tracked() argument
141 if (!slot) in kvm_gfn_is_write_tracked()
147 index = gfn_to_index(gfn, slot->base_gfn, PG_LEVEL_4K); in kvm_gfn_is_write_tracked()
148 return !!READ_ONCE(slot->arch.gfn_write_track[index]); in kvm_gfn_is_write_tracked()
172 struct kvm_memory_slot *slot; in kvm_enable_external_write_tracking() local
187 kvm_for_each_memslot(slot, bkt, slots) { in kvm_enable_external_write_tracking()
196 r = kvm_page_track_write_tracking_alloc(slot); in kvm_enable_external_write_tracking()
293 void kvm_page_track_delete_slot(struct kvm *kvm, struct kvm_memory_slot *slot) in kvm_page_track_delete_slot() argument
308 n->track_remove_region(slot->base_gfn, slot->npages, n); in kvm_page_track_delete_slot()
321 struct kvm_memory_slot *slot; in kvm_write_track_add_gfn() local
326 slot = gfn_to_memslot(kvm, gfn); in kvm_write_track_add_gfn()
327 if (!slot) { in kvm_write_track_add_gfn()
333 __kvm_write_track_add_gfn(kvm, slot, gfn); in kvm_write_track_add_gfn()
351 struct kvm_memory_slot *slot; in kvm_write_track_remove_gfn() local
356 slot = gfn_to_memslot(kvm, gfn); in kvm_write_track_remove_gfn()
357 if (!slot) { in kvm_write_track_remove_gfn()
363 __kvm_write_track_remove_gfn(kvm, slot, gfn); in kvm_write_track_remove_gfn()