lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zj3KmQMKsTJ480Ea@lzaremba-mobl.ger.corp.intel.com>
Date: Fri, 10 May 2024 09:19:53 +0200
From: Larysa Zaremba <larysa.zaremba@...el.com>
To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
CC: <netdev@...r.kernel.org>, "Michael S. Tsirkin" <mst@...hat.com>, "Jason
 Wang" <jasowang@...hat.com>, "David S. Miller" <davem@...emloft.net>, "Eric
 Dumazet" <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, <virtualization@...ts.linux.dev>
Subject: Re: [PATCH net-next v4 1/4] virtio_ring: enable premapped mode
 whatever use_dma_api

On Wed, May 08, 2024 at 02:37:15PM +0800, Xuan Zhuo wrote:
> Now, we have virtio DMA APIs, the driver can be the premapped
> mode whatever the virtio core uses dma api or not.
> 
> So remove the limit of checking use_dma_api from
> virtqueue_set_dma_premapped().
> 
> Signed-off-by: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
> Acked-by: Jason Wang <jasowang@...hat.com>
> ---
>  drivers/virtio/virtio_ring.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 6f7e5010a673..85d0dc26ae9f 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -2782,7 +2782,7 @@ EXPORT_SYMBOL_GPL(virtqueue_resize);
>   *
>   * Returns zero or a negative error.
>   * 0: success.
> - * -EINVAL: vring does not use the dma api, so we can not enable premapped mode.
> + * -EINVAL: the vq is in use.

To me it sounds more like -EBUSY with the current error description.
But I suspect that the error is returned, when the following condition is not 
met:

* This function must be called immediately after creating the vq, or after vq 
* reset, and before adding any buffers to it.

If I am not mistaking, then a better way to put it would be:
* -EINVAL: too late to enable premapped mode, the vq already contains buffers

>   */
>  int virtqueue_set_dma_premapped(struct virtqueue *_vq)
>  {
> @@ -2798,11 +2798,6 @@ int virtqueue_set_dma_premapped(struct virtqueue *_vq)
>  		return -EINVAL;
>  	}
>  
> -	if (!vq->use_dma_api) {
> -		END_USE(vq);
> -		return -EINVAL;
> -	}
> -
>  	vq->premapped = true;
>  	vq->do_unmap = false;
>  
> -- 
> 2.32.0.3.g01195cf9f
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ