[brandz-discuss] MSR_AMD_FSBASE in Solaris (is it pointing to 8G for ever?)

Edward Pilatowicz edward.pilatowicz at sun.com
Fri Jun 1 16:21:35 PDT 2007


On Tue, May 29, 2007 at 12:05:35AM +0800, Wei Shen wrote:
> Hi all,
>
> Added the *syscall* hook today. As a temporary solution, %gs is used to tell
> the lx callback whether a *syscall* is from native or lx code. It works for
> my simple test program, however, I think I need to check its reliability and
> will consult you on this issue later. In fact, I may need quite a few time
> to review all the modifications made.
>
> Another issue is about the MSR_AMD_FSBASE register. I must make certain
> always set to 0x200000000 (i.e. points at 8G) in Solaris? Since NPTL uses it
> to access to thread local data, it needs to be saved/restored at the
> native/lx code switching.
>

i'm not sure about this bit.  i'm not really familiar with how the
MSR_AMD_FSBASE register is used in solaris.  i'd recommend looking at
the comment in lwp_load() that talks about how libc uses fsbase.  looking
at that comment seems to indicate that on 64-bit systems fsbase is used
for TLS.

ed



More information about the brandz-discuss mailing list