/openbmc/linux/drivers/virtio/ |
H A D | virtio_mem.c | 278 static void virtio_mem_retry(struct virtio_mem *vm); 279 static int virtio_mem_create_resource(struct virtio_mem *vm); 280 static void virtio_mem_delete_resource(struct virtio_mem *vm); 286 static int register_virtio_mem_device(struct virtio_mem *vm) in register_virtio_mem_device() argument 295 list_add_rcu(&vm->next, &virtio_mem_devices); in register_virtio_mem_device() 305 static void unregister_virtio_mem_device(struct virtio_mem *vm) in unregister_virtio_mem_device() argument 309 list_del_rcu(&vm->next); in unregister_virtio_mem_device() 336 static unsigned long virtio_mem_phys_to_bb_id(struct virtio_mem *vm, in virtio_mem_phys_to_bb_id() argument 339 return addr / vm->bbm.bb_size; in virtio_mem_phys_to_bb_id() 345 static uint64_t virtio_mem_bb_id_to_phys(struct virtio_mem *vm, in virtio_mem_bb_id_to_phys() argument [all …]
|
/openbmc/linux/tools/testing/selftests/kvm/lib/aarch64/ |
H A D | processor.c | 20 static uint64_t page_align(struct kvm_vm *vm, uint64_t v) in page_align() argument 22 return (v + vm->page_size) & ~(vm->page_size - 1); in page_align() 25 static uint64_t pgd_index(struct kvm_vm *vm, vm_vaddr_t gva) in pgd_index() argument 27 unsigned int shift = (vm->pgtable_levels - 1) * (vm->page_shift - 3) + vm->page_shift; in pgd_index() 28 uint64_t mask = (1UL << (vm->va_bits - shift)) - 1; in pgd_index() 33 static uint64_t pud_index(struct kvm_vm *vm, vm_vaddr_t gva) in pud_index() argument 35 unsigned int shift = 2 * (vm->page_shift - 3) + vm->page_shift; in pud_index() 36 uint64_t mask = (1UL << (vm->page_shift - 3)) - 1; in pud_index() 38 TEST_ASSERT(vm->pgtable_levels == 4, in pud_index() 39 "Mode %d does not have 4 page table levels", vm->mode); in pud_index() [all …]
|
/openbmc/linux/drivers/gpu/drm/amd/amdgpu/ |
H A D | amdgpu_vm.c | 119 * @vm: pointer to the amdgpu_vm structure to set the fence sequence on 121 struct amdgpu_vm *vm; member 130 * amdgpu_vm_set_pasid - manage pasid and vm ptr mapping 133 * @vm: amdgpu_vm pointer 134 * @pasid: the pasid the VM is using on this GPU 136 * Set the pasid this VM is using on this GPU, can also be used to remove the 140 int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm, in amdgpu_vm_set_pasid() argument 145 if (vm->pasid == pasid) in amdgpu_vm_set_pasid() 148 if (vm->pasid) { in amdgpu_vm_set_pasid() 149 r = xa_err(xa_erase_irq(&adev->vm_manager.pasids, vm->pasid)); in amdgpu_vm_set_pasid() [all …]
|
/openbmc/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 …]
|
/openbmc/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 | 23 * @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 …]
|
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 …]
|
/openbmc/linux/tools/testing/selftests/kvm/lib/ |
H A D | kvm_util.c | 128 void vm_enable_dirty_ring(struct kvm_vm *vm, uint32_t ring_size) in vm_enable_dirty_ring() argument 130 if (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL)) in vm_enable_dirty_ring() 131 vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL, ring_size); in vm_enable_dirty_ring() 133 vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size); in vm_enable_dirty_ring() 134 vm->dirty_ring_size = ring_size; in vm_enable_dirty_ring() 137 static void vm_open(struct kvm_vm *vm) in vm_open() argument 139 vm->kvm_fd = _open_kvm_dev_path_or_exit(O_RDWR); in vm_open() 143 vm->fd = __kvm_ioctl(vm->kvm_fd, KVM_CREATE_VM, (void *)vm->type); in vm_open() 144 TEST_ASSERT(vm->fd >= 0, KVM_IOCTL_ERROR(KVM_CREATE_VM, vm->fd)); in vm_open() 195 * Initializes vm->vpages_valid to match the canonical VA space of the [all …]
|
/openbmc/linux/drivers/gpu/drm/i915/gt/ |
H A D | intel_ggtt.c | 52 struct drm_i915_private *i915 = ggtt->vm.i915; in ggtt_init_hw() 54 i915_address_space_init(&ggtt->vm, VM_CLASS_GGTT); in ggtt_init_hw() 56 ggtt->vm.is_ggtt = true; in ggtt_init_hw() 59 ggtt->vm.has_read_only = IS_VALLEYVIEW(i915); in ggtt_init_hw() 62 ggtt->vm.mm.color_adjust = i915_ggtt_color_adjust; in ggtt_init_hw() 68 ggtt->vm.cleanup(&ggtt->vm); in ggtt_init_hw() 103 * i915_ggtt_suspend_vm - Suspend the memory mappings for a GGTT or DPT VM 104 * @vm: The VM to suspend the mappings for 109 void i915_ggtt_suspend_vm(struct i915_address_space *vm) in i915_ggtt_suspend_vm() argument 114 drm_WARN_ON(&vm->i915->drm, !vm->is_ggtt && !vm->is_dpt); in i915_ggtt_suspend_vm() [all …]
|
H A D | gen8_ppgtt.c | 89 struct drm_i915_private *i915 = ppgtt->vm.i915; in gen8_ppgtt_notify_vgt() 90 struct intel_uncore *uncore = ppgtt->vm.gt->uncore; in gen8_ppgtt_notify_vgt() 101 if (i915_vm_is_4lvl(&ppgtt->vm)) { in gen8_ppgtt_notify_vgt() 179 static unsigned int gen8_pd_top_count(const struct i915_address_space *vm) in gen8_pd_top_count() argument 181 unsigned int shift = __gen8_pte_shift(vm->top); in gen8_pd_top_count() 183 return (vm->total + (1ull << shift) - 1) >> shift; in gen8_pd_top_count() 187 gen8_pdp_for_page_index(struct i915_address_space * const vm, const u64 idx) in gen8_pdp_for_page_index() argument 189 struct i915_ppgtt * const ppgtt = i915_vm_to_ppgtt(vm); in gen8_pdp_for_page_index() 191 if (vm->top == 2) in gen8_pdp_for_page_index() 194 return i915_pd_entry(ppgtt->pd, gen8_pd_index(idx, vm->top)); in gen8_pdp_for_page_index() [all …]
|
/openbmc/qemu/tests/qemu-iotests/ |
H A D | 118 | 49 for event in self.vm.get_qmp_events(wait=False): 77 self.vm.cmd('blockdev-change-medium', 84 result = self.vm.qmp('query-block') 90 self.vm.cmd('eject', id=self.device_name, force=True) 94 result = self.vm.qmp('query-block') 100 self.vm.cmd('eject', id=self.device_name, force=True) 104 result = self.vm.qmp('query-block') 109 self.vm.cmd('blockdev-change-medium', id=self.device_name, 114 result = self.vm.qmp('query-block') 120 self.vm.cmd('blockdev-open-tray', [all …]
|
H A D | 219 | 29 def pause_wait(vm, job_id): argument 32 result = vm.qmp('query-jobs') 38 def test_pause_resume(vm): argument 45 iotests.log(vm.qmp(pause_cmd, **{pause_arg: 'job0'})) 46 pause_wait(vm, 'job0') 47 iotests.log(iotests.filter_qmp_event(vm.event_wait('JOB_STATUS_CHANGE'))) 48 result = vm.qmp('query-jobs') 54 iotests.log(vm.qmp(resume_cmd, **{resume_arg: 'job0'})) 55 iotests.log(iotests.filter_qmp_event(vm.event_wait('JOB_STATUS_CHANGE'))) 59 result = vm.qmp('query-jobs') [all …]
|
H A D | 240 | 35 self.vm = iotests.VM() 36 self.vm.launch() 39 self.vm.shutdown() 43 self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0') 44 self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") 45 …self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iot… 46 self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') 47 self.vm.qmp_log('device_del', id='scsi-hd0') 48 self.vm.event_wait('DEVICE_DELETED') 49 self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') [all …]
|
H A D | 218 | 36 # Launches the VM, adds two null-co nodes (source and target), and 41 def start_mirror(vm, speed=None, buf_size=None): argument 42 vm.launch() 44 vm.cmd('blockdev-add', 49 vm.cmd('blockdev-add', 55 vm.cmd('blockdev-mirror', 63 vm.cmd('blockdev-mirror', 77 with iotests.VM() as vm: 79 start_mirror(vm, 65536, 65536) 82 log(vm.qmp('block-job-cancel', device='mirror', force=False)) [all …]
|
H A D | 246 | 32 def query_bitmaps(vm): argument 33 res = vm.qmp("query-block") 39 iotests.VM() as vm: 41 log('--- Preparing image & VM ---\n') 43 vm.add_drive(img_path) 47 vm.launch() 50 vm.qmp_log("block-dirty-bitmap-add", node="drive0", 52 vm.qmp_log("block-dirty-bitmap-add", node="drive0", 54 vm.qmp_log("block-dirty-bitmap-add", node="drive0", 56 vm.qmp_log("block-dirty-bitmap-add", node="drive0", [all …]
|
H A D | 206 | 33 iotests.VM() as vm: 35 vm.add_object('secret,id=keysec0,data=foo') 45 vm.launch() 46 vm.blockdev_create({ 'driver': 'file', 50 vm.qmp_log('blockdev-add', 55 vm.blockdev_create({ 'driver': imgfmt, 58 vm.shutdown() 71 vm.launch() 72 vm.blockdev_create({ 'driver': 'file', 78 vm.blockdev_create({ 'driver': imgfmt, [all …]
|
/openbmc/qemu/docs/system/ |
H A D | vm-templating.rst | 1 QEMU VM templating 4 This document explains how to use VM templating in QEMU. 6 For now, the focus is on VM memory aspects, and not about how to save and 7 restore other VM state (i.e., migrate-to-file with ``x-ignore-shared``). 12 With VM templating, a single template VM serves as the starting point for 16 Conceptually, the VM state is frozen, to then be used as a basis for new 18 new VMs are able to read template VM memory; however, any modifications 19 stay private and don't modify the original template VM or any other 20 created VM. 25 When effectively cloning VMs by VM templating, hardware identifiers [all …]
|
/openbmc/linux/tools/testing/selftests/kvm/lib/s390x/ |
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 == 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 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 …]
|
/openbmc/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 …]
|
/openbmc/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 …]
|
/openbmc/qemu/tests/functional/ |
H A D | test_ppc_74xx.py | 20 self.vm.set_console() 21 self.vm.add_args('-cpu', '7400') 22 self.vm.launch() 29 self.vm.set_console() 30 self.vm.add_args('-cpu', '7410') 31 self.vm.launch() 38 self.vm.set_console() 39 self.vm.add_args('-cpu', '7441') 40 self.vm.launch() 47 self.vm.set_console() [all …]
|
H A D | test_mem_addr_space.py | 19 # the VM generates empty logs. A delay of 1 second is added for 30 we have 0.5 GiB of VM memory, see pc_q35_init()). This means total 33 actual memory size of 59 GiB. If the VM is started with 0.5 GiB of 41 self.vm.add_args('-S', '-machine', 'q35', '-m', 46 self.vm.set_qmp_monitor(enabled=False) 47 self.vm.launch() 48 self.vm.wait() 49 self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") 50 self.assertRegex(self.vm.get_log(), r'phys-bits too low') 58 self.vm.add_args('-S', '-machine', 'q35', '-m', [all …]
|
/openbmc/linux/tools/testing/selftests/kvm/s390x/ |
H A D | cmma_test.c | 102 static void create_main_memslot(struct kvm_vm *vm) in create_main_memslot() argument 106 vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, 0, 0, MAIN_PAGE_COUNT, 0); in create_main_memslot() 109 vm->memslots[i] = 0; in create_main_memslot() 112 static void create_test_memslot(struct kvm_vm *vm) in create_test_memslot() argument 114 vm_userspace_mem_region_add(vm, in create_test_memslot() 116 TEST_DATA_START_GFN << vm->page_shift, in create_test_memslot() 121 vm->memslots[MEM_REGION_TEST_DATA] = TEST_DATA_MEMSLOT; in create_test_memslot() 124 static void create_memslots(struct kvm_vm *vm) in create_memslots() argument 127 * Our VM has the following memory layout: in create_memslots() 140 create_main_memslot(vm); in create_memslots() [all …]
|
/openbmc/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 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 …]
|
/openbmc/linux/tools/testing/selftests/kvm/lib/riscv/ |
H A D | processor.c | 16 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 size_t nr_pages = page_align(vm, ptrs_per_pte(vm) * 8) / vm->page_size; in virt_arch_pgd_alloc() 60 if (vm->pgd_created) in virt_arch_pgd_alloc() 63 vm->pgd = vm_phy_pages_alloc(vm, nr_pages, in virt_arch_pgd_alloc() [all …]
|