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;
676 KVMSlot *mem, old;
696 mem = kvm_lookup_overlapping_slot(s, start_addr, start_addr + size);
697 if (!mem) {
701 if (flags < IO_MEM_UNASSIGNED && start_addr >= mem->start_addr &&
702 (start_addr + size <= mem->start_addr + mem->memory_size) &&
703 (phys_offset - start_addr == mem->phys_offset - mem->start_addr)) {
709 old = *mem;
712 mem->memory_size = 0;
713 err = kvm_set_user_memory_region(s, mem);
731 mem = kvm_alloc_slot(s);
732 mem->memory_size = old.memory_size;
733 mem->start_addr = old.start_addr;
734 mem->phys_offset = old.phys_offset;
735 mem->flags = 0;
737 err = kvm_set_user_memory_region(s, mem);
752 mem = kvm_alloc_slot(s);
753 mem->memory_size = start_addr - old.start_addr;
754 mem->start_addr = old.start_addr;
755 mem->phys_offset = old.phys_offset;
756 mem->flags = 0;
758 err = kvm_set_user_memory_region(s, mem);
770 mem = kvm_alloc_slot(s);
771 mem->start_addr = start_addr + size;
772 size_delta = mem->start_addr - old.start_addr;
773 mem->memory_size = old.memory_size - size_delta;
774 mem->phys_offset = old.phys_offset + size_delta;
775 mem->flags = 0;
777 err = kvm_set_user_memory_region(s, mem);
794 mem = kvm_alloc_slot(s);
795 mem->memory_size = size;
796 mem->start_addr = start_addr;
797 mem->phys_offset = phys_offset;
798 mem->flags = 0;
800 err = kvm_set_user_memory_region(s, mem);