At Sun, 5 Nov 2006 19:59:44 -0800 (PST), Roland McGrath wrote: > > > #v+ > > 2006-01-26 Jeroen Dekkers <[EMAIL PROTECTED]> > > > > * i386/i386/locore.S (trap_push_segs): Switch fs and gs to kernel > > data segment too. > > (syscall_entry_2): Likewise. > > * i386/i386/user_ldt.c (i386_set_ldt): Always copy the master LDT > > when there is no old user LDT. > > #v- > > > > So, I guess we want to keep this installed? We installed it that that > > time, because it prevented GNU Mach from crashing when using the `ld.so' > > of a tls enabled glibc. > > I never reviewed that. Someone explain it.
Thomas asked me on IRC if I could comment on this. This is what I remember and what I understand from reading my old mails and the code in question: The if statement is bogus. Threads share a default LDT. This is the master LDT and has the call gate for system calls and the CS and DS segment descriptors. When we add a segment register we have to make a new LDT specific to the thread. When doing this we need to copy the entries from master LDT into the thread's new LDT or else we won't have a segment descriptor for CS and DS and we won't have the call gate. The if check looks whether the thread of which we modify the LDT is the current thread and only copies the master LDT when that's the case. So if the thread isn't a current thread we will have an LDT without a CS/DS descriptor and call gate. A nice and not so easy to debug crash is the result when we switch to that thread later on. So we definitely want to keep this installed. Jeroen Dekkers _______________________________________________ Bug-hurd mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-hurd
