On 18/03/2016 17:18, Alex Bennée wrote: > -#endif > - > - /* if no translated code available, then translate it now */ > - cpu->tb_invalidated_flag = 0;
Moving this reset from here... > - if (cpu->tb_invalidated_flag) { > + if (atomic_read(&cpu->tb_invalidated_flag)) { > /* as some TB could have been invalidated because > of a tb_flush while generating the code, we > must recompute the hash index here */ > next_tb = 0; > + > + /* Clear the flag, we've now observed the flush. */ > + tb_lock_recursive(); > + cpu->tb_invalidated_flag = 0; > } ... to here probably can be anticipated to Sergey's (my? :D) "make tb_invalidated_flag per-CPU" patch. Then this patch can just add the tb_lock_recursive. Paolo