Re: [PATCH 2/2] virtio: use virtio accessor to access packed event

2021-11-11 Thread Jason Wang
On Thu, Nov 11, 2021 at 3:51 PM Philippe Mathieu-Daudé wrote: > > 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 valu

Re: [PATCH 2/2] virtio: use virtio accessor to access packed event

2021-11-10 Thread Philippe Mathieu-Daudé
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 >

[PATCH 2/2] virtio: use virtio accessor to access packed event

2021-11-10 Thread Jason Wang
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 a