[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags |
Date: |
Thu, 11 Nov 2021 08:51:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 11/11/21 07:38, Jason Wang wrote:
> We used to access packed descriptor flags via
> address_space_{write|read}_cached(). When we hit the cache, memcpy()
> is used which is not an atomic operation which may lead a wrong value
> is read or wrote.
>
> So this patch switches to use virito_{stw|lduw}_phys_cached() to make
> sure the aceess is atomic.
>
> Fixes: 86044b24e865f ("virtio: basic packed virtqueue support")
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/virtio/virtio.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>