xref: /OK3568_Linux_fs/kernel/Documentation/ABI/stable/vdso (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunWhat:		vDSO
2*4882a593SmuzhiyunDate:		July 2011
3*4882a593SmuzhiyunKernelVersion:	3.0
4*4882a593SmuzhiyunContact:	Andy Lutomirski <luto@kernel.org>
5*4882a593SmuzhiyunDescription:
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunOn some architectures, when the kernel loads any userspace program it
8*4882a593Smuzhiyunmaps an ELF DSO into that program's address space.  This DSO is called
9*4882a593Smuzhiyunthe vDSO and it often contains useful and highly-optimized alternatives
10*4882a593Smuzhiyunto real syscalls.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThese functions are called just like ordinary C function according to
13*4882a593Smuzhiyunyour platform's ABI.  Call them from a sensible context.  (For example,
14*4882a593Smuzhiyunif you set CS on x86 to something strange, the vDSO functions are
15*4882a593Smuzhiyunwithin their rights to crash.)  In addition, if you pass a bad
16*4882a593Smuzhiyunpointer to a vDSO function, you might get SIGSEGV instead of -EFAULT.
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunTo find the DSO, parse the auxiliary vector passed to the program's
19*4882a593Smuzhiyunentry point.  The AT_SYSINFO_EHDR entry will point to the vDSO.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunThe vDSO uses symbol versioning; whenever you request a symbol from the
22*4882a593SmuzhiyunvDSO, specify the version you are expecting.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunPrograms that dynamically link to glibc will use the vDSO automatically.
25*4882a593SmuzhiyunOtherwise, you can use the reference parser in
26*4882a593Smuzhiyuntools/testing/selftests/vDSO/parse_vdso.c.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunUnless otherwise noted, the set of symbols with any given version and the
29*4882a593SmuzhiyunABI of those symbols is considered stable.  It may vary across architectures,
30*4882a593Smuzhiyunthough.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunNote:
33*4882a593Smuzhiyun As of this writing, this ABI documentation as been confirmed for x86_64.
34*4882a593Smuzhiyun The maintainers of the other vDSO-using architectures should confirm
35*4882a593Smuzhiyun that it is correct for their architecture.
36