4 ms·
These performance regressions are getting a bit depressing. Is there some other way we could architect chips or operating systems that would allow these branch
by hinkley 9y ago
These performance regressions are getting a bit depressing.
Is there some other way we could architect chips or operating systems that would allow these branch predictors to go full bore instead of having to hamstring them? When this story first broke I know we talked a bit about the impetus to move code out of the kernel into user land.
- goalieca 9y agoWe could have shorter pipelines ;)
- Filligree 9y agoWhich would hamstring performance.
- goalieca 9y agoyeah. it was a half-joke + half-serious. Would be interesting to see the performance of branch predictor fix vs just having a short pipe.
- titzer 9y agoShorter pipelines don't fundamentally change anything about speculative vulnerabilities. Longer pipelines allow faster clock rates, but that is not the problem here. Speculative vulnerabilities are because branch prediction is needed to get the CPU looking far enough in the future to feed all the functional units so that it can execute not just one instruction per clock, but 4 (actually u-ops, but you get the picture). To do that, you need to know the execution path far into the future. That is not really related to the pipeline depth at all.
- goalieca 9y agoWell yeah, but the implied point is that there must be some depth and workload where having a branch predictor fast or slow makes much less difference.
- trebligdivad 9y agoWell, 'lots of simple cores' is potentially one answer - but it does require you to have the type of workload that can work well heavily threaded. Similarly, CPUs that are heavily threaded rather than speculative, i.e. they don't mind stalling because they have lots of other threads they can switch to.
- blattimwind 9y agoSwitching (or indexing) predictor state on task and privilege level.
- titzer 9y agoThat is not granular enough, since language runtimes have assumed up until Spectre that enforcing security with safety checks inserted into compiled code was enough. With these side channels it is not.
- yaantc 9y agoIt's even more complex. It's not only the predictor state that would need switching/indexing, it's the result of any prediction. A speculative load in cache is global today, and that leads to a possible side channel attack. One may think about marking a speculatively cached entry by its security context, the only context allowed to "see" it until the speculation is resolved. But that is not enough: the entry may have evicted another, and that's globally visible. Or one may not use the regular caches, but add another lookup structure (CAM) for in-fly speculative loads (and same for store), indexed by context. Another source of complexity is: what is a security context? An OS could use existing structures like processes, and it makes sense, but it's not enough. For a sandboxed application a given process or thread could run untrusted sandboxed code (Javascript) and also trusted runtime. In this case, the application need to help and manage security contexts. It's possible, but not backward compatible. I expect progress will be made, but considering the complexity/costs it may take some time...
- titzer 9y ago> It's even more complex. Oh, this one goes elbows, armpits, neck, ten thousand fathoms deep. Now just imagine that every memory access that the processor does actually consumes another type of resource, which is memory bandwidth. There are a limited number of cache-fill lines and those can be occupied or not; after tracking down all of the state of things at rest, you now have to think about the information leakage from the occupancy of the various networks of the CPU--data in flight. Tougher to analyze, but also tougher to secure. It's gonna be separate CPUs, memory busses, and disks if we really want to get rid of side-channels. And that's actually simple. Simple is better for security!