Lines Matching defs:new

757 		 * which includes the current and new ranges. As there won't be
1380 * of the new file descriptor fails and the reference cannot be transferred to
1476 struct kvm_memory_slot *new)
1480 WARN_ON_ONCE(old->base_gfn != new->base_gfn);
1482 rb_replace_node(&old->gfn_node[idx], &new->gfn_node[idx],
1487 * Replace @old with @new in the inactive memslots.
1489 * With NULL @old this simply adds @new.
1490 * With NULL @new this simply removes @old.
1492 * If @new is non-NULL its hva_node[slots_idx] range has to be set
1497 struct kvm_memory_slot *new)
1499 int as_id = kvm_memslots_get_as_id(old, new);
1508 atomic_long_set(&slots->last_used_slot, (long)new);
1510 if (!new) {
1517 * Initialize @new's hva range. Do this even when replacing an @old
1520 new->hva_node[idx].start = new->userspace_addr;
1521 new->hva_node[idx].last = new->userspace_addr +
1522 (new->npages << PAGE_SHIFT) - 1;
1525 * (Re)Add the new memslot. There is no O(1) interval_tree_replace(),
1529 hash_add(slots->id_hash, &new->id_node[idx], new->id);
1530 interval_tree_insert(&new->hva_node[idx], &slots->hva_tree);
1535 * inserting the new as two separate operations. Replacement is a
1539 if (old && old->base_gfn == new->base_gfn) {
1540 kvm_replace_gfn_node(slots, old, new);
1544 kvm_insert_gfn_node(slots, new);
1573 * Do not store the new memslots while there are invalidations in
1599 * Increment the new memslot generation a second time, dropping the
1622 struct kvm_memory_slot *new,
1630 * new, reuse the existing bitmap. If logging is enabled only in the
1631 * new and KVM isn't using a ring buffer, allocate and initialize a
1632 * new bitmap.
1635 if (!(new->flags & KVM_MEM_LOG_DIRTY_PAGES))
1636 new->dirty_bitmap = NULL;
1638 new->dirty_bitmap = old->dirty_bitmap;
1640 r = kvm_alloc_dirty_bitmap(new);
1645 bitmap_set(new->dirty_bitmap, 0, new->npages);
1649 r = kvm_arch_prepare_memory_region(kvm, old, new, change);
1652 if (r && new && new->dirty_bitmap && (!old || !old->dirty_bitmap))
1653 kvm_destroy_dirty_bitmap(new);
1660 const struct kvm_memory_slot *new,
1664 int new_flags = new ? new->flags : 0;
1672 kvm->nr_memslot_pages += new->npages;
1680 kvm_arch_commit_memory_region(kvm, old, new, change);
1696 if (old->dirty_bitmap && !new->dirty_bitmap)
1702 * data, may be reused by @new.
1712 * Activate @new, which must be installed in the inactive slots by the caller,
1713 * by swapping the active slots and then propagating @new to @old once @old is
1716 * With NULL @old this simply adds @new to @active (while swapping the sets).
1717 * With NULL @new this simply removes @old from @active and frees it
1722 struct kvm_memory_slot *new)
1724 int as_id = kvm_memslots_get_as_id(old, new);
1728 /* Propagate the new memslot to the now inactive memslots. */
1729 kvm_replace_memslot(kvm, old, new);
1761 * deleted or recreated as a new slot.
1766 * From this point no new shadow pages pointing to a deleted, or moved,
1788 struct kvm_memory_slot *new)
1790 /* Add the new memslot to the inactive set and activate. */
1791 kvm_replace_memslot(kvm, NULL, new);
1792 kvm_activate_memslot(kvm, NULL, new);
1801 * the "new" slot, and for the invalid version in the active slots.
1809 struct kvm_memory_slot *new,
1814 * and replace the current INVALID with the new as well.
1816 kvm_replace_memslot(kvm, old, new);
1817 kvm_activate_memslot(kvm, invalid_slot, new);
1822 struct kvm_memory_slot *new)
1827 * with a new, updated copy in both memslot sets.
1829 kvm_replace_memslot(kvm, old, new);
1830 kvm_activate_memslot(kvm, old, new);
1835 struct kvm_memory_slot *new,
1845 * the new memslots are installed with rcu_assign_pointer, then
1852 * These rules ensure that installing new memslots does not lose
1879 r = kvm_prepare_memory_region(kvm, old, new, change);
1904 kvm_create_memslot(kvm, new);
1908 kvm_move_memslot(kvm, old, new, invalid_slot);
1910 kvm_update_flags_memslot(kvm, old, new);
1919 * No need to refresh new->arch, changes after dropping slots_arch_lock
1921 * responsible for knowing that new->arch may be stale.
1923 kvm_commit_memory_region(kvm, old, new, change);
1952 struct kvm_memory_slot *old, *new;
2035 new = kzalloc(sizeof(*new), GFP_KERNEL_ACCOUNT);
2036 if (!new)
2039 new->as_id = as_id;
2040 new->id = id;
2041 new->base_gfn = base_gfn;
2042 new->npages = npages;
2043 new->flags = mem->flags;
2044 new->userspace_addr = mem->userspace_addr;
2046 r = kvm_set_memslot(kvm, old, new, change);
2048 kfree(new);