Lines Matching refs:slot
29 void kvm_page_track_free_memslot(struct kvm_memory_slot *slot) in kvm_page_track_free_memslot() argument
31 kvfree(slot->arch.gfn_write_track); in kvm_page_track_free_memslot()
32 slot->arch.gfn_write_track = NULL; in kvm_page_track_free_memslot()
35 static int __kvm_page_track_write_tracking_alloc(struct kvm_memory_slot *slot, in __kvm_page_track_write_tracking_alloc() argument
38 const size_t size = sizeof(*slot->arch.gfn_write_track); in __kvm_page_track_write_tracking_alloc()
40 if (!slot->arch.gfn_write_track) in __kvm_page_track_write_tracking_alloc()
41 slot->arch.gfn_write_track = __vcalloc(npages, size, in __kvm_page_track_write_tracking_alloc()
44 return slot->arch.gfn_write_track ? 0 : -ENOMEM; in __kvm_page_track_write_tracking_alloc()
48 struct kvm_memory_slot *slot, in kvm_page_track_create_memslot() argument
54 return __kvm_page_track_write_tracking_alloc(slot, npages); in kvm_page_track_create_memslot()
57 int kvm_page_track_write_tracking_alloc(struct kvm_memory_slot *slot) in kvm_page_track_write_tracking_alloc() argument
59 return __kvm_page_track_write_tracking_alloc(slot, slot->npages); in kvm_page_track_write_tracking_alloc()
62 static void update_gfn_write_track(struct kvm_memory_slot *slot, gfn_t gfn, in update_gfn_write_track() argument
67 index = gfn_to_index(gfn, slot->base_gfn, PG_LEVEL_4K); in update_gfn_write_track()
69 val = slot->arch.gfn_write_track[index]; in update_gfn_write_track()
74 slot->arch.gfn_write_track[index] += count; in update_gfn_write_track()
77 void __kvm_write_track_add_gfn(struct kvm *kvm, struct kvm_memory_slot *slot, in __kvm_write_track_add_gfn() argument
88 update_gfn_write_track(slot, gfn, 1); in __kvm_write_track_add_gfn()
94 kvm_mmu_gfn_disallow_lpage(slot, gfn); in __kvm_write_track_add_gfn()
96 if (kvm_mmu_slot_gfn_write_protect(kvm, slot, gfn, PG_LEVEL_4K)) in __kvm_write_track_add_gfn()
101 struct kvm_memory_slot *slot, gfn_t gfn) in __kvm_write_track_remove_gfn() argument
111 update_gfn_write_track(slot, gfn, -1); in __kvm_write_track_remove_gfn()
117 kvm_mmu_gfn_allow_lpage(slot, gfn); in __kvm_write_track_remove_gfn()
124 const struct kvm_memory_slot *slot, gfn_t gfn) in kvm_gfn_is_write_tracked() argument
128 if (!slot) in kvm_gfn_is_write_tracked()
134 index = gfn_to_index(gfn, slot->base_gfn, PG_LEVEL_4K); in kvm_gfn_is_write_tracked()
135 return !!READ_ONCE(slot->arch.gfn_write_track[index]); in kvm_gfn_is_write_tracked()
229 void kvm_page_track_delete_slot(struct kvm *kvm, struct kvm_memory_slot *slot) in kvm_page_track_delete_slot() argument
244 n->track_remove_region(slot->base_gfn, slot->npages, n); in kvm_page_track_delete_slot()
257 struct kvm_memory_slot *slot; in kvm_write_track_add_gfn() local
262 slot = gfn_to_memslot(kvm, gfn); in kvm_write_track_add_gfn()
263 if (!slot) { in kvm_write_track_add_gfn()
269 __kvm_write_track_add_gfn(kvm, slot, gfn); in kvm_write_track_add_gfn()
287 struct kvm_memory_slot *slot; in kvm_write_track_remove_gfn() local
292 slot = gfn_to_memslot(kvm, gfn); in kvm_write_track_remove_gfn()
293 if (!slot) { in kvm_write_track_remove_gfn()
299 __kvm_write_track_remove_gfn(kvm, slot, gfn); in kvm_write_track_remove_gfn()