On Tue, Jan 23, 2018 at 10:45 AM, Alan Cox <gno...@lxorguk.ukuu.org.uk> wrote: > > static int in_order_cpu(void) > { > /* Processors with CPU id etc */ > if (x86_match_cpu(cpu_in_order)) > return 1; > /* Other rules here */ > return 0; > }
Note that "in-order" does *not* necessarily mean "no speculation". You still do branch prediction, you still have a BTB for all but the simplest in-order things, and you may still end up running instructions at least part-way through a pipeline. Whether it gets to a cache replacement or not is unclear. So that naming is very misleading. It is quite possible (even likely) that the old in-order Atoms do not have this issue, because it's definitely true that in-order tends to limit speculation a lot, and any mis-predict will _probably_ kill instructions early enough that you'd never see this. But meltdown, for example, is based entirely on uarch details in the memory pipeline, not on in-order vs ooo. Again, an in-order CPU is probably less aggressive in the memory pipeline too, so there is probably strong correlation, but there is no causal relationship. Linus