Re: [Xen-devel] [PATCH] use consistent values when consuming runtime-changeable parameters

2018-10-30 Thread George Dunlap
On 10/30/2018 02:44 PM, Jan Beulich wrote: > There's no guarantee that e.g. a switch() control expression's memory > operand(s) get(s) read just once. Guard against the compiler producing > "unexpected" code by sprinkling around some ACCESS_ONCE(). > > I'm leaving alone opt_conswitch[]: It gets

Re: [Xen-devel] [PATCH] use consistent values when consuming runtime-changeable parameters

2018-10-30 Thread Wei Liu
On Tue, Oct 30, 2018 at 10:28:21AM -0600, Jan Beulich wrote: > >>> On 30.10.18 at 17:23, wrote: > > On Tue, Oct 30, 2018 at 08:44:20AM -0600, Jan Beulich wrote: > >> There's no guarantee that e.g. a switch() control expression's memory > >> operand(s) get(s) read just once. Guard against the

Re: [Xen-devel] [PATCH] use consistent values when consuming runtime-changeable parameters

2018-10-30 Thread Jan Beulich
>>> On 30.10.18 at 17:23, wrote: > On Tue, Oct 30, 2018 at 08:44:20AM -0600, Jan Beulich wrote: >> There's no guarantee that e.g. a switch() control expression's memory >> operand(s) get(s) read just once. Guard against the compiler producing >> "unexpected" code by sprinkling around some

Re: [Xen-devel] [PATCH] use consistent values when consuming runtime-changeable parameters

2018-10-30 Thread Wei Liu
On Tue, Oct 30, 2018 at 08:44:20AM -0600, Jan Beulich wrote: > There's no guarantee that e.g. a switch() control expression's memory > operand(s) get(s) read just once. Guard against the compiler producing > "unexpected" code by sprinkling around some ACCESS_ONCE(). > > I'm leaving alone

Re: [Xen-devel] [PATCH] use consistent values when consuming runtime-changeable parameters

2018-10-30 Thread Andrew Cooper
On 30/10/18 14:44, Jan Beulich wrote: > There's no guarantee that e.g. a switch() control expression's memory > operand(s) get(s) read just once. Guard against the compiler producing > "unexpected" code by sprinkling around some ACCESS_ONCE(). > > I'm leaving alone opt_conswitch[]: It gets

[Xen-devel] [PATCH] use consistent values when consuming runtime-changeable parameters

2018-10-30 Thread Jan Beulich
There's no guarantee that e.g. a switch() control expression's memory operand(s) get(s) read just once. Guard against the compiler producing "unexpected" code by sprinkling around some ACCESS_ONCE(). I'm leaving alone opt_conswitch[]: It gets accessed in quite a few places anyway, and an