Lines Matching defs:rmap_head
826 * About rmap_head encoding:
828 * If the bit zero of rmap_head->val is clear, then it points to the only spte
829 * in this rmap chain. Otherwise, (rmap_head->val & ~1) points to a struct
837 struct kvm_rmap_head *rmap_head)
842 if (!rmap_head->val) {
844 rmap_head->val = (unsigned long)spte;
845 } else if (!(rmap_head->val & 1)) {
848 desc->sptes[0] = (u64 *)rmap_head->val;
850 rmap_head->val = (unsigned long)desc | 1;
854 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
873 pte_list_desc_remove_entry(struct kvm_rmap_head *rmap_head,
886 rmap_head->val = 0;
891 rmap_head->val = (unsigned long)desc->more | 1;
895 static void __pte_list_remove(u64 *spte, struct kvm_rmap_head *rmap_head)
901 if (!rmap_head->val) {
904 } else if (!(rmap_head->val & 1)) {
906 if ((u64 *)rmap_head->val != spte) {
910 rmap_head->val = 0;
913 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
918 pte_list_desc_remove_entry(rmap_head,
931 static void pte_list_remove(struct kvm_rmap_head *rmap_head, u64 *sptep)
934 __pte_list_remove(sptep, rmap_head);
968 struct kvm_rmap_head *rmap_head;
972 rmap_head = gfn_to_rmap(vcpu->kvm, gfn, sp);
973 return pte_list_add(vcpu, spte, rmap_head);
980 struct kvm_rmap_head *rmap_head;
984 rmap_head = gfn_to_rmap(kvm, gfn, sp);
985 __pte_list_remove(spte, rmap_head);
1005 static u64 *rmap_get_first(struct kvm_rmap_head *rmap_head,
1010 if (!rmap_head->val)
1013 if (!(rmap_head->val & 1)) {
1015 sptep = (u64 *)rmap_head->val;
1019 iter->desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
1124 struct kvm_rmap_head *rmap_head,
1131 for_each_rmap_spte(rmap_head, &iter, sptep)
1164 static bool __rmap_clear_dirty(struct kvm *kvm, struct kvm_rmap_head *rmap_head)
1170 for_each_rmap_spte(rmap_head, &iter, sptep)
1195 static bool __rmap_set_dirty(struct kvm *kvm, struct kvm_rmap_head *rmap_head)
1201 for_each_rmap_spte(rmap_head, &iter, sptep)
1222 struct kvm_rmap_head *rmap_head;
1228 rmap_head = __gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask),
1230 __rmap_write_protect(kvm, rmap_head, false);
1251 struct kvm_rmap_head *rmap_head;
1257 rmap_head = __gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask),
1259 __rmap_clear_dirty(kvm, rmap_head);
1291 struct kvm_rmap_head *rmap_head;
1296 rmap_head = __gfn_to_rmap(gfn, i, slot);
1297 write_protected |= __rmap_write_protect(kvm, rmap_head, true);
1315 static bool kvm_zap_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head)
1321 while ((sptep = rmap_get_first(rmap_head, &iter))) {
1324 pte_list_remove(rmap_head, sptep);
1331 static int kvm_unmap_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1335 return kvm_zap_rmapp(kvm, rmap_head);
1338 static int kvm_set_pte_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1353 for_each_rmap_spte(rmap_head, &iter, sptep) {
1360 pte_list_remove(rmap_head, sptep);
1452 struct kvm_rmap_head *rmap_head,
1497 struct kvm_rmap_head *rmap_head,
1530 static int kvm_age_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1538 for_each_rmap_spte(rmap_head, &iter, sptep)
1545 static int kvm_test_age_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1552 for_each_rmap_spte(rmap_head, &iter, sptep)
1562 struct kvm_rmap_head *rmap_head;
1567 rmap_head = gfn_to_rmap(vcpu->kvm, gfn, sp);
1569 kvm_unmap_rmapp(vcpu->kvm, rmap_head, NULL, gfn, sp->role.level, 0);
5231 typedef bool (*slot_level_handler) (struct kvm *kvm, struct kvm_rmap_head *rmap_head);
5538 struct kvm_rmap_head *rmap_head)
5540 return __rmap_write_protect(kvm, rmap_head, false);
5572 struct kvm_rmap_head *rmap_head)
5581 for_each_rmap_spte(rmap_head, &iter, sptep) {
5595 pte_list_remove(rmap_head, sptep);