Lines Matching full:vm
26 #include <vm/vm.h>
27 #include <vm/vm_object.h>
56 struct vm *vm; /* vm instance cookie */ member
115 vm_slock_vcpus(sc->vm); in vcpu_lock_all()
116 maxcpus = vm_get_maxcpus(sc->vm); in vcpu_lock_all()
118 vcpu = vm_vcpu(sc->vm, i); in vcpu_lock_all()
128 vcpu = vm_vcpu(sc->vm, j); in vcpu_lock_all()
133 vm_unlock_vcpus(sc->vm); in vcpu_lock_all()
145 maxcpus = vm_get_maxcpus(sc->vm); in vcpu_unlock_all()
147 vcpu = vm_vcpu(sc->vm, i); in vcpu_unlock_all()
152 vm_unlock_vcpus(sc->vm); in vcpu_unlock_all()
163 if (strcmp(name, vm_name(sc->vm)) == 0) in vmmdev_lookup()
197 vm_slock_memsegs(sc->vm); in vmmdev_rw()
201 maxaddr = vmm_sysmem_maxaddr(sc->vm); in vmmdev_rw()
208 * The VM has a hole in its physical memory map. If we want to in vmmdev_rw()
215 hpa = vm_gpa_hold_global(sc->vm, gpa, c, prot, &cookie); in vmmdev_rw()
227 vm_unlock_memsegs(sc->vm); in vmmdev_rw()
240 error = vm_get_memseg(sc->vm, mseg->segid, &mseg->len, &sysmem, NULL); in get_memseg()
282 error = vm_alloc_memseg(sc->vm, mseg->segid, mseg->len, sysmem); in alloc_memseg()
289 vm_free_memseg(sc->vm, mseg->segid); in alloc_memseg()
415 vm_xlock_memsegs(sc->vm); in vmmdev_ioctl()
417 vm_slock_memsegs(sc->vm); in vmmdev_ioctl()
431 vcpu = vm_alloc_vcpu(sc->vm, vcpuid); in vmmdev_ioctl()
454 error = vm_suspend(sc->vm, vmsuspend->how); in vmmdev_ioctl()
458 error = vm_reinit(sc->vm); in vmmdev_ioctl()
482 error = vm_mmap_getnext(sc->vm, &mm->gpa, &mm->segid, in vmmdev_ioctl()
490 error = vm_mmap_memseg(sc->vm, mm->gpa, mm->segid, mm->segoff, in vmmdev_ioctl()
498 error = vm_munmap_memseg(sc->vm, mu->gpa, mu->len); in vmmdev_ioctl()
617 *cpuset = vm_active_cpus(sc->vm); in vmmdev_ioctl()
619 *cpuset = vm_suspended_cpus(sc->vm); in vmmdev_ioctl()
621 *cpuset = vm_debug_cpus(sc->vm); in vmmdev_ioctl()
632 error = vm_suspend_cpu(sc->vm, vcpu); in vmmdev_ioctl()
635 error = vm_resume_cpu(sc->vm, vcpu); in vmmdev_ioctl()
641 error = vm_set_topology(sc->vm, topology->sockets, in vmmdev_ioctl()
649 vm_get_topology(sc->vm, &topology->sockets, &topology->cores, in vmmdev_ioctl()
655 error = vmmdev_machdep_ioctl(sc->vm, vcpu, cmd, data, fflag, in vmmdev_ioctl()
662 vm_unlock_memsegs(sc->vm); in vmmdev_ioctl()
679 vm_unlock_memsegs(sc->vm); in vmmdev_ioctl()
708 vm_slock_memsegs(sc->vm); in vmmdev_mmap_single()
713 error = vm_mmap_getnext(sc->vm, &gpa, &segid, &segoff, &len, in vmmdev_mmap_single()
725 error = vm_get_memseg(sc->vm, segid, &len, &sysmem, objp); in vmmdev_mmap_single()
735 vm_unlock_memsegs(sc->vm); in vmmdev_mmap_single()
759 vm_disable_vcpu_creation(sc->vm); in vmmdev_destroy()
762 vm_unlock_vcpus(sc->vm); in vmmdev_destroy()
771 if (sc->vm != NULL) in vmmdev_destroy()
772 vm_destroy(sc->vm); in vmmdev_destroy()
797 * Setting 'sc->cdev' to NULL is used to indicate that the VM in vmmdev_lookup_and_destroy()
845 vmmdev_alloc(struct vm *vm, struct ucred *cred) in vmmdev_alloc() argument
851 sc->vm = vm; in vmmdev_alloc()
862 struct vm *vm; in vmmdev_create() local
872 error = vm_create(name, &vm); in vmmdev_create()
877 sc = vmmdev_alloc(vm, cred); in vmmdev_create()
1045 vm_slock_memsegs(dsc->sc->vm); in devmem_mmap_single()
1047 error = vm_get_memseg(dsc->sc->vm, dsc->segid, &seglen, &sysmem, objp); in devmem_mmap_single()
1056 vm_unlock_memsegs(dsc->sc->vm); in devmem_mmap_single()
1089 error = make_dev_s(&mda, &dsc->cdev, "vmm.io/%s.%s", vm_name(sc->vm), in devmem_create_cdev()