Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-27 Thread Gavin Shan
On 3/27/24 17:42, Jason Wang wrote: On Wed, Mar 27, 2024 at 3:35 PM Gavin Shan wrote: On 3/27/24 14:08, Gavin Shan wrote: On 3/27/24 12:44, Jason Wang wrote: On Wed, Mar 27, 2024 at 10:34 AM Jason Wang wrote: On Wed, Mar 27, 2024 at 7:39 AM Gavin Shan wrote: A smp_rmb() has been missed

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-27 Thread Gavin Shan
On 3/27/24 22:07, Michael S. Tsirkin wrote: On Wed, Mar 27, 2024 at 09:38:45AM +1000, Gavin Shan wrote: A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by Will Deacon . Otherwise, it's not ensured the available ring entries pushed by guest can be observed by vhost in time,

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-27 Thread Michael S. Tsirkin
On Wed, Mar 27, 2024 at 09:38:45AM +1000, Gavin Shan wrote: > A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by > Will Deacon . Otherwise, it's not ensured the > available ring entries pushed by guest can be observed by vhost > in time, leading to stale available ring entries

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-27 Thread Jason Wang
On Wed, Mar 27, 2024 at 3:35 PM Gavin Shan wrote: > > On 3/27/24 14:08, Gavin Shan wrote: > > On 3/27/24 12:44, Jason Wang wrote: > >> On Wed, Mar 27, 2024 at 10:34 AM Jason Wang wrote: > >>> On Wed, Mar 27, 2024 at 7:39 AM Gavin Shan wrote: > > A smp_rmb() has been missed in

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-27 Thread Gavin Shan
On 3/27/24 14:08, Gavin Shan wrote: On 3/27/24 12:44, Jason Wang wrote: On Wed, Mar 27, 2024 at 10:34 AM Jason Wang wrote: On Wed, Mar 27, 2024 at 7:39 AM Gavin Shan wrote: A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by Will Deacon . Otherwise, it's not ensured the

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-26 Thread Gavin Shan
On 3/27/24 12:44, Jason Wang wrote: On Wed, Mar 27, 2024 at 10:34 AM Jason Wang wrote: On Wed, Mar 27, 2024 at 7:39 AM Gavin Shan wrote: A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by Will Deacon . Otherwise, it's not ensured the available ring entries pushed by guest can

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-26 Thread Jason Wang
On Wed, Mar 27, 2024 at 10:34 AM Jason Wang wrote: > > On Wed, Mar 27, 2024 at 7:39 AM Gavin Shan wrote: > > > > A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by > > Will Deacon . Otherwise, it's not ensured the > > available ring entries pushed by guest can be observed by vhost

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-26 Thread Jason Wang
On Wed, Mar 27, 2024 at 7:39 AM Gavin Shan wrote: > > A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by > Will Deacon . Otherwise, it's not ensured the > available ring entries pushed by guest can be observed by vhost > in time, leading to stale available ring entries fetched by

[PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-26 Thread Gavin Shan
A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by Will Deacon . Otherwise, it's not ensured the available ring entries pushed by guest can be observed by vhost in time, leading to stale available ring entries fetched by vhost in vhost_get_vq_desc(), as reported by Yihuang Yu on