qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ulrich Hecht <uli@suse.de>
To: Nathan Froyd <froydnj@codesourcery.com>
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 12:10:31 +0200	[thread overview]
Message-ID: <200908211210.31928.uli@suse.de> (raw)
In-Reply-To: <20090820164304.GP29075@codesourcery.com>

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.

CU
Uli

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

  reply	other threads:[~2009-08-21 10:10 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 [this message]
2009-08-21 13:11     ` Nathan Froyd

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=200908211210.31928.uli@suse.de \
    --to=uli@suse.de \
    --cc=froydnj@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).