| /linux/drivers/virtio/ |
| H A D | virtio_ring.c | 22 dev_err(&(_vq)->vq.vdev->dev, \ 23 "%s:"fmt, (_vq)->vq.name, ##args); \ 31 (_vq)->vq.name, (_vq)->in_use); \ 59 dev_err(&_vq->vq.vdev->dev, \ 60 "%s:"fmt, (_vq)->vq.name, ##args); \ 63 #define START_USE(vq) argument 64 #define END_USE(vq) argument 65 #define LAST_ADD_TIME_UPDATE(vq) argument 66 #define LAST_ADD_TIME_CHECK(vq) argument 67 #define LAST_ADD_TIME_INVALID(vq) argument [all …]
|
| H A D | virtio_vdpa.c | 93 static bool virtio_vdpa_notify(struct virtqueue *vq) in virtio_vdpa_notify() argument 95 struct vdpa_device *vdpa = vd_get_vdpa(vq->vdev); in virtio_vdpa_notify() 98 ops->kick_vq(vdpa, vq->index); in virtio_vdpa_notify() 103 static bool virtio_vdpa_notify_with_data(struct virtqueue *vq) in virtio_vdpa_notify_with_data() argument 105 struct vdpa_device *vdpa = vd_get_vdpa(vq->vdev); in virtio_vdpa_notify_with_data() 107 u32 data = vring_notification_data(vq); in virtio_vdpa_notify_with_data() 125 struct virtqueue *vq = private; in virtio_vdpa_virtqueue_cb() local 127 return vring_interrupt(0, vq); in virtio_vdpa_virtqueue_cb() 132 void (*callback)(struct virtqueue *vq), in virtio_vdpa_setup_vq() argument 137 bool (*notify)(struct virtqueue *vq) = virtio_vdpa_notify; in virtio_vdpa_setup_vq() [all …]
|
| H A D | virtio_pci_common.c | 51 bool vp_notify(struct virtqueue *vq) in vp_notify() argument 55 iowrite16(vq->index, (void __iomem *)vq->priv); in vp_notify() 68 vring_interrupt(irq, info->vq); in vp_vring_slow_path_interrupt() 92 if (vring_interrupt(irq, info->vq) == IRQ_HANDLED) in vp_vring_interrupt() 204 void (*callback)(struct virtqueue *vq), in vp_setup_vq() argument 212 struct virtqueue *vq; in vp_setup_vq() local 219 vq = vp_dev->setup_vq(vp_dev, info, index, callback, name, ctx, in vp_setup_vq() 221 if (IS_ERR(vq)) in vp_setup_vq() 224 info->vq = vq; in vp_setup_vq() 237 return vq; in vp_setup_vq() [all …]
|
| H A D | virtio_pci_modern.c | 47 void vp_modern_avq_done(struct virtqueue *vq) in vp_modern_avq_done() argument 49 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); in vp_modern_avq_done() 58 virtqueue_disable_cb(vq); in vp_modern_avq_done() 59 while ((cmd = virtqueue_get_buf(vq, &len))) { in vp_modern_avq_done() 73 } while (!virtqueue_enable_cb(vq)); in vp_modern_avq_done() 84 struct virtqueue *vq; in virtqueue_exec_admin_cmd() local 88 vq = admin_vq->info->vq; in virtqueue_exec_admin_cmd() 89 if (!vq) in virtqueue_exec_admin_cmd() 100 if (virtqueue_is_broken(vq)) in virtqueue_exec_admin_cmd() 104 ret = virtqueue_add_sgs(vq, sgs, out_num, in_num, cmd, GFP_KERNEL); in virtqueue_exec_admin_cmd() [all …]
|
| H A D | virtio_pci_legacy.c | 113 void (*callback)(struct virtqueue *vq), in setup_vq() argument 118 struct virtqueue *vq; in setup_vq() local 131 vq = vring_create_virtqueue(index, num, in setup_vq() 135 if (!vq) in setup_vq() 138 vq->num_max = num; in setup_vq() 140 q_pfn = virtqueue_get_desc_addr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT; in setup_vq() 152 vq->priv = (void __force *)vp_dev->ldev.ioaddr + VIRTIO_PCI_QUEUE_NOTIFY; in setup_vq() 162 return vq; in setup_vq() 167 vring_del_virtqueue(vq); in setup_vq() 173 struct virtqueue *vq = info->vq; in del_vq() local [all …]
|
| H A D | virtio_rtc_driver.c | 36 struct virtqueue *vq; member 134 static int viortc_feed_vq(struct viortc_dev *viortc, struct virtqueue *vq, in viortc_feed_vq() argument 141 return virtqueue_add_inbuf(vq, &sg, 1, data, GFP_ATOMIC); in viortc_feed_vq() 227 static void viortc_do_cb(struct virtqueue *vq, in viortc_do_cb() argument 229 struct virtqueue *vq, in viortc_do_cb() 233 struct viortc_dev *viortc = vq->vdev->priv; in viortc_do_cb() 240 viortc_vq = &viortc->vqs[vq->index]; in viortc_do_cb() 246 virtqueue_disable_cb(vq); in viortc_do_cb() 250 token = virtqueue_get_buf(vq, &len); in viortc_do_cb() 252 if (virtqueue_enable_cb(vq)) { in viortc_do_cb() [all …]
|
| /linux/drivers/vhost/ |
| H A D | vhost.c | 57 #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) argument 58 #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) argument 61 static void vhost_disable_cross_endian(struct vhost_virtqueue *vq) in vhost_disable_cross_endian() argument 63 vq->user_be = !virtio_legacy_is_little_endian(); in vhost_disable_cross_endian() 66 static void vhost_enable_cross_endian_big(struct vhost_virtqueue *vq) in vhost_enable_cross_endian_big() argument 68 vq->user_be = true; in vhost_enable_cross_endian_big() 71 static void vhost_enable_cross_endian_little(struct vhost_virtqueue *vq) in vhost_enable_cross_endian_little() argument 73 vq->user_be = false; in vhost_enable_cross_endian_little() 76 static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) in vhost_set_vring_endian() argument 80 if (vq->private_data) in vhost_set_vring_endian() [all …]
|
| H A D | net.c | 101 struct vhost_virtqueue *vq; member 113 struct vhost_virtqueue vq; member 231 static void vhost_net_enable_zcopy(int vq) in vhost_net_enable_zcopy() argument 233 vhost_net_zcopy_mask |= 0x1 << vq; in vhost_net_enable_zcopy() 237 vhost_net_ubuf_alloc(struct vhost_virtqueue *vq, bool zcopy) in vhost_net_ubuf_alloc() argument 248 ubufs->vq = vq; in vhost_net_ubuf_alloc() 364 struct vhost_virtqueue *vq) in vhost_zerocopy_signal_used() argument 367 container_of(vq, struct vhost_net_virtqueue, vq); in vhost_zerocopy_signal_used() 372 if (vq->heads[i].len == VHOST_DMA_FAILED_LEN) in vhost_zerocopy_signal_used() 374 if (VHOST_DMA_IS_DONE(vq->heads[i].len)) { in vhost_zerocopy_signal_used() [all …]
|
| H A D | test.c | 51 struct vhost_virtqueue *vq = &n->vqs[VHOST_TEST_VQ]; in handle_vq() local 57 mutex_lock(&vq->mutex); in handle_vq() 58 private = vhost_vq_get_backend(vq); in handle_vq() 60 mutex_unlock(&vq->mutex); in handle_vq() 64 vhost_disable_notify(&n->dev, vq); in handle_vq() 67 head = vhost_get_vq_desc(vq, vq->iov, in handle_vq() 68 ARRAY_SIZE(vq->iov), in handle_vq() 75 if (head == vq->num) { in handle_vq() 76 if (unlikely(vhost_enable_notify(&n->dev, vq))) { in handle_vq() 77 vhost_disable_notify(&n->dev, vq); in handle_vq() [all …]
|
| H A D | scsi.c | 217 struct vhost_virtqueue vq; member 309 struct vhost_virtqueue *vq; in vhost_scsi_init_inflight() local 313 vq = &vs->vqs[i].vq; in vhost_scsi_init_inflight() 315 mutex_lock(&vq->mutex); in vhost_scsi_init_inflight() 328 mutex_unlock(&vq->mutex); in vhost_scsi_init_inflight() 333 vhost_scsi_get_inflight(struct vhost_virtqueue *vq) in vhost_scsi_get_inflight() argument 338 svq = container_of(vq, struct vhost_scsi_virtqueue, vq); in vhost_scsi_get_inflight() 379 static int vhost_scsi_copy_cmd_log(struct vhost_virtqueue *vq, in vhost_scsi_copy_cmd_log() argument 385 cmd->tvc_log = kmalloc_objs(*cmd->tvc_log, vq->dev->iov_limit); in vhost_scsi_copy_cmd_log() 388 vq_err(vq, "Failed to alloc tvc_log\n"); in vhost_scsi_copy_cmd_log() [all …]
|
| H A D | vsock.c | 96 struct vhost_virtqueue *vq) in vhost_transport_do_send_pkt() argument 103 mutex_lock(&vq->mutex); in vhost_transport_do_send_pkt() 105 if (!vhost_vq_get_backend(vq)) in vhost_transport_do_send_pkt() 108 if (!vq_meta_prefetch(vq)) in vhost_transport_do_send_pkt() 112 vhost_disable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt() 128 vhost_enable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt() 132 head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), in vhost_transport_do_send_pkt() 139 if (head == vq->num) { in vhost_transport_do_send_pkt() 144 if (unlikely(vhost_enable_notify(&vsock->dev, vq))) { in vhost_transport_do_send_pkt() 145 vhost_disable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt() [all …]
|
| H A D | vhost.h | 63 struct vhost_virtqueue *vq; member 68 struct vhost_virtqueue *vq); 174 struct vhost_virtqueue *vq; member 209 bool vhost_exceeds_weight(struct vhost_virtqueue *vq, int pkts, int total_len); 226 bool vhost_vq_access_ok(struct vhost_virtqueue *vq); 235 int vhost_get_vq_desc_n(struct vhost_virtqueue *vq, 244 bool vhost_vq_work_queue(struct vhost_virtqueue *vq, struct vhost_work *work); 245 bool vhost_vq_has_work(struct vhost_virtqueue *vq); 246 bool vhost_vq_is_setup(struct vhost_virtqueue *vq); 261 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, [all …]
|
| /linux/arch/arm64/include/uapi/asm/ |
| H A D | sve_context.h | 42 #define __sve_vl_from_vq(vq) ((vq) * __SVE_VQ_BYTES) argument 44 #define __SVE_ZREG_SIZE(vq) ((__u32)(vq) * __SVE_VQ_BYTES) argument 45 #define __SVE_PREG_SIZE(vq) ((__u32)(vq) * (__SVE_VQ_BYTES / 8)) argument 46 #define __SVE_FFR_SIZE(vq) __SVE_PREG_SIZE(vq) argument 49 #define __SVE_ZREG_OFFSET(vq, n) \ argument 50 (__SVE_ZREGS_OFFSET + __SVE_ZREG_SIZE(vq) * (n)) 51 #define __SVE_ZREGS_SIZE(vq) \ argument 52 (__SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - __SVE_ZREGS_OFFSET) 54 #define __SVE_PREGS_OFFSET(vq) \ argument 55 (__SVE_ZREGS_OFFSET + __SVE_ZREGS_SIZE(vq)) [all …]
|
| /linux/tools/virtio/ |
| H A D | vhost_net_test.c | 42 struct virtqueue *vq; member 138 static bool vq_notify(struct virtqueue *vq) in vq_notify() argument 140 struct vq_info *info = vq->priv; in vq_notify() 180 if (info->vq) in vq_reset() 181 vring_del_virtqueue(info->vq); in vq_reset() 185 info->vq = vring_new_virtqueue(info->idx, num, 4096, vdev, true, false, in vq_reset() 187 assert(info->vq); in vq_reset() 188 info->vq->priv = info; in vq_reset() 257 static void wait_for_interrupt(struct vq_info *vq) in wait_for_interrupt() argument 261 poll(&vq->fds, 1, 100); in wait_for_interrupt() [all …]
|
| H A D | virtio_test.c | 35 struct virtqueue *vq; member 53 bool vq_notify(struct virtqueue *vq) in vq_notify() argument 55 struct vq_info *info = vq->priv; in vq_notify() 63 void vq_callback(struct virtqueue *vq) in vq_callback() argument 100 if (info->vq) in vq_reset() 101 vring_del_virtqueue(info->vq); in vq_reset() 105 info->vq = vring_new_virtqueue(info->idx, num, 4096, vdev, true, false, in vq_reset() 107 assert(info->vq); in vq_reset() 108 info->vq->priv = info; in vq_reset() 169 static void run_test(struct vdev_info *dev, struct vq_info *vq, in run_test() argument [all …]
|
| /linux/include/linux/ |
| H A D | virtio.h | 36 void (*callback)(struct virtqueue *vq); 55 int virtqueue_add_outbuf(struct virtqueue *vq, 60 int virtqueue_add_inbuf(struct virtqueue *vq, 65 int virtqueue_add_inbuf_cache_clean(struct virtqueue *vq, 70 int virtqueue_add_inbuf_ctx(struct virtqueue *vq, 76 int virtqueue_add_inbuf_premapped(struct virtqueue *vq, 82 int virtqueue_add_outbuf_premapped(struct virtqueue *vq, 87 int virtqueue_add_sgs(struct virtqueue *vq, 94 struct device *virtqueue_dma_dev(struct virtqueue *vq); 96 bool virtqueue_kick(struct virtqueue *vq); [all …]
|
| /linux/drivers/vdpa/vdpa_sim/ |
| H A D | vdpa_sim_blk.c | 110 struct vdpasim_virtqueue *vq) in vdpasim_blk_handle_req() argument 123 ret = vringh_getdesc_iotlb(&vq->vring, &vq->out_iov, &vq->in_iov, in vdpasim_blk_handle_req() 124 &vq->head, GFP_ATOMIC); in vdpasim_blk_handle_req() 128 if (vq->out_iov.used < 1 || vq->in_iov.used < 1) { in vdpasim_blk_handle_req() 130 vq->out_iov.used, vq->in_iov.used); in vdpasim_blk_handle_req() 134 if (vq->in_iov.iov[vq->in_iov.used - 1].iov_len < 1) { in vdpasim_blk_handle_req() 142 to_push = vringh_kiov_length(&vq->in_iov) - 1; in vdpasim_blk_handle_req() 144 to_pull = vringh_kiov_length(&vq->out_iov); in vdpasim_blk_handle_req() 146 bytes = vringh_iov_pull_iotlb(&vq->vring, &vq->out_iov, &hdr, in vdpasim_blk_handle_req() 179 bytes = vringh_iov_push_iotlb(&vq->vring, &vq->in_iov, in vdpasim_blk_handle_req() [all …]
|
| H A D | vdpa_sim.c | 84 struct vdpasim_virtqueue *vq = in vdpasim_vq_notify() local 87 if (!vq->cb) in vdpasim_vq_notify() 90 vq->cb(vq->private); in vdpasim_vq_notify() 95 struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; in vdpasim_queue_ready() local 96 uint16_t last_avail_idx = vq->vring.last_avail_idx; in vdpasim_queue_ready() 98 (uintptr_t)vq->desc_addr; in vdpasim_queue_ready() 100 (uintptr_t)vq->driver_addr; in vdpasim_queue_ready() 102 (uintptr_t)vq->device_addr; in vdpasim_queue_ready() 105 vringh_init_iotlb_va(&vq->vring, vdpasim->features, vq->num, in vdpasim_queue_ready() 108 vringh_init_iotlb(&vq->vring, vdpasim->features, vq->num, in vdpasim_queue_ready() [all …]
|
| /linux/net/vmw_vsock/ |
| H A D | virtio_transport.c | 101 static int virtio_transport_send_skb(struct sk_buff *skb, struct virtqueue *vq, in virtio_transport_send_skb() argument 146 ret = virtqueue_add_sgs(vq, sgs, out_sg, in_sg, skb, gfp); in virtio_transport_send_skb() 162 struct virtqueue *vq; in virtio_transport_send_pkt_work() local 171 vq = vsock->vqs[VSOCK_VQ_TX]; in virtio_transport_send_pkt_work() 184 ret = virtio_transport_send_skb(skb, vq, vsock, GFP_KERNEL); in virtio_transport_send_pkt_work() 205 virtqueue_kick(vq); in virtio_transport_send_pkt_work() 219 struct virtqueue *vq = vsock->vqs[VSOCK_VQ_TX]; in virtio_transport_send_skb_fast_path() local 227 ret = virtio_transport_send_skb(skb, vq, vsock, GFP_ATOMIC); in virtio_transport_send_skb_fast_path() 229 virtqueue_kick(vq); in virtio_transport_send_skb_fast_path() 315 struct virtqueue *vq; in virtio_vsock_rx_fill() local [all …]
|
| /linux/drivers/vdpa/vdpa_user/ |
| H A D | vduse_dev.c | 281 struct vduse_virtqueue *vq, in vduse_dev_get_vq_state_packed() argument 288 msg.req.vq_state.index = vq->index; in vduse_dev_get_vq_state_packed() 307 struct vduse_virtqueue *vq, in vduse_dev_get_vq_state_split() argument 314 msg.req.vq_state.index = vq->index; in vduse_dev_get_vq_state_split() 487 struct vduse_virtqueue *vq = dev->vqs[i]; in vduse_dev_reset() local 489 vq->ready = false; in vduse_dev_reset() 490 vq->desc_addr = 0; in vduse_dev_reset() 491 vq->driver_addr = 0; in vduse_dev_reset() 492 vq->device_addr = 0; in vduse_dev_reset() 493 vq->num = 0; in vduse_dev_reset() [all …]
|
| /linux/tools/testing/selftests/arm64/fp/ |
| H A D | fp-ptrace.c | 404 int ret, vq; in check_ptrace_values_sve() local 410 vq = __sve_vq_from_vl(config->sve_vl_in); in check_ptrace_values_sve() 412 iov.iov_len = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE); in check_ptrace_values_sve() 448 if (sve->size != SVE_PT_SIZE(vq, sve->flags)) { in check_ptrace_values_sve() 450 sve->size, SVE_PT_SIZE(vq, sve->flags)); in check_ptrace_values_sve() 458 iov.iov_base + SVE_PT_SVE_ZREG_OFFSET(vq, 0), in check_ptrace_values_sve() 459 z_in, SVE_PT_SVE_ZREGS_SIZE(vq))) in check_ptrace_values_sve() 463 iov.iov_base + SVE_PT_SVE_PREG_OFFSET(vq, 0), in check_ptrace_values_sve() 464 p_in, SVE_PT_SVE_PREGS_SIZE(vq))) in check_ptrace_values_sve() 468 iov.iov_base + SVE_PT_SVE_FFR_OFFSET(vq), in check_ptrace_values_sve() [all …]
|
| H A D | sve-ptrace.c | 459 unsigned int vq = sve_vq_from_vl(vl); in ptrace_set_sve_get_sve_data() local 464 data_size = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE); in ptrace_set_sve_get_sve_data() 480 fill_buf(write_buf + SVE_PT_SVE_ZREG_OFFSET(vq, i), in ptrace_set_sve_get_sve_data() 481 SVE_PT_SVE_ZREG_SIZE(vq)); in ptrace_set_sve_get_sve_data() 484 fill_buf(write_buf + SVE_PT_SVE_PREG_OFFSET(vq, i), in ptrace_set_sve_get_sve_data() 485 SVE_PT_SVE_PREG_SIZE(vq)); in ptrace_set_sve_get_sve_data() 487 fill_buf(write_buf + SVE_PT_SVE_FPSR_OFFSET(vq), SVE_PT_SVE_FPSR_SIZE); in ptrace_set_sve_get_sve_data() 488 fill_buf(write_buf + SVE_PT_SVE_FPCR_OFFSET(vq), SVE_PT_SVE_FPCR_SIZE); in ptrace_set_sve_get_sve_data() 516 if (memcmp(write_buf + SVE_PT_SVE_ZREG_OFFSET(vq, i), in ptrace_set_sve_get_sve_data() 517 read_buf + SVE_PT_SVE_ZREG_OFFSET(vq, i), in ptrace_set_sve_get_sve_data() [all …]
|
| H A D | sve-probe-vls.c | 20 unsigned int vq; in main() local 34 for (vq = SVE_VQ_MAX; vq > 0; --vq) { in main() 35 vl = prctl(PR_SVE_SET_VL, vq * 16); in main() 48 vq = sve_vq_from_vl(vl); in main() 53 vqs[nvqs++] = vq; in main()
|
| /linux/tools/testing/selftests/arm64/signal/ |
| H A D | sve_helpers.c | 18 int vq, vl; in sve_fill_vls() local 25 for (vq = SVE_VQ_MAX; vq > 0; --vq) { in sve_fill_vls() 26 vl = prctl(pr_set_vl, vq * 16); in sve_fill_vls() 41 if (vq < sve_vq_from_vl(vl)) in sve_fill_vls() 45 vq = sve_vq_from_vl(vl); in sve_fill_vls()
|
| /linux/arch/um/drivers/ |
| H A D | virtio_uml.c | 383 struct virtqueue *vq; in vu_req_read_message() local 405 virtio_device_for_each_vq((&vu_dev->vdev), vq) { in vu_req_read_message() 406 if (vq->index == msg.msg.payload.vring_state.index) { in vu_req_read_message() 408 vu_dev->vq_irq_vq_map |= BIT_ULL(vq->index); in vu_req_read_message() 445 struct virtqueue *vq; in vu_req_interrupt() local 447 virtio_device_for_each_vq((&vu_dev->vdev), vq) { in vu_req_interrupt() 448 if (vu_dev->vq_irq_vq_map & BIT_ULL(vq->index)) in vu_req_interrupt() 449 vring_interrupt(0 /* ignored */, vq); in vu_req_interrupt() 791 static bool vu_notify(struct virtqueue *vq) in vu_notify() argument 793 struct virtio_uml_vq_info *info = vq->priv; in vu_notify() [all …]
|