Home
last modified time | relevance | path

Searched full:vm (Results 1 – 25 of 1302) sorted by relevance

12345678910>>...53

/Linux-v6.1/drivers/virtio/
Dvirtio_mem.c276 static void virtio_mem_retry(struct virtio_mem *vm);
277 static int virtio_mem_create_resource(struct virtio_mem *vm);
278 static void virtio_mem_delete_resource(struct virtio_mem *vm);
284 static int register_virtio_mem_device(struct virtio_mem *vm) in register_virtio_mem_device() argument
293 list_add_rcu(&vm->next, &virtio_mem_devices); in register_virtio_mem_device()
303 static void unregister_virtio_mem_device(struct virtio_mem *vm) in unregister_virtio_mem_device() argument
307 list_del_rcu(&vm->next); in unregister_virtio_mem_device()
334 static unsigned long virtio_mem_phys_to_bb_id(struct virtio_mem *vm, in virtio_mem_phys_to_bb_id() argument
337 return addr / vm->bbm.bb_size; in virtio_mem_phys_to_bb_id()
343 static uint64_t virtio_mem_bb_id_to_phys(struct virtio_mem *vm, in virtio_mem_bb_id_to_phys() argument
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/aarch64/
Dprocessor.c19 static uint64_t page_align(struct kvm_vm *vm, uint64_t v) in page_align() argument
21 return (v + vm->page_size) & ~(vm->page_size - 1); in page_align()
24 static uint64_t pgd_index(struct kvm_vm *vm, vm_vaddr_t gva) in pgd_index() argument
26 unsigned int shift = (vm->pgtable_levels - 1) * (vm->page_shift - 3) + vm->page_shift; in pgd_index()
27 uint64_t mask = (1UL << (vm->va_bits - shift)) - 1; in pgd_index()
32 static uint64_t pud_index(struct kvm_vm *vm, vm_vaddr_t gva) in pud_index() argument
34 unsigned int shift = 2 * (vm->page_shift - 3) + vm->page_shift; in pud_index()
35 uint64_t mask = (1UL << (vm->page_shift - 3)) - 1; in pud_index()
37 TEST_ASSERT(vm->pgtable_levels == 4, in pud_index()
38 "Mode %d does not have 4 page table levels", vm->mode); in pud_index()
[all …]
/Linux-v6.1/drivers/gpu/drm/amd/amdgpu/
Damdgpu_vm.c50 * for the entire GPU, there are multiple VM page tables active
51 * at any given time. The VM page tables can contain a mix
55 * Each VM has an ID associated with it and there is a page table
96 * @vm: pointer to the amdgpu_vm structure to set the fence sequence on
98 struct amdgpu_vm *vm; member
107 * amdgpu_vm_set_pasid - manage pasid and vm ptr mapping
110 * @vm: amdgpu_vm pointer
111 * @pasid: the pasid the VM is using on this GPU
113 * Set the pasid this VM is using on this GPU, can also be used to remove the
117 int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm, in amdgpu_vm_set_pasid() argument
[all …]
/Linux-v6.1/drivers/gpu/drm/i915/gt/
Dintel_ggtt.c29 static inline bool suspend_retains_ptes(struct i915_address_space *vm) in suspend_retains_ptes() argument
31 return GRAPHICS_VER(vm->i915) >= 8 && in suspend_retains_ptes()
32 !HAS_LMEM(vm->i915) && in suspend_retains_ptes()
33 vm->is_ggtt; in suspend_retains_ptes()
57 struct drm_i915_private *i915 = ggtt->vm.i915; in ggtt_init_hw()
59 i915_address_space_init(&ggtt->vm, VM_CLASS_GGTT); in ggtt_init_hw()
61 ggtt->vm.is_ggtt = true; in ggtt_init_hw()
64 ggtt->vm.has_read_only = IS_VALLEYVIEW(i915); in ggtt_init_hw()
67 ggtt->vm.mm.color_adjust = i915_ggtt_color_adjust; in ggtt_init_hw()
73 ggtt->vm.cleanup(&ggtt->vm); in ggtt_init_hw()
[all …]
Dintel_gtt.c32 struct drm_i915_gem_object *alloc_pt_lmem(struct i915_address_space *vm, int sz) in alloc_pt_lmem() argument
48 obj = __i915_gem_object_create_lmem_with_ps(vm->i915, sz, sz, in alloc_pt_lmem()
49 vm->lmem_pt_obj_flags); in alloc_pt_lmem()
51 * Ensure all paging structures for this vm share the same dma-resv in alloc_pt_lmem()
56 obj->base.resv = i915_vm_resv_get(vm); in alloc_pt_lmem()
57 obj->shares_resv_from = vm; in alloc_pt_lmem()
63 struct drm_i915_gem_object *alloc_pt_dma(struct i915_address_space *vm, int sz) in alloc_pt_dma() argument
67 if (I915_SELFTEST_ONLY(should_fail(&vm->fault_attr, 1))) in alloc_pt_dma()
68 i915_gem_shrink_all(vm->i915); in alloc_pt_dma()
70 obj = i915_gem_object_create_internal(vm->i915, sz); in alloc_pt_dma()
[all …]
Dgen8_ppgtt.c60 struct drm_i915_private *i915 = ppgtt->vm.i915; in gen8_ppgtt_notify_vgt()
61 struct intel_uncore *uncore = ppgtt->vm.gt->uncore; in gen8_ppgtt_notify_vgt()
72 if (i915_vm_is_4lvl(&ppgtt->vm)) { in gen8_ppgtt_notify_vgt()
150 static unsigned int gen8_pd_top_count(const struct i915_address_space *vm) in gen8_pd_top_count() argument
152 unsigned int shift = __gen8_pte_shift(vm->top); in gen8_pd_top_count()
154 return (vm->total + (1ull << shift) - 1) >> shift; in gen8_pd_top_count()
158 gen8_pdp_for_page_index(struct i915_address_space * const vm, const u64 idx) in gen8_pdp_for_page_index() argument
160 struct i915_ppgtt * const ppgtt = i915_vm_to_ppgtt(vm); in gen8_pdp_for_page_index()
162 if (vm->top == 2) in gen8_pdp_for_page_index()
165 return i915_pd_entry(ppgtt->pd, gen8_pd_index(idx, vm->top)); in gen8_pdp_for_page_index()
[all …]
Dintel_gtt.h64 #define ggtt_total_entries(ggtt) ((ggtt)->vm.total >> PAGE_SHIFT)
215 void (*bind_vma)(struct i915_address_space *vm,
224 void (*unbind_vma)(struct i915_address_space *vm,
278 /* Flags used when creating page-table objects for this vm */
285 (*alloc_pt_dma)(struct i915_address_space *vm, int sz);
287 (*alloc_scratch_dma)(struct i915_address_space *vm, int sz);
295 void (*allocate_va_range)(struct i915_address_space *vm,
298 void (*clear_range)(struct i915_address_space *vm,
300 void (*insert_page)(struct i915_address_space *vm,
305 void (*insert_entries)(struct i915_address_space *vm,
[all …]
Dgen6_ppgtt.c23 dma_addr_t addr = pt ? px_dma(pt) : px_dma(ppgtt->base.vm.scratch[1]); in gen6_write_pde()
74 static void gen6_ppgtt_clear_range(struct i915_address_space *vm, in gen6_ppgtt_clear_range() argument
77 struct gen6_ppgtt * const ppgtt = to_gen6_ppgtt(i915_vm_to_ppgtt(vm)); in gen6_ppgtt_clear_range()
79 const gen6_pte_t scratch_pte = vm->scratch[0]->encode; in gen6_ppgtt_clear_range()
110 static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, in gen6_ppgtt_insert_entries() argument
115 struct i915_ppgtt *ppgtt = i915_vm_to_ppgtt(vm); in gen6_ppgtt_insert_entries()
120 const u32 pte_encode = vm->pte_encode(0, cache_level, flags); in gen6_ppgtt_insert_entries()
166 gen6_ggtt_invalidate(ppgtt->base.vm.gt->ggtt); in gen6_flush_pd()
172 static void gen6_alloc_va_range(struct i915_address_space *vm, in gen6_alloc_va_range() argument
176 struct gen6_ppgtt *ppgtt = to_gen6_ppgtt(i915_vm_to_ppgtt(vm)); in gen6_alloc_va_range()
[all …]
/Linux-v6.1/drivers/gpu/drm/lima/
Dlima_vm.c18 struct lima_vm *vm; member
35 static void lima_vm_unmap_range(struct lima_vm *vm, u32 start, u32 end) in lima_vm_unmap_range() argument
43 vm->bts[pbe].cpu[bte] = 0; in lima_vm_unmap_range()
47 static int lima_vm_map_page(struct lima_vm *vm, dma_addr_t pa, u32 va) in lima_vm_map_page() argument
52 if (!vm->bts[pbe].cpu) { in lima_vm_map_page()
57 vm->bts[pbe].cpu = dma_alloc_wc( in lima_vm_map_page()
58 vm->dev->dev, LIMA_PAGE_SIZE << LIMA_VM_NUM_PT_PER_BT_SHIFT, in lima_vm_map_page()
59 &vm->bts[pbe].dma, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO); in lima_vm_map_page()
60 if (!vm->bts[pbe].cpu) in lima_vm_map_page()
63 pts = vm->bts[pbe].dma; in lima_vm_map_page()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/
Dkvm_util.c122 void vm_enable_dirty_ring(struct kvm_vm *vm, uint32_t ring_size) in vm_enable_dirty_ring() argument
124 if (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL)) in vm_enable_dirty_ring()
125 vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL, ring_size); in vm_enable_dirty_ring()
127 vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size); in vm_enable_dirty_ring()
128 vm->dirty_ring_size = ring_size; in vm_enable_dirty_ring()
131 static void vm_open(struct kvm_vm *vm) in vm_open() argument
133 vm->kvm_fd = _open_kvm_dev_path_or_exit(O_RDWR); in vm_open()
137 vm->fd = __kvm_ioctl(vm->kvm_fd, KVM_CREATE_VM, (void *)vm->type); in vm_open()
138 TEST_ASSERT(vm->fd >= 0, KVM_IOCTL_ERROR(KVM_CREATE_VM, vm->fd)); in vm_open()
190 struct kvm_vm *vm; in ____vm_create() local
[all …]
/Linux-v6.1/drivers/virt/acrn/
Dvm.c21 * is wrote in VM creation ioctl. Use the rwlock mechanism to protect it.
25 struct acrn_vm *acrn_vm_create(struct acrn_vm *vm, in acrn_vm_create() argument
33 "Failed to create VM! Error: %d\n", ret); in acrn_vm_create()
37 mutex_init(&vm->regions_mapping_lock); in acrn_vm_create()
38 INIT_LIST_HEAD(&vm->ioreq_clients); in acrn_vm_create()
39 spin_lock_init(&vm->ioreq_clients_lock); in acrn_vm_create()
40 vm->vmid = vm_param->vmid; in acrn_vm_create()
41 vm->vcpu_num = vm_param->vcpu_num; in acrn_vm_create()
43 if (acrn_ioreq_init(vm, vm_param->ioreq_buf) < 0) { in acrn_vm_create()
45 vm->vmid = ACRN_INVALID_VMID; in acrn_vm_create()
[all …]
Dirqfd.c23 * @vm: Associated VM pointer
27 * @list: Entry within &acrn_vm.irqfds of irqfds of a VM
32 struct acrn_vm *vm; member
43 struct acrn_vm *vm = irqfd->vm; in acrn_irqfd_inject() local
45 acrn_msi_inject(vm, irqfd->msi.msi_addr, in acrn_irqfd_inject()
53 lockdep_assert_held(&irqfd->vm->irqfds_lock); in hsm_irqfd_shutdown()
65 struct acrn_vm *vm; in hsm_irqfd_shutdown_work() local
68 vm = irqfd->vm; in hsm_irqfd_shutdown_work()
69 mutex_lock(&vm->irqfds_lock); in hsm_irqfd_shutdown_work()
72 mutex_unlock(&vm->irqfds_lock); in hsm_irqfd_shutdown_work()
[all …]
Dacrn_drv.h28 * @user_vm_pa: Physical address of User VM to be mapped.
29 * @service_vm_pa: Physical address of Service VM to be mapped.
33 * to manage the EPT mappings of a single memory region of the User VM. Several
47 * @vmid: A User VM ID.
54 * multiple memory regions of a User VM. A &struct vm_memory_region_batch
67 * struct vm_memory_mapping - Memory map between a User VM and the Service VM
68 * @pages: Pages in Service VM kernel.
70 * @service_vm_va: Virtual address in Service VM kernel.
71 * @user_vm_pa: Physical address in User VM.
74 * HSM maintains memory mappings between a User VM GPA and the Service VM
[all …]
Dioeventfd.c19 * @list: Entry within &acrn_vm.ioeventfds of ioeventfds of a VM
43 static void acrn_ioeventfd_shutdown(struct acrn_vm *vm, struct hsm_ioeventfd *p) in acrn_ioeventfd_shutdown() argument
45 lockdep_assert_held(&vm->ioeventfds_lock); in acrn_ioeventfd_shutdown()
52 static bool hsm_ioeventfd_is_conflict(struct acrn_vm *vm, in hsm_ioeventfd_is_conflict() argument
57 lockdep_assert_held(&vm->ioeventfds_lock); in hsm_ioeventfd_is_conflict()
60 list_for_each_entry(p, &vm->ioeventfds, list) in hsm_ioeventfd_is_conflict()
72 * Assign an eventfd to a VM and create a HSM ioeventfd associated with the
76 static int acrn_ioeventfd_assign(struct acrn_vm *vm, in acrn_ioeventfd_assign() argument
121 mutex_lock(&vm->ioeventfds_lock); in acrn_ioeventfd_assign()
123 if (hsm_ioeventfd_is_conflict(vm, p)) { in acrn_ioeventfd_assign()
[all …]
Dmm.c18 static int modify_region(struct acrn_vm *vm, struct vm_memory_region_op *region) in modify_region() argument
27 regions->vmid = vm->vmid; in modify_region()
34 "Failed to set memory region for VM[%u]!\n", vm->vmid); in modify_region()
42 * @vm: User VM.
43 * @user_gpa: A GPA of User VM.
44 * @service_gpa: A GPA of Service VM.
51 int acrn_mm_region_add(struct acrn_vm *vm, u64 user_gpa, u64 service_gpa, in acrn_mm_region_add() argument
67 ret = modify_region(vm, region); in acrn_mm_region_add()
78 * @vm: User VM.
79 * @user_gpa: A GPA of the User VM.
[all …]
Dhypercall.h53 * hcall_sos_remove_cpu() - Remove a vCPU of Service VM
64 * hcall_create_vm() - Create a User VM
65 * @vminfo: Service VM GPA of info of User VM creation
75 * hcall_start_vm() - Start a User VM
76 * @vmid: User VM ID
86 * hcall_pause_vm() - Pause a User VM
87 * @vmid: User VM ID
97 * hcall_destroy_vm() - Destroy a User VM
98 * @vmid: User VM ID
108 * hcall_reset_vm() - Reset a User VM
[all …]
Dioreq.c39 static int ioreq_complete_request(struct acrn_vm *vm, u16 vcpu, in ioreq_complete_request() argument
52 * in which User VMs and Service VM are bound to dedicated CPU cores. in ioreq_complete_request()
64 ret = hcall_notify_req_finish(vm->vmid, vcpu); in ioreq_complete_request()
79 if (vcpu >= client->vm->vcpu_num) in acrn_ioreq_complete_request()
84 acrn_req = (struct acrn_io_request *)client->vm->ioreq_buf; in acrn_ioreq_complete_request()
88 ret = ioreq_complete_request(client->vm, vcpu, acrn_req); in acrn_ioreq_complete_request()
93 int acrn_ioreq_request_default_complete(struct acrn_vm *vm, u16 vcpu) in acrn_ioreq_request_default_complete() argument
97 spin_lock_bh(&vm->ioreq_clients_lock); in acrn_ioreq_request_default_complete()
98 if (vm->default_client) in acrn_ioreq_request_default_complete()
99 ret = acrn_ioreq_complete_request(vm->default_client, in acrn_ioreq_request_default_complete()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/s390x/
Dprocessor.c13 void virt_arch_pgd_alloc(struct kvm_vm *vm) in virt_arch_pgd_alloc() argument
17 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in virt_arch_pgd_alloc()
18 vm->page_size); in virt_arch_pgd_alloc()
20 if (vm->pgd_created) in virt_arch_pgd_alloc()
23 paddr = vm_phy_pages_alloc(vm, PAGES_PER_REGION, in virt_arch_pgd_alloc()
25 memset(addr_gpa2hva(vm, paddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_arch_pgd_alloc()
27 vm->pgd = paddr; in virt_arch_pgd_alloc()
28 vm->pgd_created = true; in virt_arch_pgd_alloc()
36 static uint64_t virt_alloc_region(struct kvm_vm *vm, int ri) in virt_alloc_region() argument
40 taddr = vm_phy_pages_alloc(vm, ri < 4 ? PAGES_PER_REGION : 1, in virt_alloc_region()
[all …]
/Linux-v6.1/drivers/gpu/drm/radeon/
Dradeon_vm.c37 * for the entire GPU, there are multiple VM page tables active
38 * at any given time. The VM page tables can contain a mix
42 * Each VM has an ID associated with it and there is a page table
78 * radeon_vm_manager_init - init the vm manager
82 * Init the vm manager (cayman+).
100 * radeon_vm_manager_fini - tear down the vm manager
104 * Tear down the VM manager (cayman+).
120 * radeon_vm_get_bos - add the vm BOs to a validation list
123 * @vm: vm providing the BOs
130 struct radeon_vm *vm, in radeon_vm_get_bos() argument
[all …]
/Linux-v6.1/drivers/gpu/drm/i915/selftests/
Dmock_gtt.c27 static void mock_insert_page(struct i915_address_space *vm, in mock_insert_page() argument
35 static void mock_insert_entries(struct i915_address_space *vm, in mock_insert_entries() argument
41 static void mock_bind_ppgtt(struct i915_address_space *vm, in mock_bind_ppgtt() argument
51 static void mock_unbind_ppgtt(struct i915_address_space *vm, in mock_unbind_ppgtt() argument
56 static void mock_cleanup(struct i915_address_space *vm) in mock_cleanup() argument
60 static void mock_clear_range(struct i915_address_space *vm, in mock_clear_range() argument
73 ppgtt->vm.gt = to_gt(i915); in mock_ppgtt()
74 ppgtt->vm.i915 = i915; in mock_ppgtt()
75 ppgtt->vm.total = round_down(U64_MAX, PAGE_SIZE); in mock_ppgtt()
76 ppgtt->vm.dma = i915->drm.dev; in mock_ppgtt()
[all …]
/Linux-v6.1/sound/pci/ctxfi/
Dctvmem.c26 * Find or create vm block based on requested @size.
30 get_vm_block(struct ct_vm *vm, unsigned int size, struct ct_atc *atc) in get_vm_block() argument
36 if (size > vm->size) { in get_vm_block()
42 mutex_lock(&vm->lock); in get_vm_block()
43 list_for_each(pos, &vm->unused) { in get_vm_block()
48 if (pos == &vm->unused) in get_vm_block()
52 /* Move the vm node from unused list to used list directly */ in get_vm_block()
53 list_move(&entry->list, &vm->used); in get_vm_block()
54 vm->size -= size; in get_vm_block()
65 list_add(&block->list, &vm->used); in get_vm_block()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/riscv/
Dprocessor.c16 static uint64_t page_align(struct kvm_vm *vm, uint64_t v) in page_align() argument
18 return (v + vm->page_size) & ~(vm->page_size - 1); in page_align()
21 static uint64_t pte_addr(struct kvm_vm *vm, uint64_t entry) in pte_addr() argument
27 static uint64_t ptrs_per_pte(struct kvm_vm *vm) in ptrs_per_pte() argument
46 static uint64_t pte_index(struct kvm_vm *vm, vm_vaddr_t gva, int level) in pte_index() argument
50 TEST_ASSERT(level < vm->pgtable_levels, in pte_index()
56 void virt_arch_pgd_alloc(struct kvm_vm *vm) in virt_arch_pgd_alloc() argument
58 if (!vm->pgd_created) { in virt_arch_pgd_alloc()
59 vm_paddr_t paddr = vm_phy_pages_alloc(vm, in virt_arch_pgd_alloc()
60 page_align(vm, ptrs_per_pte(vm) * 8) / vm->page_size, in virt_arch_pgd_alloc()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/include/
Dkvm_util_base.h51 struct kvm_vm *vm; member
98 #define kvm_for_each_vcpu(vm, i, vcpu) \ argument
99 for ((i) = 0; (i) <= (vm)->last_vcpu_id; (i)++) \
100 if (!((vcpu) = vm->vcpus[i])) \
105 memslot2region(struct kvm_vm *vm, uint32_t memslot);
215 static __always_inline void static_assert_is_vm(struct kvm_vm *vm) { } in static_assert_is_vm() argument
217 #define __vm_ioctl(vm, cmd, arg) \ argument
219 static_assert_is_vm(vm); \
220 kvm_do_ioctl((vm)->fd, cmd, arg); \
223 #define _vm_ioctl(vm, cmd, name, arg) \ argument
[all …]
/Linux-v6.1/drivers/gpu/drm/i915/display/
Dintel_dpt.c16 struct i915_address_space vm; member
23 #define i915_is_dpt(vm) ((vm)->is_dpt) argument
26 i915_vm_to_dpt(struct i915_address_space *vm) in i915_vm_to_dpt() argument
28 BUILD_BUG_ON(offsetof(struct i915_dpt, vm)); in i915_vm_to_dpt()
29 GEM_BUG_ON(!i915_is_dpt(vm)); in i915_vm_to_dpt()
30 return container_of(vm, struct i915_dpt, vm); in i915_vm_to_dpt()
33 #define dpt_total_entries(dpt) ((dpt)->vm.total >> PAGE_SHIFT)
40 static void dpt_insert_page(struct i915_address_space *vm, in dpt_insert_page() argument
46 struct i915_dpt *dpt = i915_vm_to_dpt(vm); in dpt_insert_page()
50 vm->pte_encode(addr, level, flags)); in dpt_insert_page()
[all …]
/Linux-v6.1/tools/testing/selftests/kvm/lib/x86_64/
Dvmx.c66 * vm - The VM to allocate guest-virtual addresses in.
75 vcpu_alloc_vmx(struct kvm_vm *vm, vm_vaddr_t *p_vmx_gva) in vcpu_alloc_vmx() argument
77 vm_vaddr_t vmx_gva = vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
78 struct vmx_pages *vmx = addr_gva2hva(vm, vmx_gva); in vcpu_alloc_vmx()
81 vmx->vmxon = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
82 vmx->vmxon_hva = addr_gva2hva(vm, (uintptr_t)vmx->vmxon); in vcpu_alloc_vmx()
83 vmx->vmxon_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vmxon); in vcpu_alloc_vmx()
86 vmx->vmcs = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
87 vmx->vmcs_hva = addr_gva2hva(vm, (uintptr_t)vmx->vmcs); in vcpu_alloc_vmx()
88 vmx->vmcs_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vmcs); in vcpu_alloc_vmx()
[all …]

12345678910>>...53