/openbmc/linux/drivers/vhost/ |
H A D | iotlb.c | 28 void vhost_iotlb_map_free(struct vhost_iotlb *iotlb, in vhost_iotlb_map_free() argument 31 vhost_iotlb_itree_remove(map, &iotlb->root); in vhost_iotlb_map_free() 34 iotlb->nmaps--; in vhost_iotlb_map_free() 50 int vhost_iotlb_add_range_ctx(struct vhost_iotlb *iotlb, in vhost_iotlb_add_range_ctx() argument 65 int err = vhost_iotlb_add_range_ctx(iotlb, start, mid, addr, in vhost_iotlb_add_range_ctx() 75 if (iotlb->limit && in vhost_iotlb_add_range_ctx() 76 iotlb->nmaps == iotlb->limit && in vhost_iotlb_add_range_ctx() 77 iotlb->flags & VHOST_IOTLB_FLAG_RETIRE) { in vhost_iotlb_add_range_ctx() 78 map = list_first_entry(&iotlb->list, typeof(*map), link); in vhost_iotlb_add_range_ctx() 79 vhost_iotlb_map_free(iotlb, map); in vhost_iotlb_add_range_ctx() [all …]
|
H A D | vdpa.c | 41 struct vhost_iotlb iotlb; member 69 struct vhost_iotlb *iotlb, u64 start, 72 static inline u32 iotlb_to_asid(struct vhost_iotlb *iotlb) in iotlb_to_asid() argument 74 struct vhost_vdpa_as *as = container_of(iotlb, struct in iotlb_to_asid() 75 vhost_vdpa_as, iotlb); in iotlb_to_asid() 98 return &as->iotlb; in asid_to_iotlb() 116 vhost_iotlb_init(&as->iotlb, 0, 0); in vhost_vdpa_alloc_as() 142 vhost_vdpa_iotlb_unmap(v, &as->iotlb, 0ULL, 0ULL - 1, asid); in vhost_vdpa_remove_as() 817 static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb, in vhost_vdpa_pa_unmap() argument 825 while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) { in vhost_vdpa_pa_unmap() [all …]
|
H A D | vhost.c | 397 vq->iotlb = NULL; in vhost_vq_reset() 560 dev->iotlb = NULL; in vhost_dev_init() 1059 vhost_iotlb_free(dev->iotlb); in vhost_dev_cleanup() 1060 dev->iotlb = NULL; in vhost_dev_cleanup() 1165 if (!vq->iotlb) in vhost_copy_to_user() 1200 if (!vq->iotlb) in vhost_copy_from_user() 1281 if (!vq->iotlb) { \ 1326 if (!vq->iotlb) { \ 1406 struct vhost_iotlb_msg *vq_msg = &node->msg.iotlb; in vhost_iotlb_notify_vq() 1448 if (!dev->iotlb) { in vhost_process_iotlb_msg() [all …]
|
H A D | vhost.h | 134 struct vhost_iotlb *iotlb; member 169 struct vhost_iotlb *iotlb; member 193 void vhost_dev_reset_owner(struct vhost_dev *dev, struct vhost_iotlb *iotlb); 248 void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
|
H A D | Makefile | 19 vhost_iotlb-y := iotlb.o
|
/openbmc/linux/include/linux/ |
H A D | vhost_iotlb.h | 33 int vhost_iotlb_add_range_ctx(struct vhost_iotlb *iotlb, u64 start, u64 last, 35 int vhost_iotlb_add_range(struct vhost_iotlb *iotlb, u64 start, u64 last, 37 void vhost_iotlb_del_range(struct vhost_iotlb *iotlb, u64 start, u64 last); 39 void vhost_iotlb_init(struct vhost_iotlb *iotlb, unsigned int limit, 42 void vhost_iotlb_free(struct vhost_iotlb *iotlb); 43 void vhost_iotlb_reset(struct vhost_iotlb *iotlb); 46 vhost_iotlb_itree_first(struct vhost_iotlb *iotlb, u64 start, u64 last); 50 void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
|
/openbmc/linux/drivers/vdpa/mlx5/core/ |
H A D | mr.c | 224 struct vhost_iotlb *iotlb) in map_direct_mr() argument 239 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1); in map_direct_mr() 254 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1); in map_direct_mr() 305 struct vhost_iotlb *iotlb) in add_direct_chain() argument 327 err = map_direct_mr(mvdev, dmr, iotlb); in add_direct_chain() 357 static int create_user_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb) in create_user_mr() argument 372 for (map = vhost_iotlb_itree_first(iotlb, start, last); map; in create_user_mr() 387 err = add_direct_chain(mvdev, ps, pe - ps, pperm, iotlb); in create_user_mr() 396 err = add_direct_chain(mvdev, ps, pe - ps, pperm, iotlb); in create_user_mr() 460 err = vhost_iotlb_add_range(mvdev->cvq.iotlb, start, last, start, VHOST_ACCESS_RW); in dup_iotlb() [all …]
|
H A D | mlx5_vdpa.h | 53 struct vhost_iotlb *iotlb; member 117 int mlx5_vdpa_handle_set_map(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb, 119 int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb,
|
H A D | resources.c | 232 mvdev->cvq.iotlb = vhost_iotlb_alloc(0, 0); in init_ctrl_vq() 233 if (!mvdev->cvq.iotlb) in init_ctrl_vq() 237 vringh_set_iotlb(&mvdev->cvq.vring, mvdev->cvq.iotlb, &mvdev->cvq.iommu_lock); in init_ctrl_vq() 244 vhost_iotlb_free(mvdev->cvq.iotlb); in cleanup_ctrl_vq()
|
/openbmc/qemu/hw/riscv/ |
H A D | riscv-iommu.c | 257 IOMMUTLBEntry *iotlb) in riscv_iommu_spa_fetch() argument 292 if (!en_s && (iotlb->perm & IOMMU_WO) && in riscv_iommu_spa_fetch() 293 riscv_iommu_msi_check(s, ctx, iotlb->iova)) { in riscv_iommu_spa_fetch() 294 iotlb->target_as = &s->trap_as; in riscv_iommu_spa_fetch() 295 iotlb->translated_addr = iotlb->iova; in riscv_iommu_spa_fetch() 296 iotlb->addr_mask = ~TARGET_PAGE_MASK; in riscv_iommu_spa_fetch() 302 iotlb->translated_addr = iotlb->iova; in riscv_iommu_spa_fetch() 303 iotlb->addr_mask = ~TARGET_PAGE_MASK; in riscv_iommu_spa_fetch() 305 iotlb->perm = IOMMU_RW; in riscv_iommu_spa_fetch() 379 addr = (en_s && en_g) ? satp : iotlb->iova; in riscv_iommu_spa_fetch() [all …]
|
H A D | trace-events | 11 riscv_iommu_notifier_add(const char *id) "%s: dev-iotlb notifier added" 12 riscv_iommu_notifier_del(const char *id) "%s: dev-iotlb notifier removed" 16 riscv_iommu_ats_inval(const char *id) "%s: dev-iotlb invalidate" 17 riscv_iommu_ats_prgr(const char *id) "%s: dev-iotlb page request group response"
|
/openbmc/qemu/hw/virtio/ |
H A D | vhost-vdpa.c | 103 msg.iotlb.iova = iova; in vhost_vdpa_dma_map() 104 msg.iotlb.size = size; in vhost_vdpa_dma_map() 105 msg.iotlb.uaddr = (uint64_t)(uintptr_t)vaddr; in vhost_vdpa_dma_map() 106 msg.iotlb.perm = readonly ? VHOST_ACCESS_RO : VHOST_ACCESS_RW; in vhost_vdpa_dma_map() 107 msg.iotlb.type = VHOST_IOTLB_UPDATE; in vhost_vdpa_dma_map() 109 trace_vhost_vdpa_dma_map(s, fd, msg.type, msg.asid, msg.iotlb.iova, in vhost_vdpa_dma_map() 110 msg.iotlb.size, msg.iotlb.uaddr, msg.iotlb.perm, in vhost_vdpa_dma_map() 111 msg.iotlb.type); in vhost_vdpa_dma_map() 135 msg.iotlb.iova = iova; in vhost_vdpa_dma_unmap() 136 msg.iotlb.size = size; in vhost_vdpa_dma_unmap() [all …]
|
H A D | vhost-backend.c | 261 vhost_backend_handle_iotlb_msg(dev, &msg.iotlb); in vhost_kernel_iotlb_read() 276 vhost_backend_handle_iotlb_msg(dev, &msg.iotlb); in vhost_kernel_iotlb_read() 288 msg.iotlb = *imsg; in vhost_kernel_send_device_iotlb_msg() 298 msg.iotlb = *imsg; in vhost_kernel_send_device_iotlb_msg()
|
H A D | vhost.c | 228 IOMMUTLBEntry iotlb; in vhost_sync_dirty_bitmap() local 234 iotlb = address_space_get_iotlb_entry(dev->vdev->dma_as, in vhost_sync_dirty_bitmap() 240 if (!iotlb.target_as) { in vhost_sync_dirty_bitmap() 247 offset = used_phys & iotlb.addr_mask; in vhost_sync_dirty_bitmap() 248 phys = iotlb.translated_addr + offset; in vhost_sync_dirty_bitmap() 254 s = iotlb.addr_mask - offset; in vhost_sync_dirty_bitmap() 862 static void vhost_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb) in vhost_iommu_unmap_notify() argument 866 hwaddr iova = iotlb->iova + iommu->iommu_offset; in vhost_iommu_unmap_notify() 869 iotlb->addr_mask + 1)) { in vhost_iommu_unmap_notify() 1212 IOMMUTLBEntry iotlb; in vhost_device_iotlb_miss() local [all …]
|
/openbmc/linux/drivers/vdpa/vdpa_user/ |
H A D | iova_domain.c | 35 ret = vhost_iotlb_add_range_ctx(domain->iotlb, start, last, in vduse_iotlb_add_range() 51 while ((map = vhost_iotlb_itree_first(domain->iotlb, start, last))) { in vduse_iotlb_del_range() 55 vhost_iotlb_map_free(domain->iotlb, map); in vduse_iotlb_del_range() 60 struct vhost_iotlb *iotlb) in vduse_domain_set_map() argument 70 for (map = vhost_iotlb_itree_first(iotlb, start, last); map; in vduse_domain_set_map() 90 struct vhost_iotlb *iotlb) in vduse_domain_clear_map() argument 96 for (map = vhost_iotlb_itree_first(iotlb, start, last); map; in vduse_domain_clear_map() 198 map = vhost_iotlb_itree_first(domain->iotlb, start, last); in vduse_domain_get_coherent_page() 468 map = vhost_iotlb_itree_first(domain->iotlb, (u64)dma_addr, in vduse_domain_free_coherent() 478 vhost_iotlb_map_free(domain->iotlb, map); in vduse_domain_free_coherent() [all …]
|
H A D | iova_domain.h | 34 struct vhost_iotlb *iotlb; member 42 struct vhost_iotlb *iotlb); 45 struct vhost_iotlb *iotlb);
|
/openbmc/qemu/hw/vfio/ |
H A D | common.c | 258 static bool vfio_get_xlat_addr(IOMMUTLBEntry *iotlb, void **vaddr, in vfio_get_xlat_addr() argument 264 ret = memory_get_xlat_addr(iotlb, vaddr, ram_addr, read_only, in vfio_get_xlat_addr() 288 static void vfio_iommu_map_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb) in vfio_iommu_map_notify() argument 292 hwaddr iova = iotlb->iova + giommu->iommu_offset; in vfio_iommu_map_notify() 297 trace_vfio_iommu_map_notify(iotlb->perm == IOMMU_NONE ? "UNMAP" : "MAP", in vfio_iommu_map_notify() 298 iova, iova + iotlb->addr_mask); in vfio_iommu_map_notify() 300 if (iotlb->target_as != &address_space_memory) { in vfio_iommu_map_notify() 302 iotlb->target_as->name ? iotlb->target_as->name : "none"); in vfio_iommu_map_notify() 309 if ((iotlb->perm & IOMMU_RW) != IOMMU_NONE) { in vfio_iommu_map_notify() 312 if (!vfio_get_xlat_addr(iotlb, &vaddr, NULL, &read_only, &local_err)) { in vfio_iommu_map_notify() [all …]
|
H A D | container-base.c | 30 IOMMUTLBEntry *iotlb) in vfio_container_dma_unmap() argument 35 return vioc->dma_unmap(bcontainer, iova, size, iotlb); in vfio_container_dma_unmap()
|
H A D | container.c | 64 IOMMUTLBEntry *iotlb) in vfio_dma_unmap_bitmap() argument 103 iotlb->translated_addr, vbmap.pages); in vfio_dma_unmap_bitmap() 120 IOMMUTLBEntry *iotlb) in vfio_legacy_dma_unmap() argument 134 if (iotlb && vfio_devices_all_running_and_mig_active(bcontainer)) { in vfio_legacy_dma_unmap() 137 return vfio_dma_unmap_bitmap(container, iova, size, iotlb); in vfio_legacy_dma_unmap() 168 iotlb->translated_addr, &local_err); in vfio_legacy_dma_unmap()
|
/openbmc/qemu/hw/arm/ |
H A D | smmu-common.c | 87 entry = g_hash_table_lookup(bs->iotlb, &key); in smmu_iotlb_lookup_all_levels() 145 if (g_hash_table_size(bs->iotlb) >= SMMU_IOTLB_MAX_SIZE) { in smmu_iotlb_insert() 153 g_hash_table_insert(bs->iotlb, key, new); in smmu_iotlb_insert() 159 g_hash_table_remove_all(s->iotlb); in smmu_iotlb_inv_all() 237 if (g_hash_table_remove(s->iotlb, &key)) { in smmu_iotlb_inv_iova() 251 g_hash_table_foreach_remove(s->iotlb, in smmu_iotlb_inv_iova() 269 if (g_hash_table_remove(s->iotlb, &key)) { in smmu_iotlb_inv_ipa() 279 g_hash_table_foreach_remove(s->iotlb, in smmu_iotlb_inv_ipa() 292 g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_asid_vmid, &info); in smmu_iotlb_inv_asid_vmid() 298 g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_vmid, &vmid); in smmu_iotlb_inv_vmid() [all …]
|
/openbmc/qemu/include/standard-headers/linux/ |
H A D | vhost_types.h | 99 struct vhost_iotlb_msg iotlb; member 108 struct vhost_iotlb_msg iotlb; member
|
/openbmc/linux/include/uapi/linux/ |
H A D | vhost_types.h | 99 struct vhost_iotlb_msg iotlb; member 108 struct vhost_iotlb_msg iotlb; member
|
/openbmc/qemu/include/hw/vfio/ |
H A D | vfio-container-base.h | 78 IOMMUTLBEntry *iotlb); 118 IOMMUTLBEntry *iotlb);
|
/openbmc/qemu/hw/i386/ |
H A D | trace-events | 12 vtd_inv_desc_iotlb_global(void) "iotlb invalidate global" 13 vtd_inv_desc_iotlb_domain(uint16_t domain) "iotlb invalidate whole domain 0x%"PRIx16 14 vtd_inv_desc_iotlb_pages(uint16_t domain, uint64_t addr, uint8_t mask) "iotlb invalidate domain 0x%… 15 vtd_inv_desc_iotlb_pasid_pages(uint16_t domain, uint64_t addr, uint8_t mask, uint32_t pasid) "iotlb… 16 vtd_inv_desc_iotlb_pasid(uint16_t domain, uint32_t pasid) "iotlb invalidate domain 0x%"PRIx16" pasi… 74 … bus, uint8_t slot, uint8_t func, uint64_t gpa, uint64_t txaddr) " update iotlb domid 0x%"PRIx16" … 98 amdvi_iotlb_hit(uint8_t bus, uint8_t slot, uint8_t func, uint64_t addr, uint64_t txaddr) "hit iotlb…
|
/openbmc/qemu/system/ |
H A D | physmem.c | 431 IOMMUTLBEntry iotlb; in address_space_translate_iommu() local 437 iotlb = imrc->translate(iommu_mr, addr, is_write ? in address_space_translate_iommu() 440 if (!(iotlb.perm & (1 << is_write))) { in address_space_translate_iommu() 444 addr = ((iotlb.translated_addr & ~iotlb.addr_mask) in address_space_translate_iommu() 445 | (addr & iotlb.addr_mask)); in address_space_translate_iommu() 446 page_mask &= iotlb.addr_mask; in address_space_translate_iommu() 447 *plen_out = MIN(*plen_out, (addr | iotlb.addr_mask) - addr + 1); in address_space_translate_iommu() 448 *target_as = iotlb.target_as; in address_space_translate_iommu() 451 address_space_to_dispatch(iotlb.target_as), addr, xlat, in address_space_translate_iommu() 590 static void tcg_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb) in tcg_iommu_unmap_notify() argument [all …]
|