From owner-freebsd-emulation@FreeBSD.ORG Sat Aug 26 10:32:43 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16B7216A4DA; Sat, 26 Aug 2006 10:32:43 +0000 (UTC) (envelope-from admin@intron.ac) Received: from intron.ac (unknown [210.51.165.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67642442D7; Sat, 26 Aug 2006 10:06:49 +0000 (GMT) (envelope-from admin@intron.ac) Received: from localhost (localhost [127.0.0.1]) (uid 1003) by intron.ac with local; Sat, 26 Aug 2006 18:06:47 +0800 id 0010880D.44F01D37.0000E216 References: <20060825084755.GA93151@stud.fit.vutbr.cz> <200608251028.55915.jhb@freebsd.org> <20060826072759.GB55105@stud.fit.vutbr.cz> In-Reply-To: <20060826072759.GB55105@stud.fit.vutbr.cz> From: "Intron is my alias on the Internet" To: freebsd-emulation@freebsd.org, freebsd-current@freebsd.org Date: Sat, 26 Aug 2006 18:06:47 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312"; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Cc: Subject: Re: Linuxulator: Unbreak Mozilla, Firefox and RealPlayer X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Aug 2006 10:32:43 -0000 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