Linuxulator: Unbreak Mozilla, Firefox and RealPlayer

Intron is my alias on the Internet mag at intron.ac
Sat Aug 26 10:32:43 UTC 2006


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



More information about the freebsd-current mailing list