Lines Matching refs:rmap_head
909 struct kvm_rmap_head *rmap_head) in pte_list_add() argument
914 if (!rmap_head->val) { in pte_list_add()
916 rmap_head->val = (unsigned long)spte; in pte_list_add()
917 } else if (!(rmap_head->val & 1)) { in pte_list_add()
920 desc->sptes[0] = (u64 *)rmap_head->val; in pte_list_add()
923 rmap_head->val = (unsigned long)desc | 1; in pte_list_add()
927 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul); in pte_list_add()
945 pte_list_desc_remove_entry(struct kvm_rmap_head *rmap_head, in pte_list_desc_remove_entry() argument
957 rmap_head->val = 0; in pte_list_desc_remove_entry()
962 rmap_head->val = (unsigned long)desc->more | 1; in pte_list_desc_remove_entry()
966 static void __pte_list_remove(u64 *spte, struct kvm_rmap_head *rmap_head) in __pte_list_remove() argument
972 if (!rmap_head->val) { in __pte_list_remove()
975 } else if (!(rmap_head->val & 1)) { in __pte_list_remove()
977 if ((u64 *)rmap_head->val != spte) { in __pte_list_remove()
981 rmap_head->val = 0; in __pte_list_remove()
984 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul); in __pte_list_remove()
989 pte_list_desc_remove_entry(rmap_head, in __pte_list_remove()
1002 static void pte_list_remove(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in pte_list_remove() argument
1006 __pte_list_remove(sptep, rmap_head); in pte_list_remove()
1010 static bool pte_list_destroy(struct kvm *kvm, struct kvm_rmap_head *rmap_head) in pte_list_destroy() argument
1015 if (!rmap_head->val) in pte_list_destroy()
1018 if (!(rmap_head->val & 1)) { in pte_list_destroy()
1019 mmu_spte_clear_track_bits(kvm, (u64 *)rmap_head->val); in pte_list_destroy()
1023 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul); in pte_list_destroy()
1033 rmap_head->val = 0; in pte_list_destroy()
1037 unsigned int pte_list_count(struct kvm_rmap_head *rmap_head) in pte_list_count() argument
1042 if (!rmap_head->val) in pte_list_count()
1044 else if (!(rmap_head->val & 1)) in pte_list_count()
1047 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul); in pte_list_count()
1080 struct kvm_rmap_head *rmap_head; in rmap_remove() local
1093 rmap_head = gfn_to_rmap(gfn, sp->role.level, slot); in rmap_remove()
1095 __pte_list_remove(spte, rmap_head); in rmap_remove()
1115 static u64 *rmap_get_first(struct kvm_rmap_head *rmap_head, in rmap_get_first() argument
1120 if (!rmap_head->val) in rmap_get_first()
1123 if (!(rmap_head->val & 1)) { in rmap_get_first()
1125 sptep = (u64 *)rmap_head->val; in rmap_get_first()
1129 iter->desc = (struct pte_list_desc *)(rmap_head->val & ~1ul); in rmap_get_first()
1235 struct kvm_rmap_head *rmap_head, in __rmap_write_protect() argument
1242 for_each_rmap_spte(rmap_head, &iter, sptep) in __rmap_write_protect()
1275 static bool __rmap_clear_dirty(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in __rmap_clear_dirty() argument
1282 for_each_rmap_spte(rmap_head, &iter, sptep) in __rmap_clear_dirty()
1304 struct kvm_rmap_head *rmap_head; in kvm_mmu_write_protect_pt_masked() local
1314 rmap_head = gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask), in kvm_mmu_write_protect_pt_masked()
1316 __rmap_write_protect(kvm, rmap_head, false); in kvm_mmu_write_protect_pt_masked()
1337 struct kvm_rmap_head *rmap_head; in kvm_mmu_clear_dirty_pt_masked() local
1347 rmap_head = gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask), in kvm_mmu_clear_dirty_pt_masked()
1349 __rmap_clear_dirty(kvm, rmap_head, slot); in kvm_mmu_clear_dirty_pt_masked()
1408 struct kvm_rmap_head *rmap_head; in kvm_mmu_slot_gfn_write_protect() local
1414 rmap_head = gfn_to_rmap(gfn, i, slot); in kvm_mmu_slot_gfn_write_protect()
1415 write_protected |= __rmap_write_protect(kvm, rmap_head, true); in kvm_mmu_slot_gfn_write_protect()
1434 static bool kvm_zap_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in kvm_zap_rmapp() argument
1437 return pte_list_destroy(kvm, rmap_head); in kvm_zap_rmapp()
1440 static bool kvm_unmap_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in kvm_unmap_rmapp() argument
1444 return kvm_zap_rmapp(kvm, rmap_head, slot); in kvm_unmap_rmapp()
1447 static bool kvm_set_pte_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in kvm_set_pte_rmapp() argument
1461 for_each_rmap_spte(rmap_head, &iter, sptep) { in kvm_set_pte_rmapp()
1468 pte_list_remove(kvm, rmap_head, sptep); in kvm_set_pte_rmapp()
1554 typedef bool (*rmap_handler_t)(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1599 static bool kvm_age_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in kvm_age_rmapp() argument
1607 for_each_rmap_spte(rmap_head, &iter, sptep) in kvm_age_rmapp()
1613 static bool kvm_test_age_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head, in kvm_test_age_rmapp() argument
1620 for_each_rmap_spte(rmap_head, &iter, sptep) in kvm_test_age_rmapp()
1632 struct kvm_rmap_head *rmap_head; in rmap_add() local
1638 rmap_head = gfn_to_rmap(gfn, sp->role.level, slot); in rmap_add()
1639 rmap_count = pte_list_add(vcpu, spte, rmap_head); in rmap_add()
1642 kvm_unmap_rmapp(vcpu->kvm, rmap_head, NULL, gfn, sp->role.level, __pte(0)); in rmap_add()
5440 struct kvm_rmap_head *rmap_head,
5782 struct kvm_rmap_head *rmap_head, in slot_rmap_write_protect() argument
5785 return __rmap_write_protect(kvm, rmap_head, false); in slot_rmap_write_protect()
5824 struct kvm_rmap_head *rmap_head, in kvm_mmu_zap_collapsible_spte() argument
5834 for_each_rmap_spte(rmap_head, &iter, sptep) { in kvm_mmu_zap_collapsible_spte()
5848 pte_list_remove(kvm, rmap_head, sptep); in kvm_mmu_zap_collapsible_spte()