This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: Additional registers used by NTPL on x64 Linux
- From: "Wei Shen" <cquark at gmail dot com>
- To: libc-ports at sources dot redhat dot com
- Date: Fri, 25 May 2007 23:02:40 +0800
- Subject: Re: Additional registers used by NTPL on x64 Linux
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EEGSt+dBHcklE57Z89K6WWvx/Y9quEp7iby2w2lmftJLVlRuqG/rUSpFKaOMpF1i9JjwLhbb5rWBQUilJgb7lJhSXhRLUW7MZYZ4upLiTjwNA82yex3eH44iDHYbM9MAJjubdILIxZZw27zWX1HvZnSbS51sHTA4kRyq0+lpcKg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m1zamZm5HwjNJb87SpFma6XM5y3xfk3RtOwm6x09UEWBp+twZCNja+JKerJ6M36JIwG86x9krL/m0vZ25YwPmosou4QKDec2Dbro5s9xJ98fRYJcuobwgH5uEHwFp4Dd6wbaPXypwFm3K9Zxi7+AUGkUQLg6BoSqXJra3O0i5NI=
- References: <e12e59640705250228u4ef7ab81x131d48ba9798f34d@mail.gmail.com>
Hi,
On 5/25/07, Wei Shen <cquark@gmail.com> wrote:
I know that %gs is used by NTPL to locate thread local data on x86. So, how about the situation on x86-64?
I find some one said that:
"%fs points to the TLS area. If the value fits in 32 bits, it does the same as with %gs in 32bit mode . If the value does not fit in 32 bits, the full FS_BASE MSR is written, and %fs is set to 0"
I get it. The code I read is from the Linux 2.4.20 kernel, in wich
FS_BASE MSR is always used.
However, I still have some questions:
(1) When FS_BASE_MSR is used, will %fs and %gs still be changed by
Glibc? If so, when the changing occurs, at thread intitiation, program
startup, new execution, or possibly every system call?
I use glibc-2.3.2-95 and kernel 2.4.21.
(2) Since FS_BASE_MSR is got/set via sys_arch_prctl, can I modify the
the system call and find another location to save its value (without
affecting the NTPL)?
(3) What is value range of %gs of a 32-bit and a 64-bit thread
respectively? Can it be set to 451 (0x1c3)?
Thanks,
Wei Shen