Lines Matching defs:rmap_head

917  * About rmap_head encoding:
919 * If the bit zero of rmap_head->val is clear, then it points to the only spte
920 * in this rmap chain. Otherwise, (rmap_head->val & ~1) points to a struct
928 struct kvm_rmap_head *rmap_head)
933 if (!rmap_head->val) {
934 rmap_head->val = (unsigned long)spte;
935 } else if (!(rmap_head->val & 1)) {
937 desc->sptes[0] = (u64 *)rmap_head->val;
941 rmap_head->val = (unsigned long)desc | 1;
944 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
953 desc->more = (struct pte_list_desc *)(rmap_head->val & ~1ul);
956 rmap_head->val = (unsigned long)desc | 1;
964 struct kvm_rmap_head *rmap_head,
967 struct pte_list_desc *head_desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
994 rmap_head->val = 0;
996 rmap_head->val = (unsigned long)head_desc->more | 1;
1001 struct kvm_rmap_head *rmap_head)
1006 if (KVM_BUG_ON_DATA_CORRUPTION(!rmap_head->val, kvm))
1009 if (!(rmap_head->val & 1)) {
1010 if (KVM_BUG_ON_DATA_CORRUPTION((u64 *)rmap_head->val != spte, kvm))
1013 rmap_head->val = 0;
1015 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
1019 pte_list_desc_remove_entry(kvm, rmap_head,
1032 struct kvm_rmap_head *rmap_head, u64 *sptep)
1035 pte_list_remove(kvm, sptep, rmap_head);
1040 struct kvm_rmap_head *rmap_head)
1045 if (!rmap_head->val)
1048 if (!(rmap_head->val & 1)) {
1049 mmu_spte_clear_track_bits(kvm, (u64 *)rmap_head->val);
1053 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
1062 /* rmap_head is meaningless now, remember to reset it */
1063 rmap_head->val = 0;
1067 unsigned int pte_list_count(struct kvm_rmap_head *rmap_head)
1071 if (!rmap_head->val)
1073 else if (!(rmap_head->val & 1))
1076 desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
1095 struct kvm_rmap_head *rmap_head;
1108 rmap_head = gfn_to_rmap(gfn, sp->role.level, slot);
1110 pte_list_remove(kvm, spte, rmap_head);
1130 static u64 *rmap_get_first(struct kvm_rmap_head *rmap_head,
1135 if (!rmap_head->val)
1138 if (!(rmap_head->val & 1)) {
1140 sptep = (u64 *)rmap_head->val;
1144 iter->desc = (struct pte_list_desc *)(rmap_head->val & ~1ul);
1238 static bool rmap_write_protect(struct kvm_rmap_head *rmap_head,
1245 for_each_rmap_spte(rmap_head, &iter, sptep)
1276 static bool __rmap_clear_dirty(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1283 for_each_rmap_spte(rmap_head, &iter, sptep)
1305 struct kvm_rmap_head *rmap_head;
1315 rmap_head = gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask),
1317 rmap_write_protect(rmap_head, false);
1338 struct kvm_rmap_head *rmap_head;
1348 rmap_head = gfn_to_rmap(slot->base_gfn + gfn_offset + __ffs(mask),
1350 __rmap_clear_dirty(kvm, rmap_head, slot);
1412 struct kvm_rmap_head *rmap_head;
1418 rmap_head = gfn_to_rmap(gfn, i, slot);
1419 write_protected |= rmap_write_protect(rmap_head, true);
1438 static bool __kvm_zap_rmap(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1441 return kvm_zap_all_rmap_sptes(kvm, rmap_head);
1444 static bool kvm_zap_rmap(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1448 return __kvm_zap_rmap(kvm, rmap_head, slot);
1451 static bool kvm_set_pte_rmap(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1465 for_each_rmap_spte(rmap_head, &iter, sptep) {
1469 kvm_zap_one_rmap_spte(kvm, rmap_head, sptep);
1557 typedef bool (*rmap_handler_t)(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1606 static bool kvm_age_rmap(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1614 for_each_rmap_spte(rmap_head, &iter, sptep)
1620 static bool kvm_test_age_rmap(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
1627 for_each_rmap_spte(rmap_head, &iter, sptep)
1641 struct kvm_rmap_head *rmap_head;
1648 rmap_head = gfn_to_rmap(gfn, sp->role.level, slot);
1649 rmap_count = pte_list_add(cache, spte, rmap_head);
1654 kvm_zap_all_rmap_sptes(kvm, rmap_head);
5906 struct kvm_rmap_head *rmap_head,
6264 struct kvm_rmap_head *rmap_head,
6267 return rmap_write_protect(rmap_head, false);
6454 struct kvm_rmap_head *rmap_head,
6463 for_each_rmap_spte(rmap_head, &iter, huge_sptep) {
6569 struct kvm_rmap_head *rmap_head,
6578 for_each_rmap_spte(rmap_head, &iter, sptep) {
6591 kvm_zap_one_rmap_spte(kvm, rmap_head, sptep);