lkml.org 
[lkml]   [1998]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: patch for x86 treatment of fs and gs in signal handlers
In article <19980825173855.A1242@dot.cygnus.com> you write:
>Currently the code that sets up the context in which a signal handler
>runs resets both %fs and %gs to __USER_DS. I argue that this is less
>than desirable, if not incorrect.

...

>In contrast, for x86 we have these two, currently unused, segment regs
>being clobbered for no particular reason I can divine.

They are not clobbered, they are saved in the struct sigcontext passed
to the signal handler.

>This comes up because it interferes with a potential use of %gs we have
>in mind for linuxthreads. That is, %gs is set up at the birth of the
>thread to point to the thread-local data structures, and is thereafter
>left alone.

It is not impossible to use the registers anyway.

WINE has the same problem, since it uses %fs just like Win32 for thread
local storage.

WINE however restores the %fs in signalhandlers from the passed struct
sigcontext which works (including additional checks for signals from 16bit
code) rather good.

Ciao, Marcus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.111 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site