Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-25 Thread Stefano Stabellini
On Thu, 25 Feb 2021, Julien Grall wrote: > On 23/02/2021 13:24, Ash Wilding wrote: > > Hi Julien, > > Hi Ash, > > > Thanks for looking at this, > > > > > vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the > > > CPU to read any information about local events before the flag > >

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-25 Thread Julien Grall
On 23/02/2021 13:24, Ash Wilding wrote: Hi Julien, Hi Ash, Thanks for looking at this, vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the CPU to read any information about local events before the flag _VPF_blocked is set. Reviewed-by: Ash Wilding Thanks! As an asi

RE: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-23 Thread Ash Wilding
Hi Julien, Thanks for looking at this, > vcpu_block() is now gaining an smp_mb__after_atomic() to prevent the > CPU to read any information about local events before the flag > _VPF_blocked is set. Reviewed-by: Ash Wilding As an aside, > I couldn't convince myself whether the Arm implementat

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-23 Thread Julien Grall
Hi, On 23/02/2021 07:00, Jan Beulich wrote: On 22.02.2021 21:12, Julien Grall wrote: On 22/02/2021 20:09, Stefano Stabellini wrote: On Mon, 22 Feb 2021, Jan Beulich wrote: On 20.02.2021 20:47, Julien Grall wrote: This is a follow-up of the discussion that started in 2019 (see [1]) regarding

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-23 Thread Dario Faggioli
On Mon, 2021-02-22 at 12:09 -0800, Stefano Stabellini wrote: > On Mon, 22 Feb 2021, Jan Beulich wrote: > > On 20.02.2021 20:47, Julien Grall wrote: > > > > > > vcpu_block() is now gaining an smp_mb__after_atomic() to prevent > > > the CPU > > > to read any information about local events before the

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-22 Thread Jan Beulich
On 22.02.2021 21:12, Julien Grall wrote: > On 22/02/2021 20:09, Stefano Stabellini wrote: >> On Mon, 22 Feb 2021, Jan Beulich wrote: >>> On 20.02.2021 20:47, Julien Grall wrote: This is a follow-up of the discussion that started in 2019 (see [1]) regarding a possible race between do_poll(

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-22 Thread Stefano Stabellini
On Mon, 22 Feb 2021, Julien Grall wrote: > On 22/02/2021 20:09, Stefano Stabellini wrote: > > On Mon, 22 Feb 2021, Jan Beulich wrote: > > > On 20.02.2021 20:47, Julien Grall wrote: > > > > From: Julien Grall > > > > > > > > The comment in vcpu_block() states that the events should be checked > >

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-22 Thread Julien Grall
On 22/02/2021 20:09, Stefano Stabellini wrote: On Mon, 22 Feb 2021, Jan Beulich wrote: On 20.02.2021 20:47, Julien Grall wrote: From: Julien Grall The comment in vcpu_block() states that the events should be checked /after/ blocking to avoids wakeup waiting race. However, from a generic pe

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-22 Thread Stefano Stabellini
On Mon, 22 Feb 2021, Jan Beulich wrote: > On 20.02.2021 20:47, Julien Grall wrote: > > From: Julien Grall > > > > The comment in vcpu_block() states that the events should be checked > > /after/ blocking to avoids wakeup waiting race. However, from a generic > > perspective, set_bit() doesn't pre

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-22 Thread Jan Beulich
On 20.02.2021 20:47, Julien Grall wrote: > From: Julien Grall > > The comment in vcpu_block() states that the events should be checked > /after/ blocking to avoids wakeup waiting race. However, from a generic > perspective, set_bit() doesn't prevent re-ordering. So the following > could happen: >

Re: [PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()

2021-02-22 Thread Ian Jackson
Julien Grall writes ("[PATCH for-4.15] xen/sched: Add missing memory barrier in vcpu_block()"): > From: Julien Grall > > The comment in vcpu_block() states that the events should be checked > /after/ blocking to avoids wakeup waiting race. However, from a generic > perspective, set_bit() doesn't