qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Jason Wang <jasowang@redhat.com>, mst@redhat.com
Cc: eperezma@redhat.com, qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PATCH 2/2] virtio: use virtio accessor to access packed event
Date: Thu, 11 Nov 2021 08:51:10 +0100	[thread overview]
Message-ID: <79d3326b-e6ac-86e1-2baa-466666e30af9@redhat.com> (raw)
In-Reply-To: <20211111063854.29060-2-jasowang@redhat.com>

On 11/11/21 07:38, Jason Wang wrote:
> We used to access packed descriptor event and off_wrap via
> address_space_{write|read}_cached(). When we hit the cache, memcpy()
> is used which is not atomic which may lead a wrong value to be read or
> wrote.
> 
> This patch fixes this by switching to use
> virito_{stw|lduw}_phys_cached() to make sure the access is atomic.
> 
> Fixes: 683f7665679c1 ("virtio: event suppression support for packed ring")
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  hw/virtio/virtio.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

No cover so asking here, what about vring_packed_desc_read()?



  reply	other threads:[~2021-11-11  7:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11  6:38 [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags Jason Wang
2021-11-11  6:38 ` [PATCH 2/2] virtio: use virtio accessor to access packed event Jason Wang
2021-11-11  7:51   ` Philippe Mathieu-Daudé [this message]
2021-11-12  2:30     ` Jason Wang
2021-11-11  7:51 ` [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags Philippe Mathieu-Daudé
2021-11-11  8:27 ` Michael S. Tsirkin
2021-11-12  2:23   ` Jason Wang
2021-11-12 10:04     ` Michael S. Tsirkin
2021-11-15  4:20       ` Jason Wang

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=79d3326b-e6ac-86e1-2baa-466666e30af9@redhat.com \
    --to=philmd@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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).