Re: [PATCH v1 2/2] vdpa/mlx5: Add support for reading descriptor statistics

2022-03-02 Thread Jason Wang
在 2022/2/16 下午4:00, Eli Cohen 写道: Implement the get_vq_stats calback of vdpa_config_ops to return the statistics for a virtqueue. The statistics are provided as vendor specific statistics where the driver provides a pair of attribute name and attribute value. Currently supported are received d

Re: [PATCH v1 1/2] vdpa: Add support for querying vendor statistics

2022-03-02 Thread Jason Wang
在 2022/2/16 下午4:00, Eli Cohen 写道: Allows to read vendor statistics of a vdpa device. The specific statistics data is received by the upstream driver in the form of an (attribute name, attribute value) pairs. An example of statistics for mlx5_vdpa device are: received_desc - number of descripto

Re: [PATCH v2 07/14] vhost: Shadow virtqueue buffers forwarding

2022-03-02 Thread Jason Wang
在 2022/3/3 上午2:23, Eugenio Perez Martin 写道: + +static bool vhost_svq_add_split(VhostShadowVirtqueue *svq, +VirtQueueElement *elem, +unsigned *head) +{ +unsigned avail_idx; +vring_avail_t *avail = svq->vring.avail; + +*he

Re: [PATCH v2 10/14] vdpa: Add custom IOTLB translations to SVQ

2022-03-02 Thread Jason Wang
在 2022/3/1 下午4:50, Eugenio Perez Martin 写道: On Mon, Feb 28, 2022 at 8:37 AM Jason Wang wrote: 在 2022/2/27 下午9:41, Eugenio Pérez 写道: Use translations added in VhostIOVATree in SVQ. Only introduce usage here, not allocation and deallocation. As with previous patches, we use the dead code path

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Thu, Mar 03, 2022 at 11:31:35AM +0800, Yongji Xie wrote: > On Wed, Mar 2, 2022 at 11:05 PM Max Gurtovoy wrote: > > > > > > On 3/2/2022 3:15 PM, Michael S. Tsirkin wrote: > > > On Wed, Mar 02, 2022 at 06:46:03PM +0800, Yongji Xie wrote: > > >> On Tue, Mar 1, 2022 at 11:43 PM Michael S. Tsirkin

Re: [PATCH v2 08/14] util: Add iova_tree_alloc

2022-03-02 Thread Jason Wang
在 2022/3/1 下午6:06, Eugenio Perez Martin 写道: + +/* + * Find a valid hole for the mapping + * + * Assuming low iova_begin, so no need to do a binary search to + * locate the first node. + * + * TODO: Replace all this with g_tree_node_first/next/last when available +

Re: [virtio-comment] [PATCH v5 1/2] virtio-vsock: add description for datagram type

2022-03-02 Thread Michael S. Tsirkin
On Thu, Mar 03, 2022 at 03:29:31AM +, Bobby Eshleman wrote: > On Wed, Mar 02, 2022 at 05:09:58PM +0100, Stefano Garzarella wrote: > > Hi Bobby, > > Sorry for the delay, but I saw these patches today. > > Please, can you keep me in CC? > > > > Hey Stefano, sorry about that. I'm not sure how I

Re: [PATCH v2 02/14] vhost: Add Shadow VirtQueue kick forwarding capabilities

2022-03-02 Thread Jason Wang
在 2022/3/2 上午2:49, Eugenio Perez Martin 写道: On Mon, Feb 28, 2022 at 3:57 AM Jason Wang wrote: 在 2022/2/27 下午9:40, Eugenio Pérez 写道: At this mode no buffer forwarding will be performed in SVQ mode: Qemu will just forward the guest's kicks to the device. Host memory notifiers regions are left

Re: [PATCH net-next] tuntap: add sanity checks about msg_controllen in sendmsg

2022-03-02 Thread Jason Wang
在 2022/3/3 上午10:24, Harold Huang 写道: In patch [1], tun_msg_ctl was added to allow pass batched xdp buffers to tun_sendmsg. Although we donot use msg_controllen in this path, we should check msg_controllen to make sure the caller pass a valid msg_ctl. [1]: https://git.kernel.org/pub/scm/linux/k

Re: Re: [PATCH v3 0/4] Introduce akcipher service for virtio-crypto

2022-03-02 Thread zhenwei pi
On 3/3/22 4:40 AM, Eric Biggers wrote: On Wed, Mar 02, 2022 at 11:39:13AM +0800, zhenwei pi wrote: v2 -> v3: Rename virtio_crypto_algs.c to virtio_crypto_skcipher_algs.c, and minor changes of function name. Minor changes in virtio_crypto_akcipher_algs.c: no need to copy from buff

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 04:49:17PM +, Lee Jones wrote: On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: On Wed, Mar 02, 2022 at 05:28:31PM +0100, Stefano Garzarella wrote: > On Wed, Mar 2, 2022 at 3:57 PM Lee Jones wrote: > > > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > > > On We

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Lee Jones
On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > On Wed, Mar 02, 2022 at 05:28:31PM +0100, Stefano Garzarella wrote: > > On Wed, Mar 2, 2022 at 3:57 PM Lee Jones wrote: > > > > > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > > > > > On Wed, Mar 02, 2022 at 01:56:35PM +, Lee Jones wro

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 05:28:31PM +0100, Stefano Garzarella wrote: > On Wed, Mar 2, 2022 at 3:57 PM Lee Jones wrote: > > > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > > > On Wed, Mar 02, 2022 at 01:56:35PM +, Lee Jones wrote: > > > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: >

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 2, 2022 at 3:57 PM Lee Jones wrote: > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > On Wed, Mar 02, 2022 at 01:56:35PM +, Lee Jones wrote: > > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > > > > > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > > >

Re: [virtio-comment] [PATCH v5 2/2] virtio-vsock: add mergeable buffer feature bit

2022-03-02 Thread Stefano Garzarella
On Thu, Feb 24, 2022 at 10:15:47PM +, beshleman.dev...@gmail.com wrote: From: Jiang Wang Add support for mergeable buffers for virtio-vsock. Mergeable buffers allow individual large packets to be spread across multiple buffers while still using only a single packet header. This avoids artif

Re: [virtio-comment] [PATCH v5 1/2] virtio-vsock: add description for datagram type

2022-03-02 Thread Stefano Garzarella
Hi Bobby, Sorry for the delay, but I saw these patches today. Please, can you keep me in CC? On Thu, Feb 24, 2022 at 10:15:46PM +, beshleman.dev...@gmail.com wrote: From: Jiang Wang Add supports for datagram type for virtio-vsock. Datagram sockets are connectionless and unreliable. To avoi

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 09:50:38AM -0500, Michael S. Tsirkin wrote: On Wed, Mar 02, 2022 at 03:11:21PM +0100, Stefano Garzarella wrote: On Wed, Mar 02, 2022 at 08:35:08AM -0500, Michael S. Tsirkin wrote: > On Wed, Mar 02, 2022 at 10:34:46AM +0100, Stefano Garzarella wrote: > > On Wed, Mar 02, 20

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Lee Jones
On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > On Wed, Mar 02, 2022 at 01:56:35PM +, Lee Jones wrote: > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > > > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > > > vhost_vsock_handle_tx_kick() already holds the mutex during i

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 01:56:35PM +, Lee Jones wrote: > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > > to vhost_get_vq_desc(). All we have to do i

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 03:11:21PM +0100, Stefano Garzarella wrote: > On Wed, Mar 02, 2022 at 08:35:08AM -0500, Michael S. Tsirkin wrote: > > On Wed, Mar 02, 2022 at 10:34:46AM +0100, Stefano Garzarella wrote: > > > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > > > vhost_vsock_hand

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 04:27:15PM +0200, Max Gurtovoy wrote: > > On 3/2/2022 4:15 PM, Michael S. Tsirkin wrote: > > On Wed, Mar 02, 2022 at 03:45:10PM +0200, Max Gurtovoy wrote: > > > On 3/2/2022 3:33 PM, Michael S. Tsirkin wrote: > > > > On Wed, Mar 02, 2022 at 03:24:51PM +0200, Max Gurtovoy wro

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 09:53:17PM +0800, Yongji Xie wrote: > On Wed, Mar 2, 2022 at 9:33 PM Michael S. Tsirkin wrote: > > > > On Wed, Mar 02, 2022 at 03:24:51PM +0200, Max Gurtovoy wrote: > > > > > > On 3/2/2022 3:17 PM, Michael S. Tsirkin wrote: > > > > On Wed, Mar 02, 2022 at 11:51:27AM +0200,

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 03:45:10PM +0200, Max Gurtovoy wrote: > > On 3/2/2022 3:33 PM, Michael S. Tsirkin wrote: > > On Wed, Mar 02, 2022 at 03:24:51PM +0200, Max Gurtovoy wrote: > > > On 3/2/2022 3:17 PM, Michael S. Tsirkin wrote: > > > > On Wed, Mar 02, 2022 at 11:51:27AM +0200, Max Gurtovoy wro

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 08:35:08AM -0500, Michael S. Tsirkin wrote: On Wed, Mar 02, 2022 at 10:34:46AM +0100, Stefano Garzarella wrote: On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > vhost_vsock_handle_tx_kick() already holds the mutex during its call > to vhost_get_vq_desc(). All

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Lee Jones
On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do is take the same lock > > during virtqueue clean-up and we mitigate th

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 10:34:46AM +0100, Stefano Garzarella wrote: > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do is take the same lock > > during virtqueue clean-u

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 03:24:51PM +0200, Max Gurtovoy wrote: > > On 3/2/2022 3:17 PM, Michael S. Tsirkin wrote: > > On Wed, Mar 02, 2022 at 11:51:27AM +0200, Max Gurtovoy wrote: > > > On 3/1/2022 5:43 PM, Michael S. Tsirkin wrote: > > > > On Mon, Feb 28, 2022 at 02:57:20PM +0800, Xie Yongji wrote

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > vhost_vsock_handle_tx_kick() already holds the mutex during its call > to vhost_get_vq_desc(). All we have to do is take the same lock > during virtqueue clean-up and we mitigate the reported issues. > > Link: https://syzkaller.appspot.

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 11:51:27AM +0200, Max Gurtovoy wrote: > > On 3/1/2022 5:43 PM, Michael S. Tsirkin wrote: > > On Mon, Feb 28, 2022 at 02:57:20PM +0800, Xie Yongji wrote: > > > Currently we have a BUG_ON() to make sure the number of sg > > > list does not exceed queue_max_segments() in virti

Re: [PATCH v2] virtio-blk: Remove BUG_ON() in virtio_queue_rq()

2022-03-02 Thread Michael S. Tsirkin
On Wed, Mar 02, 2022 at 06:46:03PM +0800, Yongji Xie wrote: > On Tue, Mar 1, 2022 at 11:43 PM Michael S. Tsirkin wrote: > > > > On Mon, Feb 28, 2022 at 02:57:20PM +0800, Xie Yongji wrote: > > > Currently we have a BUG_ON() to make sure the number of sg > > > list does not exceed queue_max_segments

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Lee Jones
On Wed, 02 Mar 2022, Stefano Garzarella wrote: > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do is take the same lock > > during virtqueue clean-up and we mitigate th

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: vhost_vsock_handle_tx_kick() already holds the mutex during its call to vhost_get_vq_desc(). All we have to do is take the same lock during virtqueue clean-up and we mitigate the reported issues. Link: https://syzkaller.appspot.com/bug?

Re: [syzbot] kernel BUG in vhost_get_vq_desc

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 10:18:07AM +0100, Stefano Garzarella wrote: On Wed, Mar 02, 2022 at 08:29:41AM +, Lee Jones wrote: On Fri, 18 Feb 2022, Michael S. Tsirkin wrote: On Thu, Feb 17, 2022 at 05:21:20PM -0800, syzbot wrote: syzbot has found a reproducer for the following issue on: HEAD

Re: [syzbot] kernel BUG in vhost_get_vq_desc

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 08:29:41AM +, Lee Jones wrote: On Fri, 18 Feb 2022, Michael S. Tsirkin wrote: On Thu, Feb 17, 2022 at 05:21:20PM -0800, syzbot wrote: > syzbot has found a reproducer for the following issue on: > > HEAD commit:f71077a4d84b Merge tag 'mmc-v5.17-rc1-2' of git://git

Re: [syzbot] kernel BUG in vhost_get_vq_desc

2022-03-02 Thread Lee Jones
On Fri, 18 Feb 2022, Michael S. Tsirkin wrote: > On Thu, Feb 17, 2022 at 05:21:20PM -0800, syzbot wrote: > > syzbot has found a reproducer for the following issue on: > > > > HEAD commit:f71077a4d84b Merge tag 'mmc-v5.17-rc1-2' of git://git.kern.. > > git tree: upstream > > console outp