| /linux/tools/testing/selftests/kvm/lib/arm64/ |
| H A D | processor.c | 24 static uint64_t page_align(struct kvm_vm *vm, uint64_t v) in page_align() argument 26 return (v + vm->page_size) & ~(vm->page_size - 1); in page_align() 29 static uint64_t pgd_index(struct kvm_vm *vm, vm_vaddr_t gva) in pgd_index() argument 31 unsigned int shift = (vm->pgtable_levels - 1) * (vm->page_shift - 3) + vm->page_shift; in pgd_index() 32 uint64_t mask = (1UL << (vm->va_bits - shift)) - 1; in pgd_index() 37 static uint64_t pud_index(struct kvm_vm *vm, vm_vaddr_t gva) in pud_index() argument 39 unsigned int shift = 2 * (vm->page_shift - 3) + vm->page_shift; in pud_index() 40 uint64_t mask = (1UL << (vm->page_shift - 3)) - 1; in pud_index() 42 TEST_ASSERT(vm->pgtable_levels == 4, in pud_index() 43 "Mode %d does not have 4 page table levels", vm->mode); in pud_index() [all …]
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_vm.h | 34 static inline struct xe_vm *xe_vm_get(struct xe_vm *vm) in xe_vm_get() argument 36 drm_gpuvm_get(&vm->gpuvm); in xe_vm_get() 37 return vm; in xe_vm_get() 40 static inline void xe_vm_put(struct xe_vm *vm) in xe_vm_put() argument 42 drm_gpuvm_put(&vm->gpuvm); in xe_vm_put() 45 int xe_vm_lock(struct xe_vm *vm, bool intr); 47 void xe_vm_unlock(struct xe_vm *vm); 49 static inline bool xe_vm_is_closed(struct xe_vm *vm) in xe_vm_is_closed() argument 51 /* Only guaranteed not to change when vm->lock is held */ in xe_vm_is_closed() 52 return !vm->size; in xe_vm_is_closed() [all …]
|
| H A D | xe_userptr.c | 18 * without the vm->svm.gpusvm.notifier_lock held. There is no guarantee that the 32 * __xe_vm_userptr_needs_repin() - Check whether the VM does have userptrs 34 * @vm: The VM. 36 * This function checks for whether the VM has userptrs that need repinning, 42 int __xe_vm_userptr_needs_repin(struct xe_vm *vm) in __xe_vm_userptr_needs_repin() argument 44 lockdep_assert_held_read(&vm->svm.gpusvm.notifier_lock); in __xe_vm_userptr_needs_repin() 46 return (list_empty(&vm->userptr.repin_list) && in __xe_vm_userptr_needs_repin() 47 list_empty(&vm->userptr.invalidated)) ? 0 : -EAGAIN; in __xe_vm_userptr_needs_repin() 53 struct xe_vm *vm = xe_vma_vm(vma); in xe_vma_userptr_pin_pages() local 54 struct xe_device *xe = vm->xe; in xe_vma_userptr_pin_pages() [all …]
|
| H A D | xe_trace_bo.h | 20 #define __dev_name_vm(vm) dev_name((vm)->xe->drm.dev) argument 31 __field(struct xe_vm *, vm) 38 __entry->vm = bo->vm; 41 TP_printk("dev=%s, size=%zu, flags=0x%02x, vm=%p", 43 __entry->flags, __entry->vm) 95 __field(struct xe_vm *, vm) 105 __entry->vm = xe_vma_vm(vma); 112 … TP_printk("dev=%s, vma=%p, vm=%p, asid=0x%05x, start=0x%012llx, end=0x%012llx, userptr=0x%012llx", 113 __get_str(dev), __entry->vma, __entry->vm, 189 TP_PROTO(struct xe_vm *vm), [all …]
|
| H A D | xe_exec.c | 45 * We do not allow a user to trigger a bind at exec time rather we have a VM 47 * sense, a VM bind is basically the same operation as an exec from the user 48 * perspective. e.g. If an exec depends on a VM bind use the in / out fence 53 * the VM that have been invalidated since the last exec, likewise we also have 55 * behind any pending kernel operations on any external BOs in VM or any BOs 56 * private to the VM. This is accomplished by the rebinds waiting on BOs 77 * Wait for any async VM bind passed as in-fences to start 79 * Lock global VM lock in read mode | 81 * Lock exec (VM dma-resv lock, external BOs dma-resv locks) | 86 * Add job VM dma-resv bookkeeping slot (non-compute mode) | [all …]
|
| /linux/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_vm.c | 120 * @vm: pointer to the amdgpu_vm structure to set the fence sequence on 122 struct amdgpu_vm *vm; member 131 * amdgpu_vm_assert_locked - check if VM is correctly locked 132 * @vm: the VM which schould be tested 134 * Asserts that the VM root PD is locked. 136 static void amdgpu_vm_assert_locked(struct amdgpu_vm *vm) in amdgpu_vm_assert_locked() argument 138 dma_resv_assert_held(vm->root.bo->tbo.base.resv); in amdgpu_vm_assert_locked() 146 * State for PDs/PTs and per VM BOs which are not at the location they should 151 struct amdgpu_vm *vm = vm_bo->vm; in amdgpu_vm_bo_evicted() local 155 amdgpu_vm_assert_locked(vm); in amdgpu_vm_bo_evicted() [all …]
|
| /linux/tools/testing/selftests/kvm/lib/loongarch/ |
| H A D | processor.c | 15 static uint64_t virt_pte_index(struct kvm_vm *vm, vm_vaddr_t gva, int level) in virt_pte_index() argument 20 shift = level * (vm->page_shift - 3) + vm->page_shift; in virt_pte_index() 21 mask = (1UL << (vm->page_shift - 3)) - 1; in virt_pte_index() 25 static uint64_t pte_addr(struct kvm_vm *vm, uint64_t entry) in pte_addr() argument 27 return entry & ~((0x1UL << vm->page_shift) - 1); in pte_addr() 30 static uint64_t ptrs_per_pte(struct kvm_vm *vm) in ptrs_per_pte() argument 32 return 1 << (vm->page_shift - 3); in ptrs_per_pte() 35 static void virt_set_pgtable(struct kvm_vm *vm, vm_paddr_t table, vm_paddr_t child) in virt_set_pgtable() argument 40 ptep = addr_gpa2hva(vm, table); in virt_set_pgtable() 41 ptrs_per_pte = 1 << (vm->page_shift - 3); in virt_set_pgtable() [all …]
|
| /linux/drivers/gpu/drm/lima/ |
| H A D | lima_vm.c | 18 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/drivers/virt/acrn/ |
| H A D | vm.c | 21 * 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 …]
|
| H A D | irqfd.c | 21 * @vm: Associated VM pointer 25 * @list: Entry within &acrn_vm.irqfds of irqfds of a VM 30 struct acrn_vm *vm; member 41 struct acrn_vm *vm = irqfd->vm; in acrn_irqfd_inject() local 43 acrn_msi_inject(vm, irqfd->msi.msi_addr, in acrn_irqfd_inject() 51 lockdep_assert_held(&irqfd->vm->irqfds_lock); in hsm_irqfd_shutdown() 63 struct acrn_vm *vm; in hsm_irqfd_shutdown_work() local 66 vm = irqfd->vm; in hsm_irqfd_shutdown_work() 67 mutex_lock(&vm->irqfds_lock); in hsm_irqfd_shutdown_work() 70 mutex_unlock(&vm->irqfds_lock); in hsm_irqfd_shutdown_work() [all …]
|
| H A D | acrn_drv.h | 28 * @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 …]
|
| H A D | ioeventfd.c | 19 * @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 …]
|
| H A D | mm.c | 19 static int modify_region(struct acrn_vm *vm, struct vm_memory_region_op *region) in modify_region() argument 28 regions->vmid = vm->vmid; in modify_region() 35 "Failed to set memory region for VM[%u]!\n", vm->vmid); in modify_region() 43 * @vm: User VM. 44 * @user_gpa: A GPA of User VM. 45 * @service_gpa: A GPA of Service VM. 52 int acrn_mm_region_add(struct acrn_vm *vm, u64 user_gpa, u64 service_gpa, in acrn_mm_region_add() argument 68 ret = modify_region(vm, region); in acrn_mm_region_add() 79 * @vm: User VM. 80 * @user_gpa: A GPA of the User VM. [all …]
|
| H A D | hypercall.h | 53 * 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 …]
|
| H A D | ioreq.c | 39 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/tools/testing/selftests/kvm/lib/ |
| H A D | kvm_util.c | 168 void vm_enable_dirty_ring(struct kvm_vm *vm, uint32_t ring_size) in vm_enable_dirty_ring() argument 170 if (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL)) in vm_enable_dirty_ring() 171 vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL, ring_size); in vm_enable_dirty_ring() 173 vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size); in vm_enable_dirty_ring() 174 vm->dirty_ring_size = ring_size; in vm_enable_dirty_ring() 177 static void vm_open(struct kvm_vm *vm) in vm_open() argument 179 vm->kvm_fd = _open_kvm_dev_path_or_exit(O_RDWR); in vm_open() 183 vm->fd = __kvm_ioctl(vm->kvm_fd, KVM_CREATE_VM, (void *)vm->type); in vm_open() 184 TEST_ASSERT(vm->fd >= 0, KVM_IOCTL_ERROR(KVM_CREATE_VM, vm->fd)); in vm_open() 187 vm->stats.fd = vm_get_stats_fd(vm); in vm_open() [all …]
|
| /linux/drivers/gpu/drm/radeon/ |
| H A D | radeon_vm.c | 37 * 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/tools/testing/selftests/kvm/lib/s390/ |
| H A D | processor.c | 13 void virt_arch_pgd_alloc(struct kvm_vm *vm) in virt_arch_pgd_alloc() argument 17 TEST_ASSERT(vm->page_size == PAGE_SIZE, "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 vm->memslots[MEM_REGION_PT]); in virt_arch_pgd_alloc() 26 memset(addr_gpa2hva(vm, paddr), 0xff, PAGES_PER_REGION * vm->page_size); in virt_arch_pgd_alloc() 28 vm->pgd = paddr; in virt_arch_pgd_alloc() 29 vm->pgd_created = true; in virt_arch_pgd_alloc() 37 static uint64_t virt_alloc_region(struct kvm_vm *vm, int ri) in virt_alloc_region() argument [all …]
|
| /linux/tools/testing/selftests/kvm/include/ |
| H A D | kvm_util.h | 62 struct kvm_vm *vm; member 147 #define kvm_for_each_vcpu(vm, i, vcpu) \ argument 148 for ((i) = 0; (i) <= (vm)->last_vcpu_id; (i)++) \ 149 if (!((vcpu) = vm->vcpus[i])) \ 154 memslot2region(struct kvm_vm *vm, uint32_t memslot); 156 static inline struct userspace_mem_region *vm_get_mem_region(struct kvm_vm *vm, in vm_get_mem_region() argument 160 return memslot2region(vm, vm->memslots[type]); in vm_get_mem_region() 340 static __always_inline void static_assert_is_vm(struct kvm_vm *vm) { } in static_assert_is_vm() argument 342 #define __vm_ioctl(vm, cmd, arg) \ argument 344 static_assert_is_vm(vm); \ [all …]
|
| /linux/tools/testing/selftests/kvm/s390/ |
| H A D | cmma_test.c | 97 static void create_main_memslot(struct kvm_vm *vm) in create_main_memslot() argument 101 vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, 0, 0, MAIN_PAGE_COUNT, 0); in create_main_memslot() 104 vm->memslots[i] = 0; in create_main_memslot() 107 static void create_test_memslot(struct kvm_vm *vm) in create_test_memslot() argument 109 vm_userspace_mem_region_add(vm, in create_test_memslot() 111 TEST_DATA_START_GFN << vm->page_shift, in create_test_memslot() 116 vm->memslots[MEM_REGION_TEST_DATA] = TEST_DATA_MEMSLOT; in create_test_memslot() 119 static void create_memslots(struct kvm_vm *vm) in create_memslots() argument 122 * Our VM has the following memory layout: in create_memslots() 135 create_main_memslot(vm); in create_memslots() 139 finish_vm_setup(struct kvm_vm * vm) finish_vm_setup() argument 153 struct kvm_vm *vm; create_vm_two_memslots() local 164 enable_cmma(struct kvm_vm * vm) enable_cmma() argument 172 enable_dirty_tracking(struct kvm_vm * vm) enable_dirty_tracking() argument 178 __enable_migration_mode(struct kvm_vm * vm) __enable_migration_mode() argument 187 enable_migration_mode(struct kvm_vm * vm) enable_migration_mode() argument 194 is_migration_mode_on(struct kvm_vm * vm) is_migration_mode_on() argument 208 vm_get_cmma_bits(struct kvm_vm * vm,u64 flags,int * errno_out) vm_get_cmma_bits() argument 229 struct kvm_vm *vm = create_vm_two_memslots(); test_get_cmma_basic() local 274 struct kvm_vm *vm = vm_create_barebones(); test_migration_mode() local 376 assert_all_slots_cmma_dirty(struct kvm_vm * vm) assert_all_slots_cmma_dirty() argument 426 assert_no_pages_cmma_dirty(struct kvm_vm * vm) assert_no_pages_cmma_dirty() argument 449 struct kvm_vm *vm = create_vm_two_memslots(); test_get_initial_dirty() local 473 query_cmma_range(struct kvm_vm * vm,u64 start_gfn,u64 gfn_count,struct kvm_s390_cmma_log * res_out) query_cmma_range() argument 506 struct kvm_vm *vm = create_vm_two_memslots(); test_get_skip_holes() local 668 struct kvm_vm *vm = vm_create_barebones(); machine_has_cmma() local [all...] |
| /linux/drivers/gpu/drm/i915/gt/ |
| H A D | gen8_ppgtt.c | 90 struct drm_i915_private *i915 = ppgtt->vm.i915; in gen8_ppgtt_notify_vgt() 91 struct intel_uncore *uncore = ppgtt->vm.gt->uncore; in gen8_ppgtt_notify_vgt() 102 if (i915_vm_is_4lvl(&ppgtt->vm)) { in gen8_ppgtt_notify_vgt() 180 static unsigned int gen8_pd_top_count(const struct i915_address_space *vm) in gen8_pd_top_count() argument 182 unsigned int shift = __gen8_pte_shift(vm->top); in gen8_pd_top_count() 184 return (vm->total + (1ull << shift) - 1) >> shift; in gen8_pd_top_count() 188 gen8_pdp_for_page_index(struct i915_address_space * const vm, const u64 idx) in gen8_pdp_for_page_index() argument 190 struct i915_ppgtt * const ppgtt = i915_vm_to_ppgtt(vm); in gen8_pdp_for_page_index() 192 if (vm->top == 2) in gen8_pdp_for_page_index() 195 return i915_pd_entry(ppgtt->pd, gen8_pd_index(idx, vm->top)); in gen8_pdp_for_page_index() [all …]
|
| H A D | gen6_ppgtt.c | 23 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, pat_index, 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/drivers/gpu/drm/i915/selftests/ |
| H A D | mock_gtt.c | 27 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/sound/pci/ctxfi/ |
| H A D | ctvmem.c | 26 * 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 guard(mutex)(&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() 64 list_add(&block->list, &vm in get_vm_block() 75 put_vm_block(struct ct_vm * vm,struct ct_vm_block * block) put_vm_block() argument 124 ct_vm_map(struct ct_vm * vm,struct snd_pcm_substream * substream,int size) ct_vm_map() argument 152 ct_vm_unmap(struct ct_vm * vm,struct ct_vm_block * block) ct_vm_unmap() argument 164 ct_get_ptp_phys(struct ct_vm * vm,int index) ct_get_ptp_phys() argument 171 struct ct_vm *vm; ct_vm_create() local 215 ct_vm_destroy(struct ct_vm * vm) ct_vm_destroy() argument [all...] |
| /linux/tools/testing/selftests/kvm/lib/riscv/ |
| H A D | processor.c | 29 static uint64_t page_align(struct kvm_vm *vm, uint64_t v) in page_align() argument 31 return (v + vm->page_size) & ~(vm->page_size - 1); in page_align() 34 static uint64_t pte_addr(struct kvm_vm *vm, uint64_t entry) in pte_addr() argument 40 static uint64_t ptrs_per_pte(struct kvm_vm *vm) in ptrs_per_pte() argument 59 static uint64_t pte_index(struct kvm_vm *vm, vm_vaddr_t gva, int level) in pte_index() argument 63 TEST_ASSERT(level < vm->pgtable_levels, in pte_index() 69 void virt_arch_pgd_alloc(struct kvm_vm *vm) in virt_arch_pgd_alloc() argument 71 size_t nr_pages = page_align(vm, ptrs_per_pte(vm) * 8) / vm->page_size; in virt_arch_pgd_alloc() 73 if (vm->pgd_created) in virt_arch_pgd_alloc() 76 vm->pgd = vm_phy_pages_alloc(vm, nr_pages, in virt_arch_pgd_alloc() [all …]
|