My, should have re-read...

Samuel Thibault, le jeu. 02 mars 2023 09:00:40 +0100, a ecrit:
> I'm not saying it's not a serializing instruction.
> 
> I'm saying that the compiler does not have to *care* about the
> instruction being serializing.
> 
> But I'm also saying that the very reason why the instruction is
> serialized is also the reason why which should give a memory clobber to

                                    *we

> the compiler.
> 
> > The Intel 64 and IA-32 architectures define several serializing
> > instructions. These instructions force the processor to complete all
> > modifications to flags, registers, and memory by previous instructions and
> > to drain all buffered writes to memory before the next instruction is
> > fetched and executed.
> 
> Yes, and that is *completely* fine with the compiler not flushing
> variables etc. to buffers before that.

              *from register to memory.

> But the very reason why all these flushes are done is that wrmsr can
> have side effect which *requires* that to be done (e.g. structure
> preparation and whatnot), and thus we should *also* tell the compiler to
> do the same.

Reply via email to