/linux-6.12.1/drivers/iommu/iommufd/ |
D | ioas.c | 37 int iommufd_ioas_alloc_ioctl(struct iommufd_ucmd *ucmd) in iommufd_ioas_alloc_ioctl() argument 39 struct iommu_ioas_alloc *cmd = ucmd->cmd; in iommufd_ioas_alloc_ioctl() 46 ioas = iommufd_ioas_alloc(ucmd->ictx); in iommufd_ioas_alloc_ioctl() 51 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_ioas_alloc_ioctl() 54 iommufd_object_finalize(ucmd->ictx, &ioas->obj); in iommufd_ioas_alloc_ioctl() 58 iommufd_object_abort_and_destroy(ucmd->ictx, &ioas->obj); in iommufd_ioas_alloc_ioctl() 62 int iommufd_ioas_iova_ranges(struct iommufd_ucmd *ucmd) in iommufd_ioas_iova_ranges() argument 65 struct iommu_ioas_iova_ranges *cmd = ucmd->cmd; in iommufd_ioas_iova_ranges() 74 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); in iommufd_ioas_iova_ranges() 101 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_ioas_iova_ranges() [all …]
|
D | iommufd_private.h | 116 static inline int iommufd_ucmd_respond(struct iommufd_ucmd *ucmd, in iommufd_ucmd_respond() argument 119 if (copy_to_user(ucmd->ubuffer, ucmd->cmd, in iommufd_ucmd_respond() 120 min_t(size_t, ucmd->user_size, cmd_len))) in iommufd_ucmd_respond() 274 int iommufd_ioas_alloc_ioctl(struct iommufd_ucmd *ucmd); 276 int iommufd_ioas_iova_ranges(struct iommufd_ucmd *ucmd); 277 int iommufd_ioas_allow_iovas(struct iommufd_ucmd *ucmd); 278 int iommufd_ioas_map(struct iommufd_ucmd *ucmd); 279 int iommufd_ioas_copy(struct iommufd_ucmd *ucmd); 280 int iommufd_ioas_unmap(struct iommufd_ucmd *ucmd); 281 int iommufd_ioas_option(struct iommufd_ucmd *ucmd); [all …]
|
D | hw_pagetable.c | 263 int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd) in iommufd_hwpt_alloc() argument 265 struct iommu_hwpt_alloc *cmd = ucmd->cmd; in iommufd_hwpt_alloc() 283 idev = iommufd_get_device(ucmd, cmd->dev_id); in iommufd_hwpt_alloc() 287 pt_obj = iommufd_get_object(ucmd->ictx, cmd->pt_id, IOMMUFD_OBJ_ANY); in iommufd_hwpt_alloc() 299 ucmd->ictx, ioas, idev, cmd->flags, false, in iommufd_hwpt_alloc() 310 ucmd->ictx, in iommufd_hwpt_alloc() 327 fault = iommufd_get_fault(ucmd, cmd->fault_id); in iommufd_hwpt_alloc() 336 iommufd_put_object(ucmd->ictx, &fault->obj); in iommufd_hwpt_alloc() 340 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_hwpt_alloc() 343 iommufd_object_finalize(ucmd->ictx, &hwpt->obj); in iommufd_hwpt_alloc() [all …]
|
D | selftest.c | 107 void iommufd_test_syz_conv_iova_id(struct iommufd_ucmd *ucmd, in iommufd_test_syz_conv_iova_id() argument 116 ioas = iommufd_get_ioas(ucmd->ictx, ioas_id); in iommufd_test_syz_conv_iova_id() 120 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_test_syz_conv_iova_id() 636 __get_md_pagetable(struct iommufd_ucmd *ucmd, u32 mockpt_id, u32 hwpt_type) in __get_md_pagetable() argument 640 obj = iommufd_get_object(ucmd->ictx, mockpt_id, hwpt_type); in __get_md_pagetable() 647 get_md_pagetable(struct iommufd_ucmd *ucmd, u32 mockpt_id, in get_md_pagetable() argument 652 hwpt = __get_md_pagetable(ucmd, mockpt_id, IOMMUFD_OBJ_HWPT_PAGING); in get_md_pagetable() 657 iommufd_put_object(ucmd->ictx, &hwpt->obj); in get_md_pagetable() 665 get_md_pagetable_nested(struct iommufd_ucmd *ucmd, u32 mockpt_id, in get_md_pagetable_nested() argument 670 hwpt = __get_md_pagetable(ucmd, mockpt_id, IOMMUFD_OBJ_HWPT_NESTED); in get_md_pagetable_nested() [all …]
|
D | main.c | 226 static int iommufd_destroy(struct iommufd_ucmd *ucmd) in iommufd_destroy() argument 228 struct iommu_destroy *cmd = ucmd->cmd; in iommufd_destroy() 230 return iommufd_object_remove(ucmd->ictx, NULL, cmd->id, 0); in iommufd_destroy() 294 static int iommufd_option(struct iommufd_ucmd *ucmd) in iommufd_option() argument 296 struct iommu_option *cmd = ucmd->cmd; in iommufd_option() 304 rc = iommufd_option_rlimit_mode(cmd, ucmd->ictx); in iommufd_option() 307 rc = iommufd_ioas_option(ucmd); in iommufd_option() 314 if (copy_to_user(&((struct iommu_option __user *)ucmd->ubuffer)->val64, in iommufd_option() 345 int (*execute)(struct iommufd_ucmd *ucmd); 397 struct iommufd_ucmd ucmd = {}; in iommufd_fops_ioctl() local [all …]
|
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() 137 return iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_vfio_ioas() 140 ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id); 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() [all …]
|
D | fault.c | 365 int iommufd_fault_alloc(struct iommufd_ucmd *ucmd) in iommufd_fault_alloc() argument 367 struct iommu_fault_alloc *cmd = ucmd->cmd; in iommufd_fault_alloc() 376 fault = iommufd_object_alloc(ucmd->ictx, fault, IOMMUFD_OBJ_FAULT); in iommufd_fault_alloc() 380 fault->ictx = ucmd->ictx; in iommufd_fault_alloc() 406 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_fault_alloc() 409 iommufd_object_finalize(ucmd->ictx, &fault->obj); in iommufd_fault_alloc() 421 iommufd_object_abort_and_destroy(ucmd->ictx, &fault->obj); in iommufd_fault_alloc()
|
/linux-6.12.1/drivers/infiniband/hw/mana/ |
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()
|
D | qp.c | 100 struct mana_ib_create_qp_rss ucmd = {}; in mana_ib_create_qp_rss() local 114 if (!udata || udata->inlen < sizeof(ucmd)) in mana_ib_create_qp_rss() 117 ret = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_qp_rss() 147 if (ucmd.rx_hash_function != MANA_IB_RX_HASH_FUNC_TOEPLITZ) { 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() 165 ucmd.rx_hash_function, 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() 276 struct mana_ib_create_qp ucmd = {}; in mana_ib_create_qp_raw() local [all …]
|
D | cq.c | 16 struct mana_ib_create_cq ucmd = {}; in mana_ib_create_cq() local 30 err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen)); in mana_ib_create_cq() 37 is_rnic_cq = !!(ucmd.flags & MANA_IB_CREATE_RNIC_CQ); in mana_ib_create_cq() 45 err = mana_ib_create_queue(mdev, ucmd.buf_addr, cq->cqe * COMP_ENTRY_SIZE, &cq->queue); in mana_ib_create_cq()
|
/linux-6.12.1/drivers/infiniband/hw/mthca/ |
D | mthca_provider.c | 395 struct mthca_create_srq ucmd; in mthca_create_srq() local 405 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) in mthca_create_srq() 409 context->db_tab, ucmd.db_index, in mthca_create_srq() 410 ucmd.db_page); in mthca_create_srq() 415 srq->mr.ibmr.lkey = ucmd.lkey; in mthca_create_srq() 416 srq->db_index = ucmd.db_index; in mthca_create_srq() 424 context->db_tab, ucmd.db_index); in mthca_create_srq() 460 struct mthca_create_qp ucmd; in mthca_create_qp() local 474 if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) in mthca_create_qp() 479 ucmd.sq_db_index, in mthca_create_qp() [all …]
|
/linux-6.12.1/drivers/infiniband/hw/mlx5/ |
D | qp.c | 434 int has_rq, struct mlx5_ib_qp *qp, struct mlx5_ib_create_qp *ucmd) in set_rq_size() argument 452 if (ucmd) { in set_rq_size() 453 qp->rq.wqe_cnt = ucmd->rq_wqe_count; in set_rq_size() 454 if (ucmd->rq_wqe_shift > BITS_PER_BYTE * sizeof(ucmd->rq_wqe_shift)) in set_rq_size() 456 qp->rq.wqe_shift = ucmd->rq_wqe_shift; in set_rq_size() 638 struct mlx5_ib_create_qp *ucmd, in set_user_buf_size() argument 650 if (ucmd->sq_wqe_count && !is_power_of_2(ucmd->sq_wqe_count)) { in set_user_buf_size() 652 ucmd->sq_wqe_count); in set_user_buf_size() 656 qp->sq.wqe_cnt = ucmd->sq_wqe_count; in set_user_buf_size() 882 struct mlx5_ib_create_wq *ucmd) in create_user_rq() argument [all …]
|
D | cq.c | 723 struct mlx5_ib_create_cq ucmd = {}; in create_cq_user() local 734 ucmdlen = min(udata->inlen, sizeof(ucmd)); in create_cq_user() 738 if (ib_copy_from_udata(&ucmd, udata, ucmdlen)) in create_cq_user() 741 if ((ucmd.flags & ~(MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD | in create_cq_user() 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() 753 ib_umem_get(&dev->ib_dev, ucmd.buf_addr, in create_cq_user() 754 entries * ucmd.cqe_size, IB_ACCESS_LOCAL_WRITE); in create_cq_user() 768 err = mlx5_ib_db_map_user(context, ucmd.db_addr, &cq->db); in create_cq_user() [all …]
|
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 …]
|
D | counters.h | 15 struct mlx5_ib_create_flow *ucmd);
|
/linux-6.12.1/drivers/infiniband/hw/hns/ |
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 339 if (udata->inlen >= offsetofend(typeof(*ucmd), cqe_size)) { in set_cqe_size() 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 [all …]
|
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 …]
|
D | hns_roce_qp.c | 598 struct hns_roce_ib_create_qp *ucmd) in check_sq_size_with_integrity() argument 604 if (ucmd->log_sq_stride > max_sq_stride || in check_sq_size_with_integrity() 605 ucmd->log_sq_stride < HNS_ROCE_IB_MIN_SQ_STRIDE) { in check_sq_size_with_integrity() 621 struct hns_roce_ib_create_qp *ucmd) in set_user_sq_size() argument 627 if (check_shl_overflow(1, ucmd->log_sq_bb_count, &cnt) || in set_user_sq_size() 631 ret = check_sq_size_with_integrity(hr_dev, cap, ucmd); in set_user_sq_size() 640 hr_qp->sq.wqe_shift = ucmd->log_sq_stride; in set_user_sq_size() 787 struct hns_roce_ib_create_qp *ucmd) in user_qp_has_sdb() argument 792 udata->inlen >= offsetofend(typeof(*ucmd), sdb_addr)); in user_qp_has_sdb() 845 struct hns_roce_ib_create_qp *ucmd, in alloc_user_qp_db() argument [all …]
|
/linux-6.12.1/drivers/infiniband/hw/mlx4/ |
D | qp.c | 448 struct mlx4_ib_create_qp *ucmd) in set_user_sq_size() argument 453 if (check_shl_overflow(1, ucmd->log_sq_bb_count, &cnt) || in set_user_sq_size() 456 if (ucmd->log_sq_stride > in set_user_sq_size() 458 ucmd->log_sq_stride < MLX4_IB_MIN_SQ_STRIDE) in set_user_sq_size() 461 qp->sq.wqe_cnt = 1 << ucmd->log_sq_bb_count; in set_user_sq_size() 462 qp->sq.wqe_shift = ucmd->log_sq_stride; in set_user_sq_size() 554 struct mlx4_ib_create_qp_rss *ucmd) in set_qp_rss() argument 559 if ((ucmd->rx_hash_function == MLX4_IB_RX_HASH_FUNC_TOEPLITZ) && in set_qp_rss() 561 memcpy(rss_ctx->rss_key, ucmd->rx_hash_key, in set_qp_rss() 568 if (ucmd->rx_hash_fields_mask & ~(u64)(MLX4_IB_RX_HASH_SRC_IPV4 | in set_qp_rss() [all …]
|
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()
|
D | cq.c | 206 struct mlx4_ib_create_cq ucmd; in mlx4_ib_create_cq() local 208 if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) { in mlx4_ib_create_cq() 213 buf_addr = (void *)(unsigned long)ucmd.buf_addr; in mlx4_ib_create_cq() 215 ucmd.buf_addr, entries); in mlx4_ib_create_cq() 219 err = mlx4_ib_db_map_user(udata, ucmd.db_addr, &cq->db); in mlx4_ib_create_cq() 318 struct mlx4_ib_resize_cq ucmd; in mlx4_alloc_resize_umem() local 324 if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) in mlx4_alloc_resize_umem() 332 ucmd.buf_addr, entries); in mlx4_alloc_resize_umem()
|
/linux-6.12.1/drivers/dma-buf/ |
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.12.1/drivers/infiniband/hw/vmw_pvrdma/ |
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()
|
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.12.1/arch/mips/cavium-octeon/ |
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()
|