LDT entries and WINE and Threads..

From: Julian Elischer <julian_at_FreeBSD.org>
Date: Tue, 8 Jul 2003 14:06:51 -0700 (PDT)
I'm looking at this and I think that my interpretation is that 
WINE, under FreeBSD, blindly allocates LDT entries starting at location 17,
without looking to see if they are in use already..

My reason for thinking thios is that the string i386_get_ldt
only occurs once in the WINE source, and that is a prototype declaration
in ./work/wine-20030508/libs/wine/ldt.c (in the port)
In other words, it is not checking first..

This makes it "incompatible" with threads (both libthr and libkse)
and while this isn't an immediate problem, it WILL be a problem because
WINE uses OpenGL and OpenGL used threads (currently linuxthreads)
so it will eventually be a problem..

It seems to me that we could better serve the applications by 
having a differnt API for setting LDTs, and that the kernel
should keep track of which is free and which is not.
I would say that the API should be something like:

int selector = i386_make_ldte(type, base, limit, flags);
 
where "selector" is what you later stuff into a segment register.
there would be an equivalent
void i386_free_ldte(selector)

i386_get_ldt() could stay as it is I think..


The 'guts' of i386_make_ldte would be used directly by 
kse_create() and set the value of %gs that the upcall returns with.


comments?
Received on Tue Jul 08 2003 - 12:06:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:14 UTC