On 2 February 2015 at 08:31, Frederic Konrad <fred.kon...@greensocs.com> wrote: >> * This is making no attempt to learn from or unify with >> the existing attempts at handling exclusives in linux-user. >> When we've done this work we should have a single >> mechanism for handling exclusives in a multithreaded >> host environment which is used by both softmmu and useronly >> configs > > Can you point me to the existing attempts in linux-user?
It's in two parts -- the #ifdefed code in target-arm/translate.c (gen_store_exclusive), and the main loop in linux-user/main.c which handles EXCP_STREX to call do_strex(). There's a pair of utility routines start_exclusive() and end_exclusive() which suspend all other CPUs (which in linux-user are separate threads) so the strex code can run, and then resume them all afterwards. Since "handle strex between multiple threads" is exactly what you're trying to do, when we're done we should have a single mechanism for both softmmu and linux-user. Whether that means "replace linux-user's current code with better mechanism" or not I don't currently know. -- PMM