Re: [PATCH 02/12] evtchn: avoid race in get_xen_consumer()

2020-09-29 Thread Jan Beulich
On 29.09.2020 17:44, Paul Durrant wrote: >> From: Xen-devel On Behalf Of Jan >> Beulich >> Sent: 28 September 2020 11:57 >> >> @@ -81,7 +82,7 @@ static uint8_t get_xen_consumer(xen_even >> for ( i = 0; i < ARRAY_SIZE(xen_consumers); i++ ) >> { >> if ( xen_consumers[i] == NULL )

RE: [PATCH 02/12] evtchn: avoid race in get_xen_consumer()

2020-09-29 Thread Paul Durrant
> -Original Message- > From: Xen-devel On Behalf Of Jan > Beulich > Sent: 28 September 2020 11:57 > To: xen-devel@lists.xenproject.org > Cc: Andrew Cooper ; George Dunlap > ; Ian > Jackson ; Julien Grall ; Wei Liu > ; Stefano Stabellini > > Subject: [P

Re: [PATCH 02/12] evtchn: avoid race in get_xen_consumer()

2020-09-29 Thread Julien Grall
Hi Jan, On 28/09/2020 11:56, Jan Beulich wrote: There's no global lock around the updating of this global piece of data. Make use of cmpxchg() to avoid two entities racing with their updates. Signed-off-by: Jan Beulich --- TBD: Initially I used cmpxchgptr() here, until realizing Arm doesn't

[PATCH 02/12] evtchn: avoid race in get_xen_consumer()

2020-09-28 Thread Jan Beulich
There's no global lock around the updating of this global piece of data. Make use of cmpxchg() to avoid two entities racing with their updates. Signed-off-by: Jan Beulich --- TBD: Initially I used cmpxchgptr() here, until realizing Arm doesn't have it. It's slightly more type-safe than cmpxc