Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-07-06 Thread Halil Pasic
On Sat, 4 Jul 2020 14:34:04 -0400 "Michael S. Tsirkin" wrote: > On Tue, Jun 16, 2020 at 06:50:34AM +0200, Halil Pasic wrote: > > The atomic_cmpxchg() loop is broken because we occasionally end up with > > old and _old having different values (a legit compiler can generate code > > that accessed *

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-07-05 Thread Christian Borntraeger
On 04.07.20 20:34, Michael S. Tsirkin wrote: > On Tue, Jun 16, 2020 at 06:50:34AM +0200, Halil Pasic wrote: >> The atomic_cmpxchg() loop is broken because we occasionally end up with >> old and _old having different values (a legit compiler can generate code >> that accessed *ind_addr again to p

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-07-04 Thread Michael S. Tsirkin
On Tue, Jun 16, 2020 at 06:50:34AM +0200, Halil Pasic wrote: > The atomic_cmpxchg() loop is broken because we occasionally end up with > old and _old having different values (a legit compiler can generate code > that accessed *ind_addr again to pick up a value for _old instead of > using the value

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-07-01 Thread Christian Borntraeger
On 16.06.20 06:50, Halil Pasic wrote: > The atomic_cmpxchg() loop is broken because we occasionally end up with > old and _old having different values (a legit compiler can generate code > that accessed *ind_addr again to pick up a value for _old instead of > using the value of old that was alre

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-19 Thread Halil Pasic
On Fri, 19 Jun 2020 09:33:44 +0200 David Hildenbrand wrote: > On 18.06.20 01:56, Halil Pasic wrote: > > On Tue, 16 Jun 2020 08:33:33 +0200 > > Cornelia Huck wrote: > > > >>> #define atomic_cmpxchg__nocheck(ptr, old, new)({ > >>> \ > >>> > >>> typeof_strip_qual

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-19 Thread David Hildenbrand
On 18.06.20 01:56, Halil Pasic wrote: > On Tue, 16 Jun 2020 08:33:33 +0200 > Cornelia Huck wrote: > >>> #define atomic_cmpxchg__nocheck(ptr, old, new)({\ >>> >>> >>> typeof_strip_qual(*ptr) _old = (old); \ >>> >>> >>> (v

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-19 Thread Cornelia Huck
On Tue, 16 Jun 2020 08:45:14 +0200 Christian Borntraeger wrote: > On 16.06.20 08:33, Cornelia Huck wrote: > > On Tue, 16 Jun 2020 07:58:53 +0200 > > Christian Borntraeger wrote: > > > >> On 16.06.20 06:50, Halil Pasic wrote: > >>> The atomic_cmpxchg() loop is broken because we occasionally

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-17 Thread Halil Pasic
On Tue, 16 Jun 2020 08:33:33 +0200 Cornelia Huck wrote: > > #define atomic_cmpxchg__nocheck(ptr, old, new)({\ > > > > > > typeof_strip_qual(*ptr) _old = (old); \ > > > > > > (void)__atomic_compare_exchange_n(ptr, &_old,

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-16 Thread Halil Pasic
On Tue, 16 Jun 2020 07:58:53 +0200 Christian Borntraeger wrote: > > > On 16.06.20 06:50, Halil Pasic wrote: > > The atomic_cmpxchg() loop is broken because we occasionally end up with > > old and _old having different values (a legit compiler can generate code > > that accessed *ind_addr again

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-15 Thread Christian Borntraeger
On 16.06.20 08:33, Cornelia Huck wrote: > On Tue, 16 Jun 2020 07:58:53 +0200 > Christian Borntraeger wrote: > >> On 16.06.20 06:50, Halil Pasic wrote: >>> The atomic_cmpxchg() loop is broken because we occasionally end up with >>> old and _old having different values (a legit compiler can gene

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-15 Thread Cornelia Huck
On Tue, 16 Jun 2020 07:58:53 +0200 Christian Borntraeger wrote: > On 16.06.20 06:50, Halil Pasic wrote: > > The atomic_cmpxchg() loop is broken because we occasionally end up with > > old and _old having different values (a legit compiler can generate code > > that accessed *ind_addr again to pic

Re: [PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-15 Thread Christian Borntraeger
On 16.06.20 06:50, Halil Pasic wrote: > The atomic_cmpxchg() loop is broken because we occasionally end up with > old and _old having different values (a legit compiler can generate code > that accessed *ind_addr again to pick up a value for _old instead of > using the value of old that was alre

[PATCH 1/2] virtio-ccw: fix virtio_set_ind_atomic

2020-06-15 Thread Halil Pasic
The atomic_cmpxchg() loop is broken because we occasionally end up with old and _old having different values (a legit compiler can generate code that accessed *ind_addr again to pick up a value for _old instead of using the value of old that was already fetched according to the rules of the abstrac