At 15:47 +0100 on 18 Aug (1503071247), Tim Deegan wrote: > At 01:48 -0600 on 17 Aug (1502934495), Jan Beulich wrote: > > >>> On 16.08.17 at 18:47, <andrew.coop...@citrix.com> wrote: > > > atomic_read() is not free to be reordered by the compiler. It is an asm > > > volatile with a volatile memory reference. > > > > Oh, right - I did forget about the volatiles there (since generally, > > like in Linux, we appear to try to avoid volatile). > > FWIW, I don't think that's quite right. The GCC docs I have say that > "volatile" will stop the compiler from omitting an asm altogether, or > hoisting it out of a loop (on the assumption that it will always > produce the same output for the same inputs). And that "the compiler > can move even volatile 'asm' instructions relative to other code, > including across jump instructions."
...and indeed: https://godbolt.org/g/KW19QR Tim. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel