diff options
| author | Jason Wang | 2021-11-11 07:38:54 +0100 |
|---|---|---|
| committer | Michael S. Tsirkin | 2021-11-15 15:44:46 +0100 |
| commit | d152cdd6f6fad381e804c8185f0ba938030ccac9 (patch) | |
| tree | 709d58d6a95c3d99886ddf805752e841b3fafddb /include | |
| parent | virtio: use virtio accessor to access packed descriptor flags (diff) | |
| download | qemu-d152cdd6f6fad381e804c8185f0ba938030ccac9.tar.gz qemu-d152cdd6f6fad381e804c8185f0ba938030ccac9.tar.xz qemu-d152cdd6f6fad381e804c8185f0ba938030ccac9.zip | |
virtio: use virtio accessor to access packed event
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>
Message-Id: <20211111063854.29060-2-jasowang@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
