qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: wangliangzz@126.com
To: qemu-devel@nongnu.org
Cc: pagupta@redhat.com, david@redhat.com, mst@redhat.com,
	armbru@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
	dan.j.williams@intel.com, Wang Liang <wangliangzz@inspur.com>
Subject: [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem
Date: Tue, 16 Mar 2021 22:41:45 -0400	[thread overview]
Message-ID: <20210317024145.271212-1-wangliangzz@126.com> (raw)

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



             reply	other threads:[~2021-03-17  7:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  2:41 wangliangzz [this message]
2021-03-17  9:12 ` [PATCH] virtio-pmem: fix virtio_pmem_resp assign problem Stefano Garzarella
2021-03-17  9:14 ` David Hildenbrand
2021-03-17 10:50 ` Pankaj Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210317024145.271212-1-wangliangzz@126.com \
    --to=wangliangzz@126.com \
    --cc=armbru@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=mst@redhat.com \
    --cc=pagupta@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wangliangzz@inspur.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).