Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-user: constrain execution on a single core
QEMU doesn't behave well when a multi-threaded binary is emulated and the various threads are scheduled on different cores by Linux. The problem manifests as a deadlock with the all the threads blocking on futex(). This commit uses a workaround which is to select a random core at the beginning of the initial thread and set the CPU affinity to it. Since the vast majority of binaries don't change the CPU affinity themselves and on Linux the affinity is inherited by child threads, this persists across all threads of a multi-threaded application. Signed-off-by: Petros Angelatos <[email protected]>
- Loading branch information