by pdimitar · 7y ago · 0 comments
Not a hardware guy or a driver programmer but I believe this area stands to get some innovation.
Speculation and branch prediction is not going away. On the contrary is going to get more and more sophisticated.
What needs to die is the belief that you can rely on just software (i.e. memory safety) for isolation between trusted and untrusted code[1].
[1] Yes, meltdown bypasses hardware protection, but that's an intel specific fuck up, not inherent issue with speculation.
I don't understand how you came to this conclusion. How does spectre indicate that you can't rely on software for isolation?
> meltdown bypasses hardware protection, but that's Intel specific
It's not Intel specific. Certain ARM and POWER architectures are also vulnerable.
Spectre bypasses hardware protections too, just in a more subtle way.
Given if f(A) B else C, one cannot safely assume that B only gets executed when A resolves to true. It is not reasonable to expect programmers to produce safe code in an environment where they have to doubt if statements.
This could be solved without any major overhauls in hardware, by just updating it to make speculative execution actually speculative and not commit any side effects until it knows it went down the correct branch.
This comment:
> What needs to die is the belief that you can rely on just software (i.e. memory safety) for isolation between trusted and untrusted code
is an argument that doubting if statements should be acceptable, and that the assumption that only B has architecturally visible side effects when A is true is not sound. I disagree strongly with that.
You should be able to rely on software checks for some things. Going forward, the solution is not to rewrite software to not depend on software mechanisms (e.g. bounds checks) for protection (unclear what would be used instead...) but to fix the hardware so these software mechanisms work.
What needs to "die" is not "belief that you can rely on just software," but hardware that violates fundamental guarantees.
It sounds like we agree on this, I just wanted to make my point clear since I see now that my original comment was not clear.
FWIW, this is essentially the argument Torvalds made when Intel tried to add feature flags for non-broken speculation.
Even otherwise strictly in order designs, when aiming for high performance incorporate some form of memory speculation (scout threading, run ahead execution).
There are also chips like the GA144, which has 144 cores:
https://www.rs-online.com/designspark/hands-on-with-a-144-co...
That is definitely true. We need a bit more security in the hardware. I am not saying we should go back to 300MHz CPUs just for the sake of security but surely there's a spectrum where Spectre / Meltdown / Rowhammer attacks are impossible and we still have very fast processors and RAM.
Note that 2+ decade old 200mhz pentium pro is very likely as vulnerable to spectre as the current generation. Frequency doesn't really factor in it.
For that, see https://en.m.wikipedia.org/wiki/Gustafson%27s_law.
Exactly this, yes. But for that we need a language that enforces and guarantees pure functions and disallows global state mutation. For now C is king in systems programming but I wonder if certain chips are made with a very different idea from the get go, then can we have a systems functional language?
I also am not very informed on this front, never had enough time to dig deeper. (I did like the idea of the LISP machines several decades ago though.)