Re: Linuxulator: Unbreak Mozilla, Firefox and RealPlayer

From: Intron is my alias on the Internet <mag_at_intron.ac>
Date: Sat, 26 Aug 2006 18:06:47 +0800
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_at_freebsd.org mailing list
>> >http://lists.freebsd.org/mailman/listinfo/freebsd-current
>> >To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_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
Received on Sat Aug 26 2006 - 08:32:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:59 UTC