Re: [PATCH 06/10] device-core: use atomic_set on .realized property

2020-09-30 Thread Maxim Levitsky
On Wed, 2020-09-30 at 19:44 +0200, Paolo Bonzini wrote: > On 30/09/20 16:31, Maxim Levitsky wrote: > > > + > > > +qatomic_set(&dev->realized, value); > > > +/* > > > + * Ensure that concurrent users see this update prior to > > > + * any other changes done by unreali

Re: [PATCH 06/10] device-core: use atomic_set on .realized property

2020-09-30 Thread Paolo Bonzini
On 30/09/20 16:31, Maxim Levitsky wrote: >> + >> +qatomic_set(&dev->realized, value); >> +/* >> + * Ensure that concurrent users see this update prior to >> + * any other changes done by unrealize. >> + */ >> +smp_wmb(); > > I''l probably never fully

Re: [PATCH 06/10] device-core: use atomic_set on .realized property

2020-09-30 Thread Maxim Levitsky
On Fri, 2020-09-25 at 13:26 -0400, Paolo Bonzini wrote: > From: Maxim Levitsky > > Some code might race with placement of new devices on a bus. > We currently first place a (unrealized) device on the bus > and then realize it. > > As a workaround, users that scan the child device list, can > che

[PATCH 06/10] device-core: use atomic_set on .realized property

2020-09-25 Thread Paolo Bonzini
From: Maxim Levitsky Some code might race with placement of new devices on a bus. We currently first place a (unrealized) device on the bus and then realize it. As a workaround, users that scan the child device list, can check the realized property to see if it is safe to access such a device. U