qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support


From: Nathan Froyd
Subject: Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support
Date: Fri, 21 Aug 2009 06:11:16 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

On Fri, Aug 21, 2009 at 12:10:31PM +0200, Ulrich Hecht wrote:
> On Thursday 20 August 2009, Nathan Froyd wrote:
> > Why not just stick things in cpu_set_tls in target-i386/cpu.h like so:
> >
> > #if defined(TARGET-I386) && defined(TARGET_ABI32)
> > static inline void cpu_set_tls(CPUState *env, target_ulong newtls)
> > {
> >     do_set_thread_area(env, newtls);
> >     cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
> > }
> > #endif
> 
> do_set_thread_area() is declared static in syscall.c, so you would have 
> to unstaticize it, create a prototype somewhere (where?), and you would 
> introduce a dependency between the CPU emulation and the userspace 
> emulation. These problems are all unique to the i386 architecture which 
> doesn't get away with just setting a CPU register like all the others. 

Hm, that's a good point.  I imagine the problems are similar on x86-64.

My first thought was to simply move do_set_thread_area and cpu_set_tls
(the latter for all architectures, not just x86) to
linux-user/target-FOO/syscall.h.  But that won't work for ARM, since it
uses cpu_set_tls in linux-user/main.c.  Maybe creating a new file/header
for cpu-specific support code would be the right way to do things; you
might have to make cpu_set_tls out-of-line, but that's not particularly
bad.  (This would help with other things, like moving cpu_loop from
linux-user/main.c into architecture-specific files.)

But that's a little much to tackle for just x86 NPTL support, I
suppose. :)

-Nathan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]