Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Aug 2006 18:06:47 +0800
From:      "Intron is my alias on the Internet" <mag@intron.ac>
To:        freebsd-emulation@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: Linuxulator: Unbreak Mozilla, Firefox and RealPlayer
Message-ID:  <courier.44F01D37.0000E216@intron.ac>
In-Reply-To: <20060826072759.GB55105@stud.fit.vutbr.cz>
References:  <courier.44EE6A8A.00008655@intron.ac> <20060825084755.GA93151@stud.fit.vutbr.cz> <200608251028.55915.jhb@freebsd.org> <courier.44EFACD6.0000C97F@intron.ac> <20060826072759.GB55105@stud.fit.vutbr.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Divacky Roman wrote:

> On Sat, Aug 26, 2006 at 10:07:17AM +0800, Intron is my alias on the Internet wrote:
>> John Baldwin wrote:
>> 
>> >On Friday 25 August 2006 04:47, Divacky Roman wrote:
>> >
>> >Umm, if you want to reparent a proc you should use the proc_reparent()
>> >function instead of just hacking on p_pptr.  You also need to hold
>> >the proctree_lock when modifying p_pptr anyway.
>> >
>> >-- 
>> >John Baldwin
>> >_______________________________________________
>> >freebsd-current@freebsd.org mailing list
>> >http://lists.freebsd.org/mailman/listinfo/freebsd-current
>> >To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
>> 
>> Thank you for your reminder. I have updated my patch:
>> 
>> http://ftp.intron.ac/tmp/linux_machdep.c.1.53-2.diff
> 
> pls can you explain me this change: 
> -               /* this is taken from i386 version of cpu_set_user_tls() */
> -               critical_enter();
> -               /* set %gs */
> +               /* Set %gs of child */
>                 td2->td_pcb->pcb_gsd = sd;
> -               PCPU_GET(fsgs_gdt)[1] = sd;
> -               load_gs(GSEL(GUGS_SEL, SEL_UPL));
> -               critical_exit();
> +               td2->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);
> 
> 
> thnx!
> 
> roman
> 

The new descriptor of new TLS should be handed to new thread, and it
shouldn't override current thread's TLS descriptor.

When you commit the patch, please remove the line:

td2->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);

This kernel directive ensures %gs pointing to TLS in new thread. But
in fact, genuine Linux kernel doesn't meddle register value of userland
thread/process. Let userland GNU LIBC be.

------------------------------------------------------------------------
                                                From Beijing, China




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?courier.44F01D37.0000E216>