Home | History | Annotate | Download | only in qemu

Lines Matching defs:mem

93         KVMSlot *mem = &s->slots[i];
95 if (start_addr == mem->start_addr &&
96 end_addr == mem->start_addr + mem->memory_size) {
97 return mem;
115 KVMSlot *mem = &s->slots[i];
117 if (mem->memory_size == 0 ||
118 (found && found->start_addr < mem->start_addr)) {
122 if (end_addr > mem->start_addr &&
123 start_addr < mem->start_addr + mem->memory_size) {
124 found = mem;
133 struct kvm_userspace_memory_region mem;
135 mem.slot = slot->slot;
136 mem.guest_phys_addr = slot->start_addr;
137 mem.memory_size = slot->memory_size;
138 mem.userspace_addr = (unsigned long)qemu_get_ram_ptr(slot->phys_offset);
139 mem.flags = slot->flags;
141 mem.flags |= KVM_MEM_LOG_DIRTY_PAGES;
143 return kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, &mem);
226 KVMSlot *mem = kvm_lookup_matching_slot(s, phys_addr, phys_addr + size);
229 if (mem == NULL) {
236 old_flags = mem->flags;
238 flags = (mem->flags & ~mask) | flags;
239 mem->flags = flags;
249 return kvm_set_user_memory_region(s, mem);
269 KVMSlot *mem;
275 mem = &s->slots[i];
277 if (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) {
280 err = kvm_set_user_memory_region(s, mem);
304 KVMSlot *mem;
309 mem = kvm_lookup_overlapping_slot(s, start_addr, end_addr);
310 if (mem == NULL) {
314 size = ((mem->memory_size >> TARGET_PAGE_BITS) + 7) / 8;
323 d.slot = mem->slot;
331 for (phys_addr = mem->start_addr, addr = mem->phys_offset;
332 phys_addr < mem->start_addr + mem->memory_size;
335 unsigned nr = (phys_addr - mem->start_addr) >> TARGET_PAGE_BITS;
673 KVMSlot *mem, old;
693 mem = kvm_lookup_overlapping_slot(s, start_addr, start_addr + size);
694 if (!mem) {
698 if (flags < IO_MEM_UNASSIGNED && start_addr >= mem->start_addr &&
699 (start_addr + size <= mem->start_addr + mem->memory_size) &&
700 (phys_offset - start_addr == mem->phys_offset - mem->start_addr)) {
706 old = *mem;
709 mem->memory_size = 0;
710 err = kvm_set_user_memory_region(s, mem);
728 mem = kvm_alloc_slot(s);
729 mem->memory_size = old.memory_size;
730 mem->start_addr = old.start_addr;
731 mem->phys_offset = old.phys_offset;
732 mem->flags = 0;
734 err = kvm_set_user_memory_region(s, mem);
749 mem = kvm_alloc_slot(s);
750 mem->memory_size = start_addr - old.start_addr;
751 mem->start_addr = old.start_addr;
752 mem->phys_offset = old.phys_offset;
753 mem->flags = 0;
755 err = kvm_set_user_memory_region(s, mem);
767 mem = kvm_alloc_slot(s);
768 mem->start_addr = start_addr + size;
769 size_delta = mem->start_addr - old.start_addr;
770 mem->memory_size = old.memory_size - size_delta;
771 mem->phys_offset = old.phys_offset + size_delta;
772 mem->flags = 0;
774 err = kvm_set_user_memory_region(s, mem);
791 mem = kvm_alloc_slot(s);
792 mem->memory_size = size;
793 mem->start_addr = start_addr;
794 mem->phys_offset = phys_offset;
795 mem->flags = 0;
797 err = kvm_set_user_memory_region(s, mem);