4 ms·
What exactly is the connection between hyperthreading and safety?
by tomerv 5y ago
What exactly is the connection between hyperthreading and safety?
- bayindirh 5y agoHT enables some side-channel attacks due to its architecture of "let's allow two threads to share the same pipeline and use the unused parts to allow more work to go through". In practice this allows some attacks to attach themselves to the same pipeline with the target process and nibble required information slowly, but surely. IIRC FreeBSD disabled HT out of the box at the kernel level for this reason. I'm tired and it's late here. I may worded some stuff wrong or plainly misremembered it. Please feel free to correct.
- IntelMiner 5y agoOpenBSD did, not FreeBSD
- vermaden 5y agoFreeBSD did not disabled it by default but you can disable it with this: % sysctl -d machdep.hyperthreading_allowed machdep.hyperthreading_allowed: Use Intel HTT logical CPUs
- mhh__ 5y agoModern CPUs have a very large bag of tricks to make the code they execute run fast. These tricks are usually designed for some optimal workload, and (especially x86) the real deal can't actually keep the backend busy. Solution: Duplicate some of the CPU to feed the backend with more stuff to do. This can get you a performance win without the cost of a whole core. All good so far, for (say) HPC where you have people with guns guarding the machines you can turn on all the performance. The issue is that as CPUs have got more complicated, it's increasingly easy to attack the internal state of the processor. This is already possible in a single thread (i.e. the prototypical spectre and meltdown implementations), however imagine what you can do next door to a completely different "core". The processor maintains separation of structure but not of state, so you can use (say) timing side channels to extract information about what your neighbour is up to. FWIW these issues are more of a problem for Cloud vendors than you or I as they usually require pretty specific knowledge of the hardware being attacked and even then are not easy to pull off.
- physicsguy 5y agoPretty much nobody in the HPC sphere really uses hyperthreading, it's disabled in the BIOS on pretty much every HPC cluster I've ever used.
- reacharavindh 5y agoI don’t know why this insane rule of thumb still exists in the HPC world. True that some compute bound jobs that are not designed to make use of HT will be hurt by running in an HT environment. But, not all of HPC work is such purely compute bound. For a scientific field, it is ironic that someone perpetrates this blind rule. Do an A/B test with and without HT for your workload in hand and decide based on results….. As an example, in our test suite, we found that we get almost a 80% boost by turning on HT. The right rule is “HT may help or hurt your performance depending on workload. Test and decide”.
- the-dude 5y agoWhy is this a A/B test and not a regular test?
- physicsguy 5y agoWell, it's not such a bad idea for most cluster admins (me being one at a large UK University). Most of our compute time comes from a small number of very popular MPI parallelised applications, all of which suffer from worse (or at best equivalent) performance with hyperthreading.
- mhh__ 5y agoPoint is you can use it without worrying about security.