Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown
by astrange on Saturday January 06, 2018 @12:03AM
(#16083941)
It would be hard to model data-dependent timing of an actual CPU. Integer division is variable time on lots of architectures, but on ARM even multiplication timing is data-dependent! And on desktops you could cause a even mov instruction to stall a few cycles if you can run something before it that uses all the renamed registers - there might be a way to turn this into data dependence and observe it from the perf counters…
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown
by fyi1183 on Saturday January 06, 2018 @03:03AM
(#16084345)
You don't need to model the timing though.
What I'm saying with the type system comment is this: the cache side effects of speculation are desirable most of the time but not always. We should find a way to model data sensitivity in the type system so that a compiler can automatically choose to generate a side-effect-free code sequence where the side effects must be avoided (this assumes a future with ISA extensions that allow telling the CPU to prevent such side effects by blocking the speculative execution).
Perhaps this will finally provide enough incentives to model data sensitivity in the type systems of practical programming languages.