Lines Matching refs:new
547 struct kvm_memory_slot old, new;
574 new = old = *memslot;
576 new.id = mem->slot;
577 new.base_gfn = base_gfn;
578 new.npages = npages;
579 new.flags = mem->flags;
599 if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES))
600 new.dirty_bitmap = NULL;
606 if (npages && !new.rmap) {
607 new.rmap = vmalloc(npages * sizeof(*new.rmap));
609 if (!new.rmap)
612 memset(new.rmap, 0, npages * sizeof(*new.rmap));
614 new.user_alloc = user_alloc;
615 new.userspace_addr = mem->userspace_addr;
629 if (new.lpage_info[i])
636 new.lpage_info[i] = vmalloc(lpages * sizeof(*new.lpage_info[i]));
638 if (!new.lpage_info[i])
641 memset(new.lpage_info[i], 0,
642 lpages * sizeof(*new.lpage_info[i]));
645 new.lpage_info[i][0].write_count = 1;
647 new.lpage_info[i][lpages - 1].write_count = 1;
648 ugfn = new.userspace_addr >> PAGE_SHIFT;
657 new.lpage_info[i][j].write_count = 1;
663 if ((new.flags & KVM_MEM_LOG_DIRTY_PAGES) && !new.dirty_bitmap) {
664 unsigned long dirty_bytes = kvm_dirty_bitmap_bytes(&new);
666 new.dirty_bitmap = vmalloc(dirty_bytes);
667 if (!new.dirty_bitmap)
669 memset(new.dirty_bitmap, 0, dirty_bytes);
675 new.user_alloc = user_alloc;
677 new.userspace_addr = mem->userspace_addr;
693 /* From this point no new shadow pages pointing to a deleted
704 r = kvm_arch_prepare_memory_region(kvm, &new, old, mem, user_alloc);
711 r = kvm_iommu_map_pages(kvm, &new);
727 new.rmap = NULL;
728 new.dirty_bitmap = NULL;
730 new.lpage_info[i] = NULL;
733 slots->memslots[mem->slot] = new;
740 kvm_free_physmem_slot(&old, &new);
749 kvm_free_physmem_slot(&new, &old);