it's becoming depressingly clear that speculative execution is an inherently insecure - and unsecurable - feature. it speeds single threaded systems up massively, and obliterates any hope of keeping processes safe from each other in multiprogrammed environments.
"but we can't go back to the days when computers ran in lockstep with memory! how slow would things be if we did that?!" - well, all the mitigations for speculative execution are going to slow things down to that point anyway. and hey, now that CPU speed has hit a wall even with all our architectural hacks, maybe now the semiconductor companies can go and spend the money where it really matters - on RAM that can keep up with modern processors, rather than on ensuring processors only rarely have to slow down for RAM
@millihertz I’ve kind of come to that conclusion too. And relatedly, that there are probably a lot of vulnerabilities we’re not seeing because computer security researchers are rarely electrical engineers.
has anyone measured the relative power consumption of a system which executes a simple VM's code in a relatively straightforward way (and therefore ends up with lots of pipeline stalls, etc) and one which uses a JIT to compile the same code into machine code the second time it's executed, and then run that?
the best i can find from a quick google is a 2006 paper by Shiwen Hu and Lizy K John, which measures the energy impact of JIT optimisation and garbage collection. their most interesting result is that garbage collection reduces power consumption! so does JIT optimisation, which i assume is not entirely accidental; but interestingly they find that the optimisation stage itself also reduces power (presumably over executing unoptimised JITted code), rather than spending to recoup as one might assume
has anyone measured the relative power consumption of a system which executes a simple VM's code in a relatively straightforward way (and therefore ends up with lots of pipeline stalls, etc) and one which uses a JIT to compile the same code into machine code the second time it's executed, and then run that?
@millihertz maybe there's something about the Inferno OS, which has its own virtual machine called Dis. It can run in JIT mode, pure interpreted mode, as well as native on hardware. You might be lucky since it's always the exact same code that runs, and the same byte code that's interpreted/compiled.
"but we can't go back to the days when computers ran in lockstep with memory! how slow would things be if we did that?!" - well, all the mitigations for speculative execution are going to slow things down to that point anyway. and hey, now that CPU speed has hit a wall even with all our architectural hacks, maybe now the semiconductor companies can go and spend the money where it really matters - on RAM that can keep up with modern processors, rather than on ensuring processors only rarely have to slow down for RAM
@millihertz I’ve kind of come to that conclusion too. And relatedly, that there are probably a lot of vulnerabilities we’re not seeing because computer security researchers are rarely electrical engineers.