| /linux-6.15/drivers/iommu/iommufd/ |
| H A D | viommu.c | 19 struct iommu_viommu_alloc *cmd = ucmd->cmd; in iommufd_viommu_alloc_ioctl() 29 idev = iommufd_get_device(ucmd, cmd->dev_id); in iommufd_viommu_alloc_ioctl() 51 ucmd->ictx, cmd->type); in iommufd_viommu_alloc_ioctl() 59 viommu->ictx = ucmd->ictx; in iommufd_viommu_alloc_ioctl() 72 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_viommu_alloc_ioctl() 83 iommufd_put_object(ucmd->ictx, &idev->obj); in iommufd_viommu_alloc_ioctl() 101 struct iommu_vdevice_alloc *cmd = ucmd->cmd; in iommufd_vdevice_alloc_ioctl() 116 idev = iommufd_get_device(ucmd, cmd->dev_id); in iommufd_vdevice_alloc_ioctl() 146 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_vdevice_alloc_ioctl() 155 iommufd_put_object(ucmd->ictx, &idev->obj); in iommufd_vdevice_alloc_ioctl() [all …]
|
| H A D | ioas.c | 40 struct iommu_ioas_alloc *cmd = ucmd->cmd; in iommufd_ioas_alloc_ioctl() 47 ioas = iommufd_ioas_alloc(ucmd->ictx); in iommufd_ioas_alloc_ioctl() 52 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_ioas_alloc_ioctl() 56 down_read(&ucmd->ictx->ioas_creation_lock); in iommufd_ioas_alloc_ioctl() 58 up_read(&ucmd->ictx->ioas_creation_lock); in iommufd_ioas_alloc_ioctl() 112 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_ioas_iova_ranges() 252 struct iommu_ioas_map *cmd = ucmd->cmd; in iommufd_ioas_map() 291 struct iommu_ioas_copy *cmd = ucmd->cmd; in iommufd_ioas_copy() 348 struct iommu_ioas_unmap *cmd = ucmd->cmd; in iommufd_ioas_unmap() 522 struct iommufd_ctx *ictx = ucmd->ictx; in iommufd_ioas_change_process() [all …]
|
| H A D | iommufd_private.h | 147 if (copy_to_user(ucmd->ubuffer, ucmd->cmd, in iommufd_ucmd_respond() 148 min_t(size_t, ucmd->user_size, cmd_len))) in iommufd_ucmd_respond() 279 int iommufd_ioas_map(struct iommufd_ucmd *ucmd); 282 int iommufd_ioas_copy(struct iommufd_ucmd *ucmd); 283 int iommufd_ioas_unmap(struct iommufd_ucmd *ucmd); 284 int iommufd_ioas_option(struct iommufd_ucmd *ucmd); 288 int iommufd_vfio_ioas(struct iommufd_ucmd *ucmd); 384 int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd); 442 int iommufd_get_hw_info(struct iommufd_ucmd *ucmd); 506 int iommufd_fault_alloc(struct iommufd_ucmd *ucmd); [all …]
|
| H A D | selftest.c | 120 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_test_syz_conv_iova_id() 983 sobj->idev.ictx = ucmd->ictx; in iommufd_test_mock_domain() 1355 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_create_access() 1376 ucmd->ictx, in iommufd_test_create_access() 1449 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_access_pages() 1544 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_access_rw() 1604 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_dirty() 1766 hwpt = iommufd_get_hwpt(ucmd, hwpt_id); in iommufd_test_pasid_check_hwpt() 1857 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test() 1872 ucmd, cmd->id, cmd->check_map.iova, in iommufd_test() [all …]
|
| H A D | hw_pagetable.c | 336 int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd) in iommufd_hwpt_alloc() argument 338 struct iommu_hwpt_alloc *cmd = ucmd->cmd; in iommufd_hwpt_alloc() 356 idev = iommufd_get_device(ucmd, cmd->dev_id); in iommufd_hwpt_alloc() 383 ucmd->ictx, in iommufd_hwpt_alloc() 416 fault = iommufd_get_fault(ucmd, cmd->fault_id); in iommufd_hwpt_alloc() 428 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_hwpt_alloc() 440 iommufd_put_object(ucmd->ictx, pt_obj); in iommufd_hwpt_alloc() 442 iommufd_put_object(ucmd->ictx, &idev->obj); in iommufd_hwpt_alloc() 496 struct iommu_hwpt_invalidate *cmd = ucmd->cmd; in iommufd_hwpt_invalidate() 550 iommufd_put_object(ucmd->ictx, pt_obj); in iommufd_hwpt_invalidate() [all …]
|
| H A D | main.c | 280 struct iommu_option *cmd = ucmd->cmd; in iommufd_option() 291 rc = iommufd_ioas_option(ucmd); in iommufd_option() 392 struct iommufd_ucmd ucmd = {}; in iommufd_fops_ioctl() local 402 ucmd.ictx = ictx; in iommufd_fops_ioctl() 403 ucmd.ubuffer = (void __user *)arg; in iommufd_fops_ioctl() 404 ret = get_user(ucmd.user_size, (u32 __user *)ucmd.ubuffer); in iommufd_fops_ioctl() 411 if (ucmd.user_size < op->min_size) in iommufd_fops_ioctl() 414 ucmd.cmd = &buf; in iommufd_fops_ioctl() 415 ret = copy_struct_from_user(ucmd.cmd, op->size, ucmd.ubuffer, in iommufd_fops_ioctl() 416 ucmd.user_size); in iommufd_fops_ioctl() [all …]
|
| H A D | vfio_compat.c | 123 int iommufd_vfio_ioas(struct iommufd_ucmd *ucmd) in iommufd_vfio_ioas() argument 125 struct iommu_vfio_ioas *cmd = ucmd->cmd; in iommufd_vfio_ioas() 132 ioas = get_compat_ioas(ucmd->ictx); in iommufd_vfio_ioas() 136 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_vfio_ioas() 143 xa_lock(&ucmd->ictx->objects); in iommufd_vfio_ioas() 144 ucmd->ictx->vfio_ioas = ioas; in iommufd_vfio_ioas() 145 xa_unlock(&ucmd->ictx->objects); in iommufd_vfio_ioas() 146 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_vfio_ioas() 150 xa_lock(&ucmd->ictx->objects); in iommufd_vfio_ioas() 151 ucmd->ictx->vfio_ioas = NULL; in iommufd_vfio_ioas() [all …]
|
| H A D | eventq.c | 466 int iommufd_fault_alloc(struct iommufd_ucmd *ucmd) in iommufd_fault_alloc() argument 468 struct iommu_fault_alloc *cmd = ucmd->cmd; in iommufd_fault_alloc() 485 ucmd->ictx, &iommufd_fault_fops); in iommufd_fault_alloc() 494 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_fault_alloc() 531 int iommufd_veventq_alloc(struct iommufd_ucmd *ucmd) in iommufd_veventq_alloc() argument 533 struct iommu_veventq_alloc *cmd = ucmd->cmd; in iommufd_veventq_alloc() 545 viommu = iommufd_get_viommu(ucmd, cmd->viommu_id); in iommufd_veventq_alloc() 556 veventq = __iommufd_object_alloc(ucmd->ictx, veventq, in iommufd_veventq_alloc() 572 ucmd->ictx, &iommufd_veventq_fops); in iommufd_veventq_alloc() 581 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_veventq_alloc() [all …]
|
| /linux-6.15/drivers/fwctl/ |
| H A D | main.c | 35 if (copy_to_user(ucmd->ubuffer, ucmd->cmd, in ucmd_respond() 59 struct fwctl_info *cmd = ucmd->cmd; in fwctl_cmd_info() 89 struct fwctl_rpc *cmd = ucmd->cmd; in fwctl_cmd_rpc() 173 struct fwctl_ucmd ucmd = {}; in fwctl_fops_ioctl() local 186 ucmd.uctx = uctx; in fwctl_fops_ioctl() 187 ucmd.cmd = &buf; in fwctl_fops_ioctl() 188 ucmd.ubuffer = (void __user *)arg; in fwctl_fops_ioctl() 189 ret = get_user(ucmd.user_size, (u32 __user *)ucmd.ubuffer); in fwctl_fops_ioctl() 196 ret = copy_struct_from_user(ucmd.cmd, op->size, ucmd.ubuffer, in fwctl_fops_ioctl() 197 ucmd.user_size); in fwctl_fops_ioctl() [all …]
|
| /linux-6.15/drivers/infiniband/hw/mana/ |
| H A D | wq.c | 14 struct mana_ib_create_wq ucmd = {}; in mana_ib_create_wq() local 18 if (udata->inlen < sizeof(ucmd)) in mana_ib_create_wq() 21 err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_wq() 32 ibdev_dbg(&mdev->ib_dev, "ucmd wq_buf_addr 0x%llx\n", ucmd.wq_buf_addr); in mana_ib_create_wq() 34 err = mana_ib_create_queue(mdev, ucmd.wq_buf_addr, ucmd.wq_buf_size, &wq->queue); in mana_ib_create_wq() 42 wq->wq_buf_size = ucmd.wq_buf_size; in mana_ib_create_wq()
|
| H A D | qp.c | 117 ret = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_qp_rss() 150 ucmd.rx_hash_function); in mana_ib_create_qp_rss() 155 port = ucmd.port; in mana_ib_create_qp_rss() 229 ucmd.rx_hash_key_len, in mana_ib_create_qp_rss() 230 ucmd.rx_hash_key); in mana_ib_create_qp_rss() 289 err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_qp_raw() 310 port = ucmd.port; in mana_ib_create_qp_raw() 327 ucmd.sq_buf_addr, ucmd.port); in mana_ib_create_qp_raw() 329 err = mana_ib_create_queue(mdev, ucmd.sq_buf_addr, ucmd.sq_buf_size, &qp->raw_sq); in mana_ib_create_qp_raw() 545 err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_rc_qp() [all …]
|
| H A D | cq.c | 16 struct mana_ib_create_cq ucmd = {}; in mana_ib_create_cq() local 34 err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_cq() 40 is_rnic_cq = !!(ucmd.flags & MANA_IB_CREATE_RNIC_CQ); in mana_ib_create_cq() 49 err = mana_ib_create_queue(mdev, ucmd.buf_addr, cq->cqe * COMP_ENTRY_SIZE, in mana_ib_create_cq()
|
| /linux-6.15/drivers/infiniband/hw/mthca/ |
| H A D | mthca_provider.c | 405 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) in mthca_create_srq() 410 ucmd.db_page); in mthca_create_srq() 474 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) in mthca_create_qp() 479 ucmd.sq_db_index, in mthca_create_qp() 480 ucmd.sq_db_page); in mthca_create_qp() 486 ucmd.rq_db_index, in mthca_create_qp() 596 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) in mthca_create_cq() 722 if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) { in mthca_resize_cq() 726 lkey = ucmd.lkey; in mthca_resize_cq() 848 ucmd.mr_attrs = 0; in mthca_reg_user_mr() [all …]
|
| /linux-6.15/drivers/infiniband/hw/mlx5/ |
| H A D | qp.c | 452 if (ucmd) { in set_rq_size() 454 if (ucmd->rq_wqe_shift > BITS_PER_BYTE * sizeof(ucmd->rq_wqe_shift)) in set_rq_size() 650 if (ucmd->sq_wqe_count && !is_power_of_2(ucmd->sq_wqe_count)) { in set_user_buf_size() 1706 void *ucmd; member 1718 struct mlx5_ib_create_qp_rss *ucmd = params->ucmd; in create_rss_raw_qp_tir() local 2075 struct mlx5_ib_create_qp *ucmd = params->ucmd; in create_dci() local 2236 struct mlx5_ib_create_qp *ucmd = params->ucmd; in create_user_qp() local 2736 struct mlx5_ib_create_qp *ucmd = params->ucmd; in create_dct() local 3090 if (inlen > ucmd && !ib_is_udata_cleared(udata, ucmd, inlen - ucmd)) in process_udata_size() 3191 struct mlx5_ib_create_qp *ucmd = params->ucmd; in get_qp_uidx() local [all …]
|
| H A D | cq.c | 746 if ((ucmd.cqe_size != 64 && ucmd.cqe_size != 128) || in create_cq_user() 747 ucmd.reserved0 || ucmd.reserved1) in create_cq_user() 750 *cqe_size = ucmd.cqe_size; in create_cq_user() 776 ucmd.buf_addr, entries * ucmd.cqe_size, in create_cq_user() 800 *index = ucmd.uar_page_index; in create_cq_user() 808 if (ucmd.cqe_comp_en == 1) { in create_cq_user() 1165 struct mlx5_ib_resize_cq ucmd; in resize_user() local 1169 err = ib_copy_from_udata(&ucmd, udata, sizeof(ucmd)); in resize_user() 1173 if (ucmd.reserved0 || ucmd.reserved1) in resize_user() 1177 if (ucmd.cqe_size && SIZE_MAX / ucmd.cqe_size <= entries - 1) in resize_user() [all …]
|
| H A D | srq.c | 48 struct mlx5_ib_create_srq ucmd = {}; in create_srq_user() local 55 ucmdlen = min(udata->inlen, sizeof(ucmd)); in create_srq_user() 57 if (ib_copy_from_udata(&ucmd, udata, ucmdlen)) { in create_srq_user() 62 if (ucmd.reserved0 || ucmd.reserved1) in create_srq_user() 65 if (udata->inlen > sizeof(ucmd) && in create_srq_user() 66 !ib_is_udata_cleared(udata, sizeof(ucmd), in create_srq_user() 67 udata->inlen - sizeof(ucmd))) in create_srq_user() 71 err = get_srq_user_index(ucontext, &ucmd, udata->inlen, &uidx); in create_srq_user() 76 srq->wq_sig = !!(ucmd.flags & MLX5_SRQ_FLAG_SIGNATURE); in create_srq_user() 78 srq->umem = ib_umem_get(pd->device, ucmd.buf_addr, buf_size, 0); in create_srq_user() [all …]
|
| /linux-6.15/drivers/infiniband/hw/hns/ |
| H A D | hns_roce_cq.c | 299 struct hns_roce_ib_create_cq *ucmd) in get_cq_ucmd() argument 304 ret = ib_copy_from_udata(ucmd, udata, min(udata->inlen, sizeof(*ucmd))); in get_cq_ucmd() 314 struct hns_roce_ib_create_cq *ucmd) in set_cq_param() argument 330 struct hns_roce_ib_create_cq *ucmd) in set_cqe_size() argument 340 if (ucmd->cqe_size != HNS_ROCE_V2_CQE_SIZE && in set_cqe_size() 341 ucmd->cqe_size != HNS_ROCE_V3_CQE_SIZE) { in set_cqe_size() 343 "invalid cqe size %u.\n", ucmd->cqe_size); in set_cqe_size() 347 hr_cq->cqe_size = ucmd->cqe_size; in set_cqe_size() 363 struct hns_roce_ib_create_cq ucmd = {}; in hns_roce_create_cq() local 376 ret = get_cq_ucmd(hr_cq, udata, &ucmd); in hns_roce_create_cq() [all …]
|
| H A D | hns_roce_srq.c | 346 struct hns_roce_ib_create_srq ucmd = {}; in alloc_srq_buf() local 350 ret = ib_copy_from_udata(&ucmd, udata, in alloc_srq_buf() 351 min(udata->inlen, sizeof(ucmd))); in alloc_srq_buf() 360 ret = alloc_srq_idx(hr_dev, srq, udata, ucmd.que_addr); in alloc_srq_buf() 364 ret = alloc_srq_wqe_buf(hr_dev, srq, udata, ucmd.buf_addr); in alloc_srq_buf() 392 struct hns_roce_ib_create_srq *ucmd) in get_srq_ucmd() argument 397 ret = ib_copy_from_udata(ucmd, udata, min(udata->inlen, sizeof(*ucmd))); in get_srq_ucmd() 429 struct hns_roce_ib_create_srq ucmd = {}; in alloc_srq_db() local 434 ret = get_srq_ucmd(srq, udata, &ucmd); in alloc_srq_db() 439 (ucmd.req_cap_flags & HNS_ROCE_SRQ_CAP_RECORD_DB)) { in alloc_srq_db() [all …]
|
| H A D | hns_roce_qp.c | 621 struct hns_roce_ib_create_qp *ucmd) in check_sq_size_with_integrity() argument 644 struct hns_roce_ib_create_qp *ucmd) in set_user_sq_size() argument 810 struct hns_roce_ib_create_qp *ucmd) in user_qp_has_sdb() argument 868 struct hns_roce_ib_create_qp *ucmd, in alloc_user_qp_db() argument 1046 struct hns_roce_ib_create_qp *ucmd) in set_congest_type() argument 1050 switch (ucmd->cong_type_flags) { in set_congest_type() 1082 return set_congest_type(hr_qp, ucmd); in set_congest_param() 1092 struct hns_roce_ib_create_qp *ucmd) in set_qp_param() argument 1112 ret = ib_copy_from_udata(ucmd, udata, in set_qp_param() 1113 min(udata->inlen, sizeof(*ucmd))); in set_qp_param() [all …]
|
| /linux-6.15/drivers/dma-buf/ |
| H A D | dma-heap.c | 125 static long dma_heap_ioctl(struct file *file, unsigned int ucmd, in dma_heap_ioctl() argument 132 int nr = _IOC_NR(ucmd); in dma_heap_ioctl() 144 out_size = _IOC_SIZE(ucmd); in dma_heap_ioctl() 146 if ((ucmd & kcmd & IOC_IN) == 0) in dma_heap_ioctl() 148 if ((ucmd & kcmd & IOC_OUT) == 0) in dma_heap_ioctl()
|
| /linux-6.15/drivers/infiniband/hw/mlx4/ |
| H A D | qp.c | 456 if (ucmd->log_sq_stride > in set_user_sq_size() 578 ucmd->rx_hash_fields_mask); in set_qp_rss() 727 sizeof(ucmd.reserved1); in _mlx4_ib_create_qp_rss() 733 if (ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen))) { in _mlx4_ib_create_qp_rss() 738 if (memchr_inv(ucmd.reserved, 0, sizeof(ucmd.reserved))) in _mlx4_ib_create_qp_rss() 741 if (ucmd.comp_mask || ucmd.reserved1) in _mlx4_ib_create_qp_rss() 1071 struct mlx4_ib_create_qp ucmd; in create_qp_common() local 4141 sizeof(ucmd.comp_mask); in mlx4_ib_create_wq() 4278 sizeof(ucmd.reserved); in mlx4_ib_modify_wq() 4287 if (ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen))) in mlx4_ib_modify_wq() [all …]
|
| H A D | srq.c | 112 struct mlx4_ib_create_srq ucmd; in mlx4_ib_create_srq() local 114 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) in mlx4_ib_create_srq() 118 ib_umem_get(ib_srq->device, ucmd.buf_addr, buf_size, 0); in mlx4_ib_create_srq() 132 err = mlx4_ib_db_map_user(udata, ucmd.db_addr, &srq->db); in mlx4_ib_create_srq()
|
| /linux-6.15/drivers/infiniband/hw/vmw_pvrdma/ |
| H A D | pvrdma_srq.c | 109 struct pvrdma_create_srq ucmd; in pvrdma_create_srq() local 144 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) { in pvrdma_create_srq() 149 srq->umem = ib_umem_get(ibsrq->device, ucmd.buf_addr, ucmd.buf_size, 0); in pvrdma_create_srq()
|
| H A D | pvrdma_cq.c | 117 struct pvrdma_create_cq ucmd; in pvrdma_create_cq() local 137 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) { in pvrdma_create_cq() 142 cq->umem = ib_umem_get(ibdev, ucmd.buf_addr, ucmd.buf_size, in pvrdma_create_cq()
|
| /linux-6.15/arch/mips/cavium-octeon/ |
| H A D | octeon-platform.c | 36 u32 ucmd; in octeon2_usb_reset() local 43 ucmd = cvmx_read64_uint32(CVMX_UAHCX_EHCI_USBCMD); in octeon2_usb_reset() 44 ucmd &= ~CMD_RUN; in octeon2_usb_reset() 45 cvmx_write64_uint32(CVMX_UAHCX_EHCI_USBCMD, ucmd); in octeon2_usb_reset() 47 ucmd |= CMD_RESET; in octeon2_usb_reset() 48 cvmx_write64_uint32(CVMX_UAHCX_EHCI_USBCMD, ucmd); in octeon2_usb_reset() 49 ucmd = cvmx_read64_uint32(CVMX_UAHCX_OHCI_USBCMD); in octeon2_usb_reset() 50 ucmd |= CMD_RUN; in octeon2_usb_reset() 51 cvmx_write64_uint32(CVMX_UAHCX_OHCI_USBCMD, ucmd); in octeon2_usb_reset()
|