[Top][All Lists]

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

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

From: Ulrich Hecht
Subject: Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support
Date: Fri, 21 Aug 2009 12:10:31 +0200
User-agent: KMail/1.9.10

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
> Less duplicated code and fewer #ifdefs that way and it's still clear
> that x86-64 linux-user emulation doesn't support NPTL.

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. 
(Except maybe x86-64, but I don't know how TLS is implemented there.) My 
solution may not look as clean, but it sidesteps all this, which I 
thought made it worthwhile to special-case i386 in syscall.c.


SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N├╝rnberg)

reply via email to

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