From: Nathan Froyd <froydnj@codesourcery.com>
To: Ulrich Hecht <uli@suse.de>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] i386-linux-user NPTL support
Date: Fri, 21 Aug 2009 06:11:16 -0700 [thread overview]
Message-ID: <20090821131116.GR29075@codesourcery.com> (raw)
In-Reply-To: <200908211210.31928.uli@suse.de>
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
prev parent reply other threads:[~2009-08-21 13:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 16:19 [Qemu-devel] [PATCH] i386-linux-user NPTL support Ulrich Hecht
2009-08-20 16:43 ` Nathan Froyd
2009-08-21 10:10 ` Ulrich Hecht
2009-08-21 13:11 ` Nathan Froyd [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090821131116.GR29075@codesourcery.com \
--to=froydnj@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=uli@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).