All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem
@ 2021-03-17  2:41 wangliangzz
  2021-03-17  9:12 ` Stefano Garzarella
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wangliangzz @ 2021-03-17  2:41 UTC (permalink / raw
  To: qemu-devel
  Cc: pagupta, david, mst, armbru, stefanha, pbonzini, dan.j.williams,
	Wang Liang

From: Wang Liang <wangliangzz@inspur.com>

ret in virtio_pmem_resp is a uint32_t variable, which should be assigned
using virtio_stl_p.

The kernel side driver does not guarantee virtio_pmem_resp to be initialized
to zero in advance, So sometimes the flush operation will fail.

Signed-off-by: Wang Liang <wangliangzz@inspur.com>
---
 hw/virtio/virtio-pmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
index a3e0688a89..d1aeb90a31 100644
--- a/hw/virtio/virtio-pmem.c
+++ b/hw/virtio/virtio-pmem.c
@@ -47,7 +47,7 @@ static int worker_cb(void *opaque)
         err = 1;
     }
 
-    virtio_stw_p(req_data->vdev, &req_data->resp.ret, err);
+    virtio_stl_p(req_data->vdev, &req_data->resp.ret, err);
 
     return 0;
 }
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem
  2021-03-17  2:41 [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem wangliangzz
@ 2021-03-17  9:12 ` Stefano Garzarella
  2021-03-17  9:14 ` David Hildenbrand
  2021-03-17 10:50 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Garzarella @ 2021-03-17  9:12 UTC (permalink / raw
  To: wangliangzz
  Cc: pagupta, mst, david, qemu-devel, armbru, stefanha, pbonzini,
	dan.j.williams, Wang Liang

On Tue, Mar 16, 2021 at 10:41:45PM -0400, wangliangzz@126.com wrote:
>From: Wang Liang <wangliangzz@inspur.com>
>
>ret in virtio_pmem_resp is a uint32_t variable, which should be assigned
>using virtio_stl_p.
>
>The kernel side driver does not guarantee virtio_pmem_resp to be initialized
>to zero in advance, So sometimes the flush operation will fail.
>
>Signed-off-by: Wang Liang <wangliangzz@inspur.com>
>---
> hw/virtio/virtio-pmem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem
  2021-03-17  2:41 [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem wangliangzz
  2021-03-17  9:12 ` Stefano Garzarella
@ 2021-03-17  9:14 ` David Hildenbrand
  2021-03-17 10:50 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2021-03-17  9:14 UTC (permalink / raw
  To: wangliangzz, qemu-devel
  Cc: mst, armbru, Pankaj Gupta, stefanha, pbonzini, dan.j.williams,
	Wang Liang

On 17.03.21 03:41, wangliangzz@126.com wrote:
> From: Wang Liang <wangliangzz@inspur.com>
> 
> ret in virtio_pmem_resp is a uint32_t variable, which should be assigned
> using virtio_stl_p.
> 
> The kernel side driver does not guarantee virtio_pmem_resp to be initialized
> to zero in advance, So sometimes the flush operation will fail.
> 
> Signed-off-by: Wang Liang <wangliangzz@inspur.com>
> ---
>   hw/virtio/virtio-pmem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
> index a3e0688a89..d1aeb90a31 100644
> --- a/hw/virtio/virtio-pmem.c
> +++ b/hw/virtio/virtio-pmem.c
> @@ -47,7 +47,7 @@ static int worker_cb(void *opaque)
>           err = 1;
>       }
>   
> -    virtio_stw_p(req_data->vdev, &req_data->resp.ret, err);
> +    virtio_stl_p(req_data->vdev, &req_data->resp.ret, err);
>   
>       return 0;
>   }
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem
  2021-03-17  2:41 [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem wangliangzz
  2021-03-17  9:12 ` Stefano Garzarella
  2021-03-17  9:14 ` David Hildenbrand
@ 2021-03-17 10:50 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: Pankaj Gupta @ 2021-03-17 10:50 UTC (permalink / raw
  To: wangliangzz
  Cc: pagupta, Michael S . Tsirkin, David Hildenbrand, Qemu Developers,
	Markus Armbruster, Stefan Hajnoczi, Paolo Bonzini, Dan Williams,
	Wang Liang

> ret in virtio_pmem_resp is a uint32_t variable, which should be assigned
> using virtio_stl_p.
>
> The kernel side driver does not guarantee virtio_pmem_resp to be initialized
> to zero in advance, So sometimes the flush operation will fail.
>
> Signed-off-by: Wang Liang <wangliangzz@inspur.com>
> ---
>  hw/virtio/virtio-pmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
> index a3e0688a89..d1aeb90a31 100644
> --- a/hw/virtio/virtio-pmem.c
> +++ b/hw/virtio/virtio-pmem.c
> @@ -47,7 +47,7 @@ static int worker_cb(void *opaque)
>          err = 1;
>      }
>
> -    virtio_stw_p(req_data->vdev, &req_data->resp.ret, err);
> +    virtio_stl_p(req_data->vdev, &req_data->resp.ret, err);
>
>      return 0;
>  }

Thanks!
Reviewed-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-17 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-17  2:41 [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem wangliangzz
2021-03-17  9:12 ` Stefano Garzarella
2021-03-17  9:14 ` David Hildenbrand
2021-03-17 10:50 ` Pankaj Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.