Re: [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device

2022-07-05 Thread Stefano Garzarella

On Mon, Jul 04, 2022 at 03:06:39PM -0400, Michael S. Tsirkin wrote:

On Mon, Jul 04, 2022 at 07:16:58PM +0200, Stefano Garzarella wrote:

Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken
to true, so we need to call __virtio_unbreak_device() before starting
to use it.

Signed-off-by: Stefano Garzarella 


I think this shouldn't be necessary with latest master.


Right, c346dae4f3fb ("virtio: disable notification hardening by default")
is merged now.

I'll remove this patch.

Thanks,
Stefano




---
 tools/virtio/linux/virtio.h | 2 ++
 tools/virtio/virtio_test.c  | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
index 363b98228301..feb720d4304f 100644
--- a/tools/virtio/linux/virtio.h
+++ b/tools/virtio/linux/virtio.h
@@ -66,4 +66,6 @@ struct virtqueue *vring_new_virtqueue(unsigned int index,
  const char *name);
 void vring_del_virtqueue(struct virtqueue *vq);

+void __virtio_unbreak_device(struct virtio_device *dev);
+
 #endif
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index 23f142af544a..765e64895dab 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -177,6 +177,7 @@ static void run_test(struct vdev_info *dev, struct vq_info 
*vq,
long long spurious = 0;
const bool random_batch = batch == RANDOM_BATCH;

+   __virtio_unbreak_device(>vdev);
r = ioctl(dev->control, VHOST_TEST_RUN, );
assert(r >= 0);
if (!reset_n) {
--
2.36.1




___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 07:16:58PM +0200, Stefano Garzarella wrote:
> Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken
> to true, so we need to call __virtio_unbreak_device() before starting
> to use it.
> 
> Signed-off-by: Stefano Garzarella 

I think this shouldn't be necessary with latest master.

> ---
>  tools/virtio/linux/virtio.h | 2 ++
>  tools/virtio/virtio_test.c  | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
> index 363b98228301..feb720d4304f 100644
> --- a/tools/virtio/linux/virtio.h
> +++ b/tools/virtio/linux/virtio.h
> @@ -66,4 +66,6 @@ struct virtqueue *vring_new_virtqueue(unsigned int index,
> const char *name);
>  void vring_del_virtqueue(struct virtqueue *vq);
>  
> +void __virtio_unbreak_device(struct virtio_device *dev);
> +
>  #endif
> diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
> index 23f142af544a..765e64895dab 100644
> --- a/tools/virtio/virtio_test.c
> +++ b/tools/virtio/virtio_test.c
> @@ -177,6 +177,7 @@ static void run_test(struct vdev_info *dev, struct 
> vq_info *vq,
>   long long spurious = 0;
>   const bool random_batch = batch == RANDOM_BATCH;
>  
> + __virtio_unbreak_device(>vdev);
>   r = ioctl(dev->control, VHOST_TEST_RUN, );
>   assert(r >= 0);
>   if (!reset_n) {
> -- 
> 2.36.1

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization