# Linux Kernel Module Cheat

### 37.5. Hardware threads

Intel name: "Hyperthreading"

- https://superuser.com/questions/133082/what-is-the-difference-between-hyper-threading-and-multiple-cores/995858#995858

- https://stackoverflow.com/questions/5593328/software-threads-vs-hardware-threads/61415402#61415402

- https://superuser.com/questions/122536/what-is-hyper-threading-and-how-does-it-work

gem5 appears to possibly have attempted to implement hardware threads in gem5 syscall emulation mode as mentioned at gem5 syscall emulation --smt.

On fs.py it is not exposed in any in-tree config however, and as pointed by the above issue O3 FS has an assert that prevents it in src/cpu/o3/cpu.cc:

                // SMT is not supported in FS mode yet.
                assert(this->numThreads == 1);

TODO why only in fs.py? Is there much difference between fs and se from a hyperthreading point of view? Maybe the message is there because as concluded in gem5 `O3ThreadContext`, registeres for `DerivO3CPU` are stored in `DerivO3CPU` itself (`FullO3CPU`), and therefore there is no way to to currently represent multiple register sets per CPU.

Other CPUs just appear to fail non-gracefully, e.g.:

    ./run --arch aarch64 --emulator gem5 -- --param 'system.cpu[0].numThreads = 2'

fails with:

    fatal: fatal condition interrupts.size() != numThreads occurred: CPU system.cpu has 1 interrupt controllers, but is expecting one per thread (2)