Home
last modified time | relevance | path

Searched refs:ictx (Results 1 – 25 of 35) sorted by relevance

12

/linux/drivers/iommu/iommufd/
H A Dvfio_compat.c15 static struct iommufd_ioas *get_compat_ioas(struct iommufd_ctx *ictx) in get_compat_ioas() argument
19 xa_lock(&ictx->objects); in get_compat_ioas()
20 if (!ictx->vfio_ioas || !iommufd_lock_obj(&ictx->vfio_ioas->obj)) in get_compat_ioas()
22 ioas = ictx->vfio_ioas; in get_compat_ioas()
24 xa_unlock(&ictx->objects); in get_compat_ioas()
36 int iommufd_vfio_compat_ioas_get_id(struct iommufd_ctx *ictx, u32 *out_ioas_id) in iommufd_vfio_compat_ioas_get_id() argument
40 ioas = get_compat_ioas(ictx); in iommufd_vfio_compat_ioas_get_id()
44 iommufd_put_object(ictx, &ioas->obj); in iommufd_vfio_compat_ioas_get_id()
55 int iommufd_vfio_compat_set_no_iommu(struct iommufd_ctx *ictx) in iommufd_vfio_compat_set_no_iommu() argument
59 xa_lock(&ictx->objects); in iommufd_vfio_compat_set_no_iommu()
[all …]
H A Dmain.c34 struct iommufd_object *_iommufd_object_alloc(struct iommufd_ctx *ictx, in _iommufd_object_alloc() argument
56 rc = xa_alloc(&ictx->objects, &obj->id, XA_ZERO_ENTRY, xa_limit_31b, in _iommufd_object_alloc()
85 new_obj = _iommufd_object_alloc(ucmd->ictx, size, type); in _iommufd_object_alloc_ucmd()
102 void iommufd_object_finalize(struct iommufd_ctx *ictx, in iommufd_object_finalize() argument
105 XA_STATE(xas, &ictx->objects, obj->id); in iommufd_object_finalize()
108 xa_lock(&ictx->objects); in iommufd_object_finalize()
110 xa_unlock(&ictx->objects); in iommufd_object_finalize()
116 void iommufd_object_abort(struct iommufd_ctx *ictx, struct iommufd_object *obj) in iommufd_object_abort() argument
118 XA_STATE(xas, &ictx->objects, obj->id); in iommufd_object_abort()
121 xa_lock(&ictx->objects); in iommufd_object_abort()
[all …]
H A Dioas.c24 struct iommufd_ioas *iommufd_ioas_alloc(struct iommufd_ctx *ictx) in iommufd_ioas_alloc() argument
28 ioas = iommufd_object_alloc(ictx, ioas, IOMMUFD_OBJ_IOAS); in iommufd_ioas_alloc()
47 ioas = iommufd_ioas_alloc(ucmd->ictx); in iommufd_ioas_alloc_ioctl()
56 down_read(&ucmd->ictx->ioas_creation_lock); in iommufd_ioas_alloc_ioctl()
57 iommufd_object_finalize(ucmd->ictx, &ioas->obj); in iommufd_ioas_alloc_ioctl()
58 up_read(&ucmd->ictx->ioas_creation_lock); in iommufd_ioas_alloc_ioctl()
62 iommufd_object_abort_and_destroy(ucmd->ictx, &ioas->obj); in iommufd_ioas_alloc_ioctl()
78 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); in iommufd_ioas_iova_ranges()
112 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_ioas_iova_ranges()
158 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); in iommufd_ioas_allow_iovas()
[all …]
H A Diommufd_private.h39 int iommufd_sw_msi_install(struct iommufd_ctx *ictx,
108 int iopt_map_user_pages(struct iommufd_ctx *ictx, struct io_pagetable *iopt,
112 int iopt_map_file_pages(struct iommufd_ctx *ictx, struct io_pagetable *iopt,
150 struct iommufd_ctx *ictx; member
157 int iommufd_vfio_ioctl(struct iommufd_ctx *ictx, unsigned int cmd,
186 struct iommufd_object *iommufd_get_object(struct iommufd_ctx *ictx, u32 id,
188 static inline void iommufd_put_object(struct iommufd_ctx *ictx, in iommufd_put_object() argument
197 wake_up_interruptible_all(&ictx->destroy_wait); in iommufd_put_object()
200 void iommufd_object_abort(struct iommufd_ctx *ictx, struct iommufd_object *obj);
201 void iommufd_object_abort_and_destroy(struct iommufd_ctx *ictx,
[all …]
H A Ddriver.c39 int _iommufd_alloc_mmap(struct iommufd_ctx *ictx, struct iommufd_object *owner, in _iommufd_alloc_mmap() argument
60 rc = mtree_alloc_range(&ictx->mt_mmap, &startp, immap, immap->length, in _iommufd_alloc_mmap()
75 void _iommufd_destroy_mmap(struct iommufd_ctx *ictx, in _iommufd_destroy_mmap() argument
80 immap = mtree_erase(&ictx->mt_mmap, offset); in _iommufd_destroy_mmap()
185 iommufd_sw_msi_get_map(struct iommufd_ctx *ictx, phys_addr_t msi_addr, in iommufd_sw_msi_get_map() argument
191 lockdep_assert_held(&ictx->sw_msi_lock); in iommufd_sw_msi_get_map()
193 list_for_each_entry(cur, &ictx->sw_msi_list, sw_msi_item) { in iommufd_sw_msi_get_map()
201 if (ictx->sw_msi_id >= in iommufd_sw_msi_get_map()
212 cur->id = ictx->sw_msi_id++; in iommufd_sw_msi_get_map()
213 list_add_tail(&cur->sw_msi_item, &ictx->sw_msi_list); in iommufd_sw_msi_get_map()
[all …]
H A Ddevice.c33 xa_cmpxchg(&igroup->ictx->groups, iommu_group_id(igroup->group), igroup, in iommufd_group_release()
66 static struct iommufd_group *iommufd_get_group(struct iommufd_ctx *ictx, in iommufd_get_group() argument
81 xa_lock(&ictx->groups); in iommufd_get_group()
82 igroup = xa_load(&ictx->groups, id); in iommufd_get_group()
84 xa_unlock(&ictx->groups); in iommufd_get_group()
88 xa_unlock(&ictx->groups); in iommufd_get_group()
107 new_igroup->ictx = ictx; in iommufd_get_group()
114 xa_lock(&ictx->groups); in iommufd_get_group()
116 igroup = __xa_cmpxchg(&ictx->groups, id, cur_igroup, new_igroup, in iommufd_get_group()
119 xa_unlock(&ictx->groups); in iommufd_get_group()
[all …]
H A Dviommu.c80 viommu->ictx = ucmd->ictx; in iommufd_viommu_alloc_ioctl()
107 iommufd_put_object(ucmd->ictx, &hwpt_paging->common.obj); in iommufd_viommu_alloc_ioctl()
109 iommufd_put_object(ucmd->ictx, &idev->obj); in iommufd_viommu_alloc_ioctl()
135 struct iommufd_ctx *ictx = idev->ictx; in iommufd_vdevice_destroy() local
140 iommufd_put_object(ictx, &idev->obj); in iommufd_vdevice_destroy()
198 ucmd->ictx, vdev_size, IOMMUFD_OBJ_VDEVICE); in iommufd_vdevice_alloc_ioctl()
237 iommufd_object_finalize(ucmd->ictx, &vdev->obj); in iommufd_vdevice_alloc_ioctl()
241 iommufd_object_abort_and_destroy(ucmd->ictx, &vdev->obj); in iommufd_vdevice_alloc_ioctl()
246 iommufd_put_object(ucmd->ictx, &idev->obj); in iommufd_vdevice_alloc_ioctl()
248 iommufd_put_object(ucmd->ictx, &viommu->obj); in iommufd_vdevice_alloc_ioctl()
[all …]
H A Deventq.c377 iommufd_ctx_put(eventq->ictx); in iommufd_eventq_fops_release()
392 struct iommufd_ctx *ictx, in iommufd_eventq_init() argument
406 eventq->ictx = ictx; in iommufd_eventq_init()
407 iommufd_ctx_get(eventq->ictx); in iommufd_eventq_init()
436 ucmd->ictx, &iommufd_fault_fops); in iommufd_fault_alloc()
500 veventq = __iommufd_object_alloc(ucmd->ictx, veventq, in iommufd_veventq_alloc()
516 ucmd->ictx, &iommufd_veventq_fops); in iommufd_veventq_alloc()
529 iommufd_object_finalize(ucmd->ictx, &veventq->common.obj); in iommufd_veventq_alloc()
536 iommufd_object_abort_and_destroy(ucmd->ictx, &veventq->common.obj); in iommufd_veventq_alloc()
539 iommufd_put_object(ucmd->ictx, &viommu->obj); in iommufd_veventq_alloc()
/linux/fs/netfs/
H A Dlocking.c32 static int netfs_block_o_direct(struct netfs_inode *ictx) in netfs_block_o_direct() argument
34 if (!test_bit(NETFS_ICTX_ODIRECT, &ictx->flags)) in netfs_block_o_direct()
36 clear_bit(NETFS_ICTX_ODIRECT, &ictx->flags); in netfs_block_o_direct()
37 return netfs_inode_dio_wait_interruptible(&ictx->inode); in netfs_block_o_direct()
59 struct netfs_inode *ictx = netfs_inode(inode); in netfs_start_io_read() local
64 if (test_bit(NETFS_ICTX_ODIRECT, &ictx->flags) == 0) in netfs_start_io_read()
71 if (netfs_block_o_direct(ictx) < 0) { in netfs_start_io_read()
104 struct netfs_inode *ictx = netfs_inode(inode); in netfs_start_io_write() local
108 if (netfs_block_o_direct(ictx) < 0) { in netfs_start_io_write()
134 struct netfs_inode *ictx = netfs_inode(inode); in netfs_block_buffered() local
[all …]
H A Dwrite_issue.c96 struct netfs_inode *ictx; in netfs_create_write_req() local
108 ictx = netfs_inode(wreq->inode); in netfs_create_write_req()
109 if (is_cacheable && netfs_is_cache_enabled(ictx)) in netfs_create_write_req()
110 fscache_begin_write_operation(&wreq->cache_resources, netfs_i_cookie(ictx)); in netfs_create_write_req()
118 wreq->io_streams[0].prepare_write = ictx->ops->prepare_write; in netfs_create_write_req()
119 wreq->io_streams[0].issue_write = ictx->ops->issue_write; in netfs_create_write_req()
553 struct netfs_inode *ictx = netfs_inode(mapping->host); in netfs_writepages() local
558 if (!mutex_trylock(&ictx->wb_lock)) { in netfs_writepages()
564 mutex_lock(&ictx->wb_lock); in netfs_writepages()
601 mutex_unlock(&ictx->wb_lock); in netfs_writepages()
[all …]
H A Dread_single.c30 struct netfs_inode *ictx = netfs_inode(inode); in netfs_single_mark_inode_dirty() local
31 bool cache_only = test_bit(NETFS_ICTX_SINGLE_NO_UPLOAD, &ictx->flags); in netfs_single_mark_inode_dirty()
50 fscache_use_cookie(netfs_i_cookie(ictx), true); in netfs_single_mark_inode_dirty()
169 struct netfs_inode *ictx = netfs_inode(inode); in netfs_read_single() local
177 ret = netfs_single_begin_cache_read(rreq, ictx); in netfs_read_single()
H A Ddirect_write.c129 struct netfs_inode *ictx = netfs_inode(inode); in netfs_unbuffered_write_iter() local
176 if (end > ictx->zero_point) in netfs_unbuffered_write_iter()
177 ictx->zero_point = end; in netfs_unbuffered_write_iter()
179 fscache_invalidate(netfs_i_cookie(ictx), NULL, i_size_read(inode), in netfs_unbuffered_write_iter()
H A Dwrite_collect.c60 struct netfs_inode *ictx = netfs_inode(folio->mapping->host); in netfs_folio_written_back() local
72 if (fend > ictx->zero_point) in netfs_folio_written_back()
73 ictx->zero_point = fend; in netfs_folio_written_back()
358 struct netfs_inode *ictx = netfs_inode(wreq->inode); in netfs_write_collection() local
395 ictx->ops->invalidate_cache) { in netfs_write_collection()
399 ictx->ops->invalidate_cache(wreq); in netfs_write_collection()
405 netfs_update_i_size(ictx, &ictx->inode, wreq->start, wreq->transferred); in netfs_write_collection()
H A Dbuffered_read.c218 struct netfs_inode *ictx = netfs_inode(rreq->inode); in netfs_read_to_pagecache() local
240 unsigned long long zp = umin(ictx->zero_point, rreq->i_size); in netfs_read_to_pagecache()
256 subreq->start, ictx->zero_point, rreq->i_size); in netfs_read_to_pagecache()
342 struct netfs_inode *ictx = netfs_inode(ractl->mapping->host); in netfs_readahead() local
354 ret = netfs_begin_cache_read(rreq, ictx); in netfs_readahead()
787 struct netfs_inode *ictx = netfs_inode(inode); in netfs_buffered_read_iter() local
791 test_bit(NETFS_ICTX_UNBUFFERED, &ictx->flags))) in netfs_buffered_read_iter()
826 struct netfs_inode *ictx = netfs_inode(iocb->ki_filp->f_mapping->host); in netfs_file_read_iter() local
829 test_bit(NETFS_ICTX_UNBUFFERED, &ictx->flags)) in netfs_file_read_iter()
H A Dbuffered_write.c473 struct netfs_inode *ictx = netfs_inode(inode); in netfs_file_write_iter() local
482 test_bit(NETFS_ICTX_UNBUFFERED, &ictx->flags)) in netfs_file_write_iter()
512 struct netfs_inode *ictx = netfs_inode(inode); in netfs_page_mkwrite() local
558 set_bit(NETFS_ICTX_MODIFIED_ATTR, &ictx->flags); in netfs_page_mkwrite()
559 if (ictx->ops->post_modify) in netfs_page_mkwrite()
560 ictx->ops->post_modify(inode); in netfs_page_mkwrite()
H A Dobjects.c121 struct netfs_inode *ictx = netfs_inode(rreq->inode); in netfs_deinit_request() local
148 if (atomic_dec_and_test(&ictx->io_count)) in netfs_deinit_request()
149 wake_up_var(&ictx->io_count); in netfs_deinit_request()
/linux/crypto/
H A Dessiv.c268 static int essiv_init_tfm(struct essiv_instance_ctx *ictx, in essiv_init_tfm() argument
275 essiv_cipher = crypto_alloc_cipher(ictx->essiv_cipher_name, 0, 0); in essiv_init_tfm()
279 hash = crypto_alloc_shash(ictx->shash_driver_name, 0, 0); in essiv_init_tfm()
298 struct essiv_instance_ctx *ictx = skcipher_instance_ctx(inst); in essiv_skcipher_init_tfm() local
303 skcipher = crypto_spawn_skcipher(&ictx->u.skcipher_spawn); in essiv_skcipher_init_tfm()
310 err = essiv_init_tfm(ictx, tctx); in essiv_skcipher_init_tfm()
323 struct essiv_instance_ctx *ictx = aead_instance_ctx(inst); in essiv_aead_init_tfm() local
332 aead = crypto_spawn_aead(&ictx->u.aead_spawn); in essiv_aead_init_tfm()
343 err = essiv_init_tfm(ictx, tctx); in essiv_aead_init_tfm()
373 struct essiv_instance_ctx *ictx = skcipher_instance_ctx(inst); in essiv_skcipher_free_instance() local
[all …]
H A Dauthenc.c114 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in authenc_geniv_ahash_finish() local
116 struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); in authenc_geniv_ahash_finish()
150 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_genicv() local
153 struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); in crypto_authenc_genicv()
192 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_encrypt() local
197 ictx->reqoff); in crypto_authenc_encrypt()
234 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt_tail() local
236 struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff); in crypto_authenc_decrypt_tail()
238 ictx->reqoff); in crypto_authenc_decrypt_tail()
284 struct authenc_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_authenc_decrypt() local
[all …]
H A Dhctr2.c276 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_init_tfm() local
282 xctr = crypto_spawn_skcipher(&ictx->xctr_spawn); in hctr2_init_tfm()
286 blockcipher = crypto_spawn_cipher(&ictx->blockcipher_spawn); in hctr2_init_tfm()
318 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_free_instance() local
320 crypto_drop_cipher(&ictx->blockcipher_spawn); in hctr2_free_instance()
321 crypto_drop_skcipher(&ictx->xctr_spawn); in hctr2_free_instance()
331 struct hctr2_instance_ctx *ictx; in hctr2_create_common() local
341 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in hctr2_create_common()
344 ictx = skcipher_instance_ctx(inst); in hctr2_create_common()
347 err = crypto_grab_skcipher(&ictx->xctr_spawn, in hctr2_create_common()
[all …]
/linux/drivers/vfio/
H A Diommufd.c14 struct iommufd_ctx *ictx) in vfio_iommufd_device_has_compat_ioas() argument
18 return !iommufd_vfio_compat_ioas_get_id(ictx, &ioas_id); in vfio_iommufd_device_has_compat_ioas()
24 struct iommufd_ctx *ictx = df->iommufd; in vfio_df_iommufd_bind() local
32 return vdev->ops->bind_iommufd(vdev, ictx, &df->devid); in vfio_df_iommufd_bind()
36 struct iommufd_ctx *ictx) in vfio_iommufd_compat_attach_ioas() argument
47 ret = iommufd_vfio_compat_ioas_get_id(ictx, &ioas_id); in vfio_iommufd_compat_attach_ioas()
89 int vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx) in vfio_iommufd_get_dev_id() argument
94 if (vfio_iommufd_device_ictx(vdev) == ictx) in vfio_iommufd_get_dev_id()
101 if (iommufd_ctx_has_group(ictx, group)) in vfio_iommufd_get_dev_id()
118 struct iommufd_ctx *ictx, u32 *out_device_id) in vfio_iommufd_physical_bind() argument
[all …]
H A Dvfio.h322 struct iommufd_ctx *ictx);
326 struct iommufd_ctx *ictx);
330 struct iommufd_ctx *ictx) in vfio_iommufd_device_has_compat_ioas() argument
346 struct iommufd_ctx *ictx) in vfio_iommufd_compat_attach_ioas() argument
/linux/include/linux/
H A Dvfio.h121 struct iommufd_ctx *ictx, u32 *out_device_id);
150 int vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx);
152 struct iommufd_ctx *ictx, u32 *out_device_id);
161 struct iommufd_ctx *ictx, u32 *out_device_id);
173 vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx) in vfio_iommufd_get_dev_id() argument
179 ((int (*)(struct vfio_device *vdev, struct iommufd_ctx *ictx, \
192 ((int (*)(struct vfio_device *vdev, struct iommufd_ctx *ictx, \
/linux/drivers/crypto/allwinner/sun4i-ss/
H A Dsun4i-ss-hash.c88 const struct md5_state *ictx = in; in sun4i_hash_import_md5() local
93 op->byte_count = ictx->byte_count & ~0x3F; in sun4i_hash_import_md5()
94 op->len = ictx->byte_count & 0x3F; in sun4i_hash_import_md5()
96 memcpy(op->buf, ictx->block, op->len); in sun4i_hash_import_md5()
99 op->hash[i] = ictx->hash[i]; in sun4i_hash_import_md5()
131 const struct sha1_state *ictx = in; in sun4i_hash_import_sha1() local
136 op->byte_count = ictx->count & ~0x3F; in sun4i_hash_import_sha1()
137 op->len = ictx->count & 0x3F; in sun4i_hash_import_sha1()
139 memcpy(op->buf, ictx->buffer, op->len); in sun4i_hash_import_sha1()
142 op->hash[i] = ictx->state[i]; in sun4i_hash_import_sha1()
/linux/drivers/dma/idxd/
H A Dcdev.c36 static struct idxd_cdev_context ictx[IDXD_TYPE_MAX] = { variable
164 cdev_ctx = &ictx[wq->idxd->data->type]; in idxd_cdev_dev_release()
529 return MAJOR(ictx[idxd->data->type].devt); in idxd_cdev_get_major()
549 cdev_ctx = &ictx[wq->idxd->data->type]; in idxd_wq_add_cdev()
692 ida_init(&ictx[i].minor_ida); in idxd_cdev_register()
693 rc = alloc_chrdev_region(&ictx[i].devt, 0, MINORMASK, in idxd_cdev_register()
694 ictx[i].name); in idxd_cdev_register()
703 unregister_chrdev_region(ictx[i].devt, MINORMASK); in idxd_cdev_register()
713 unregister_chrdev_region(ictx[i].devt, MINORMASK); in idxd_cdev_remove()
714 ida_destroy(&ictx[i].minor_ida); in idxd_cdev_remove()
/linux/drivers/net/ethernet/broadcom/
H A Dcnic.c1706 struct iscsi_context *ictx; in cnic_setup_bnx2x_ctx() local
1717 ictx = cnic_get_bnx2x_ctx(dev, cid, 1, &context_addr); in cnic_setup_bnx2x_ctx()
1718 if (ictx == NULL) in cnic_setup_bnx2x_ctx()
1723 ictx->xstorm_ag_context.hq_prod = 1; in cnic_setup_bnx2x_ctx()
1725 ictx->xstorm_st_context.iscsi.first_burst_length = in cnic_setup_bnx2x_ctx()
1727 ictx->xstorm_st_context.iscsi.max_send_pdu_length = in cnic_setup_bnx2x_ctx()
1729 ictx->xstorm_st_context.iscsi.sq_pbl_base.lo = in cnic_setup_bnx2x_ctx()
1731 ictx->xstorm_st_context.iscsi.sq_pbl_base.hi = in cnic_setup_bnx2x_ctx()
1733 ictx->xstorm_st_context.iscsi.sq_curr_pbe.lo = req2->sq_first_pte.hi; in cnic_setup_bnx2x_ctx()
1734 ictx->xstorm_st_context.iscsi.sq_curr_pbe.hi = req2->sq_first_pte.lo; in cnic_setup_bnx2x_ctx()
[all …]

12