Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags

2021-11-14 Thread Jason Wang
On Fri, Nov 12, 2021 at 6:04 PM Michael S. Tsirkin wrote: > > On Fri, Nov 12, 2021 at 10:23:12AM +0800, Jason Wang wrote: > > On Thu, Nov 11, 2021 at 4:27 PM Michael S. Tsirkin wrote: > > > > > > On Thu, Nov 11, 2021 at 02:38:53PM +0800, Jason Wang wrote: > > > > We used to access packed

Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags

2021-11-12 Thread Michael S. Tsirkin
On Fri, Nov 12, 2021 at 10:23:12AM +0800, Jason Wang wrote: > On Thu, Nov 11, 2021 at 4:27 PM Michael S. Tsirkin wrote: > > > > On Thu, Nov 11, 2021 at 02:38:53PM +0800, Jason Wang wrote: > > > We used to access packed descriptor flags via > > > address_space_{write|read}_cached(). When we hit

Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags

2021-11-11 Thread Jason Wang
On Thu, Nov 11, 2021 at 4:27 PM Michael S. Tsirkin wrote: > > On Thu, Nov 11, 2021 at 02:38:53PM +0800, 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

Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags

2021-11-11 Thread Michael S. Tsirkin
On Thu, Nov 11, 2021 at 02:38:53PM +0800, 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. Could you clarify where's

Re: [PATCH 1/2] virtio: use virtio accessor to access packed descriptor flags

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