Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio fixes from Michael Tsirkin:
"virtio,vhost: last minute fixes

More small fixes. Most notably this fixes crashes and hangs in
vhost-net"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
MAINTAINERS, mailmap: Update address for Peter Hilber
virtio_config: clarify output parameters
uapi: vduse: fix typo in comment
vhost: Take a reference on the task in struct vhost_task.
vhost-net: flush batched before enabling notifications
Revert "vhost/net: Defer TX queue re-enable until after sendmsg"
vhost-net: unbreak busy polling
vhost-scsi: fix argument order in tport allocation error message

+29 -32
+1
.mailmap
··· 623 623 Paulo Alcantara <pc@manguebit.org> <pc@manguebit.com> 624 624 Pavankumar Kondeti <quic_pkondeti@quicinc.com> <pkondeti@codeaurora.org> 625 625 Peter A Jonsson <pj@ludd.ltu.se> 626 + Peter Hilber <peter.hilber@oss.qualcomm.com> <quic_philber@quicinc.com> 626 627 Peter Oruba <peter.oruba@amd.com> 627 628 Peter Oruba <peter@oruba.de> 628 629 Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> <pierre-louis.bossart@linux.intel.com>
+1 -1
MAINTAINERS
··· 26785 26785 F: drivers/nvdimm/virtio_pmem.c 26786 26786 26787 26787 VIRTIO RTC DRIVER 26788 - M: Peter Hilber <quic_philber@quicinc.com> 26788 + M: Peter Hilber <peter.hilber@oss.qualcomm.com> 26789 26789 L: virtualization@lists.linux.dev 26790 26790 S: Maintained 26791 26791 F: drivers/virtio/virtio_rtc_*
+17 -23
drivers/vhost/net.c
··· 765 765 int err; 766 766 int sent_pkts = 0; 767 767 bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); 768 - bool busyloop_intr; 769 768 bool in_order = vhost_has_feature(vq, VIRTIO_F_IN_ORDER); 770 769 771 770 do { 772 - busyloop_intr = false; 771 + bool busyloop_intr = false; 772 + 773 773 if (nvq->done_idx == VHOST_NET_BATCH) 774 774 vhost_tx_batch(net, nvq, sock, &msg); 775 775 ··· 780 780 break; 781 781 /* Nothing new? Wait for eventfd to tell us they refilled. */ 782 782 if (head == vq->num) { 783 - /* Kicks are disabled at this point, break loop and 784 - * process any remaining batched packets. Queue will 785 - * be re-enabled afterwards. 783 + /* Flush batched packets to handle pending RX 784 + * work (if busyloop_intr is set) and to avoid 785 + * unnecessary virtqueue kicks. 786 786 */ 787 + vhost_tx_batch(net, nvq, sock, &msg); 788 + if (unlikely(busyloop_intr)) { 789 + vhost_poll_queue(&vq->poll); 790 + } else if (unlikely(vhost_enable_notify(&net->dev, 791 + vq))) { 792 + vhost_disable_notify(&net->dev, vq); 793 + continue; 794 + } 787 795 break; 788 796 } 789 797 ··· 847 839 ++nvq->done_idx; 848 840 } while (likely(!vhost_exceeds_weight(vq, ++sent_pkts, total_len))); 849 841 850 - /* Kicks are still disabled, dispatch any remaining batched msgs. */ 851 842 vhost_tx_batch(net, nvq, sock, &msg); 852 - 853 - if (unlikely(busyloop_intr)) 854 - /* If interrupted while doing busy polling, requeue the 855 - * handler to be fair handle_rx as well as other tasks 856 - * waiting on cpu. 857 - */ 858 - vhost_poll_queue(&vq->poll); 859 - else 860 - /* All of our work has been completed; however, before 861 - * leaving the TX handler, do one last check for work, 862 - * and requeue handler if necessary. If there is no work, 863 - * queue will be reenabled. 864 - */ 865 - vhost_net_busy_poll_try_queue(net, vq); 866 843 } 867 844 868 845 static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) ··· 1007 1014 } 1008 1015 1009 1016 static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk, 1010 - bool *busyloop_intr, unsigned int count) 1017 + bool *busyloop_intr, unsigned int *count) 1011 1018 { 1012 1019 struct vhost_net_virtqueue *rnvq = &net->vqs[VHOST_NET_VQ_RX]; 1013 1020 struct vhost_net_virtqueue *tnvq = &net->vqs[VHOST_NET_VQ_TX]; ··· 1017 1024 1018 1025 if (!len && rvq->busyloop_timeout) { 1019 1026 /* Flush batched heads first */ 1020 - vhost_net_signal_used(rnvq, count); 1027 + vhost_net_signal_used(rnvq, *count); 1028 + *count = 0; 1021 1029 /* Both tx vq and rx socket were polled here */ 1022 1030 vhost_net_busy_poll(net, rvq, tvq, busyloop_intr, true); 1023 1031 ··· 1174 1180 1175 1181 do { 1176 1182 sock_len = vhost_net_rx_peek_head_len(net, sock->sk, 1177 - &busyloop_intr, count); 1183 + &busyloop_intr, &count); 1178 1184 if (!sock_len) 1179 1185 break; 1180 1186 sock_len += sock_hlen;
+1 -1
drivers/vhost/scsi.c
··· 2884 2884 check_len: 2885 2885 if (strlen(name) >= VHOST_SCSI_NAMELEN) { 2886 2886 pr_err("Emulated %s Address: %s, exceeds" 2887 - " max: %d\n", name, vhost_scsi_dump_proto_id(tport), 2887 + " max: %d\n", vhost_scsi_dump_proto_id(tport), name, 2888 2888 VHOST_SCSI_NAMELEN); 2889 2889 kfree(tport); 2890 2890 return ERR_PTR(-EINVAL);
+6 -5
include/linux/virtio_config.h
··· 193 193 } 194 194 195 195 static inline void virtio_get_features(struct virtio_device *vdev, 196 - u64 *features) 196 + u64 *features_out) 197 197 { 198 198 if (vdev->config->get_extended_features) { 199 - vdev->config->get_extended_features(vdev, features); 199 + vdev->config->get_extended_features(vdev, features_out); 200 200 return; 201 201 } 202 202 203 - virtio_features_from_u64(features, vdev->config->get_features(vdev)); 203 + virtio_features_from_u64(features_out, 204 + vdev->config->get_features(vdev)); 204 205 } 205 206 206 207 /** ··· 327 326 328 327 static inline 329 328 bool virtio_get_shm_region(struct virtio_device *vdev, 330 - struct virtio_shm_region *region, u8 id) 329 + struct virtio_shm_region *region_out, u8 id) 331 330 { 332 331 if (!vdev->config->get_shm_region) 333 332 return false; 334 - return vdev->config->get_shm_region(vdev, region, id); 333 + return vdev->config->get_shm_region(vdev, region_out, id); 335 334 } 336 335 337 336 static inline bool virtio_is_little_endian(struct virtio_device *vdev)
+1 -1
include/uapi/linux/vduse.h
··· 237 237 * struct vduse_iova_info - information of one IOVA region 238 238 * @start: start of the IOVA region 239 239 * @last: last of the IOVA region 240 - * @capability: capability of the IOVA regsion 240 + * @capability: capability of the IOVA region 241 241 * @reserved: for future use, needs to be initialized to zero 242 242 * 243 243 * Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
+2 -1
kernel/vhost_task.c
··· 100 100 * freeing it below. 101 101 */ 102 102 wait_for_completion(&vtsk->exited); 103 + put_task_struct(vtsk->task); 103 104 kfree(vtsk); 104 105 } 105 106 EXPORT_SYMBOL_GPL(vhost_task_stop); ··· 149 148 return ERR_CAST(tsk); 150 149 } 151 150 152 - vtsk->task = tsk; 151 + vtsk->task = get_task_struct(tsk); 153 152 return vtsk; 154 153 } 155 154 EXPORT_SYMBOL_GPL(vhost_task_create);