Lines Matching defs:slot
588 struct kvm_memory_slot *slot;
610 slot = container_of(node, struct kvm_memory_slot, hva_node[slots->node_idx]);
611 hva_start = max(range->start, slot->userspace_addr);
612 hva_end = min(range->end, slot->userspace_addr +
613 (slot->npages << PAGE_SHIFT));
628 gfn_range.start = hva_to_gfn_memslot(hva_start, slot);
629 gfn_range.end = hva_to_gfn_memslot(hva_end + PAGE_SIZE - 1, slot);
630 gfn_range.slot = slot;
710 if (range->slot->flags & KVM_MEMSLOT_INVALID)
987 /* This does not remove the slot from struct kvm_memslots data structures */
988 static void kvm_free_memslot(struct kvm *kvm, struct kvm_memory_slot *slot)
990 kvm_destroy_dirty_bitmap(slot);
992 kvm_arch_free_memslot(kvm, slot);
994 kfree(slot);
1444 struct kvm_memory_slot *slot)
1456 if (slot->base_gfn < tmp->base_gfn)
1458 else if (slot->base_gfn > tmp->base_gfn)
1464 rb_link_node(&slot->gfn_node[idx], parent, node);
1465 rb_insert_color(&slot->gfn_node[idx], gfn_tree);
1469 struct kvm_memory_slot *slot)
1471 rb_erase(&slot->gfn_node[slots->node_idx], &slots->gfn_tree);
1518 * slot, kvm_copy_memslot() deliberately does not touch node data.
1527 * change when replacing an existing slot.
1700 * The final quirk. Free the detached, old slot, but only its
1750 * Mark the current slot INVALID. As with all memslot modifications,
1751 * this must be done on an unreachable slot to avoid modifying the
1752 * current slot in the active tree.
1759 * Activate the slot that is now marked INVALID, but don't propagate
1760 * the slot to the now inactive slots. The slot is either going to be
1761 * deleted or recreated as a new slot.
1778 * Copy the arch-specific field of the newly-installed slot back to the
1779 * old slot as the arch data could have changed between releasing
1782 * slots_arch_lock, thus the active slot's data is guaranteed to be fresh.
1801 * the "new" slot, and for the invalid version in the active slots.
1825 * Similar to the MOVE case, but the slot doesn't need to be zapped as
1858 * Invalidate the old slot if it's being deleted or moved. This is
1866 * Modifications are done on a temporary, unreachable slot. The old
1867 * slot needs to be preserved in case a later step fails and the
1883 * modifications required since the original slot was preserved
1897 * For DELETE and MOVE, the working slot is now active as the INVALID
1898 * version of the old slot. MOVE is particularly special as it reuses
1899 * the old slot and returns a copy of the old slot (in working_slot).
1900 * For CREATE, there is no old slot. For DELETE and FLAGS_ONLY, the
1901 * old slot is detached but otherwise preserved.
1914 /* Free the temporary INVALID slot used for DELETE and MOVE. */
1934 if (iter.slot->id != id)
1964 as_id = mem->slot >> 16;
1965 id = (u16)mem->slot;
2016 } else { /* Modify an existing slot. */
2034 /* Allocate a slot that will persist in the memslot. */
2068 if ((u16)mem->slot >= KVM_USER_MEM_SLOTS)
2078 * @log: slot id and address to which we copy the log
2097 as_id = log->slot >> 16;
2098 id = (u16)log->slot;
2128 * @log: slot id and address to which we copy the log
2159 as_id = log->slot >> 16;
2160 id = (u16)log->slot;
2218 * kvm_vm_ioctl_get_dirty_log - get and clear the log of dirty pages in a slot
2220 * @log: slot id and address to which we copy the log
2253 * @log: slot id and address from which to fetch the bitmap of dirty pages
2271 as_id = log->slot >> 16;
2272 id = (u16)log->slot;
2355 struct kvm_memory_slot *slot;
2366 slot = try_get_memslot(vcpu->last_used_slot, gfn);
2367 if (slot)
2368 return slot;
2375 slot = search_memslots(slots, gfn, false);
2376 if (slot) {
2377 vcpu->last_used_slot = slot;
2378 return slot;
2424 static bool memslot_is_readonly(const struct kvm_memory_slot *slot)
2426 return slot->flags & KVM_MEM_READONLY;
2429 static unsigned long __gfn_to_hva_many(const struct kvm_memory_slot *slot, gfn_t gfn,
2432 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
2435 if (memslot_is_readonly(slot) && write)
2439 *nr_pages = slot->npages - (gfn - slot->base_gfn);
2441 return __gfn_to_hva_memslot(slot, gfn);
2444 static unsigned long gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn,
2447 return __gfn_to_hva_many(slot, gfn, nr_pages, true);
2450 unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot,
2453 return gfn_to_hva_many(slot, gfn, NULL);
2472 * @slot: the kvm_memory_slot which contains @gfn
2474 * @writable: used to return the read/write attribute of the @slot if the hva
2477 unsigned long gfn_to_hva_memslot_prot(struct kvm_memory_slot *slot,
2480 unsigned long hva = __gfn_to_hva_many(slot, gfn, NULL, false);
2483 *writable = !memslot_is_readonly(slot);
2490 struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn);
2492 return gfn_to_hva_memslot_prot(slot, gfn, writable);
2497 struct kvm_memory_slot *slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
2499 return gfn_to_hva_memslot_prot(slot, gfn, writable);
2746 kvm_pfn_t __gfn_to_pfn_memslot(const struct kvm_memory_slot *slot, gfn_t gfn,
2750 unsigned long addr = __gfn_to_hva_many(slot, gfn, NULL, write_fault);
2768 if (writable && memslot_is_readonly(slot)) {
2786 kvm_pfn_t gfn_to_pfn_memslot(const struct kvm_memory_slot *slot, gfn_t gfn)
2788 return __gfn_to_pfn_memslot(slot, gfn, false, false, NULL, true,
2793 kvm_pfn_t gfn_to_pfn_memslot_atomic(const struct kvm_memory_slot *slot, gfn_t gfn)
2795 return __gfn_to_pfn_memslot(slot, gfn, true, false, NULL, true,
2818 int gfn_to_page_many_atomic(struct kvm_memory_slot *slot, gfn_t gfn,
2824 addr = gfn_to_hva_many(slot, gfn, &entry);
3028 static int __kvm_read_guest_page(struct kvm_memory_slot *slot, gfn_t gfn,
3034 addr = gfn_to_hva_memslot_prot(slot, gfn, NULL);
3046 struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn);
3048 return __kvm_read_guest_page(slot, gfn, data, offset, len);
3055 struct kvm_memory_slot *slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
3057 return __kvm_read_guest_page(slot, gfn, data, offset, len);
3101 static int __kvm_read_guest_atomic(struct kvm_memory_slot *slot, gfn_t gfn,
3107 addr = gfn_to_hva_memslot_prot(slot, gfn, NULL);
3122 struct kvm_memory_slot *slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
3125 return __kvm_read_guest_atomic(slot, gfn, data, offset, len);
3149 struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn);
3151 return __kvm_write_guest_page(kvm, slot, gfn, data, offset, len);
3158 struct kvm_memory_slot *slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
3160 return __kvm_write_guest_page(vcpu->kvm, slot, gfn, data, offset, len);
3365 u32 slot = (memslot->as_id << 16) | memslot->id;
3368 kvm_dirty_ring_push(vcpu, slot, rel_gfn);
4985 __u32 slot;
4994 __u32 slot;
5031 log.slot = compat_log.slot;
5048 log.slot = compat_log.slot;