On Mon, Sep 10, 2018 at 10:17:53 +0100, Alex Bennée wrote: > > Emilio G. Cota <c...@braap.org> writes: > > > Needed for MTTCG. > > > > Signed-off-by: Emilio G. Cota <c...@braap.org> > > --- > > target/i386/translate.c | 24 ++++++++++++++++-------- > > 1 file changed, 16 insertions(+), 8 deletions(-) > > > > diff --git a/target/i386/translate.c b/target/i386/translate.c > > index 1f9d1d9b24..9a6a72e205 100644 > > --- a/target/i386/translate.c > > +++ b/target/i386/translate.c > > @@ -71,26 +71,34 @@ > > > > //#define MACRO_TEST 1 > > > > +/* we need thread-local storage for mttcg */ > > +#ifdef CONFIG_USER_ONLY > > +#define I386_THREAD > > +#else > > +#define I386_THREAD __thread > > +#endif > > + > > I'm confused - as we can have multi-threaded user space don't the same > requirements apply?
In user-mode, code generation is serialized by mmap_lock. Making these per-thread would just waste TLS space. E.