On 09/08/2016 01:39 AM, Alex Bennée wrote: > > Richard Henderson <r...@twiddle.net> writes: > >> This is really just a placeholder for an actual >> command-line switch for mttcg. >> --- >> translate-all.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/translate-all.c b/translate-all.c >> index 99ae7f9..a10fa06 100644 >> --- a/translate-all.c >> +++ b/translate-all.c >> @@ -119,7 +119,7 @@ static void *l1_map[V_L1_SIZE]; >> >> /* code generation context */ >> TCGContext tcg_ctx; >> -bool parallel_cpus; >> +bool parallel_cpus = 1; > > I appreciate this is currently a hack but for CONFIG_USER it should > always be true anyway.
One could delay setting parallel_cpus until one of a number of syscalls occur: (1) clone, with CLONE_VM (2) mmap, with MAP_SHARED (3) shmat which would allow single-threaded programs to run without the atomic overhead. r~