diff options
author | Jason Wang <jasowang@redhat.com> | 2021-11-11 14:38:53 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-11-15 09:44:46 -0500 |
commit | f463e761a41ee71e59892121e1c74d9c25c985d2 (patch) | |
tree | 79ec77f3342d31d0b45240b5559180ff277c1106 /bsd-user/x86_64 | |
parent | 7e6055c99f2f1f5e6a206e8d07a9f45508832611 (diff) | |
download | qemu-f463e761a41ee71e59892121e1c74d9c25c985d2.zip qemu-f463e761a41ee71e59892121e1c74d9c25c985d2.tar.gz qemu-f463e761a41ee71e59892121e1c74d9c25c985d2.tar.bz2 |
virtio: use virtio accessor to access packed descriptor flags
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>
Message-Id: <20211111063854.29060-1-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 'bsd-user/x86_64')
0 files changed, 0 insertions, 0 deletions