* question on memory map of process on i386
@ 2005-08-03 23:28 Christopher Friesen
2005-08-04 3:56 ` Steven Rostedt
2005-08-04 4:22 ` Keith Owens
0 siblings, 2 replies; 4+ messages in thread
From: Christopher Friesen @ 2005-08-03 23:28 UTC (permalink / raw)
To: Linux Kernel Mailing List
On i386, /proc/<pid>/maps shows the following entry:
ffffe000-fffff000 ---p 00000000 00:00 0
This page of memory is way up above TASK_SIZE (which is 0xc0000000), so
how is it visible to userspace?
Just to complicate things, I seem to find the vma for this page using
find_vma_prev().
Can anyone explain what's going on?
Thanks,
Chris
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question on memory map of process on i386
2005-08-03 23:28 question on memory map of process on i386 Christopher Friesen
@ 2005-08-04 3:56 ` Steven Rostedt
2005-08-04 4:22 ` Keith Owens
1 sibling, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2005-08-04 3:56 UTC (permalink / raw)
To: Christopher Friesen; +Cc: Keith Owens, Linux Kernel Mailing List
On Wed, 2005-08-03 at 17:28 -0600, Christopher Friesen wrote:
> On i386, /proc/<pid>/maps shows the following entry:
>
> ffffe000-fffff000 ---p 00000000 00:00 0
>
> This page of memory is way up above TASK_SIZE (which is 0xc0000000), so
> how is it visible to userspace?
>
> Just to complicate things, I seem to find the vma for this page using
> find_vma_prev().
>
> Can anyone explain what's going on?
>
Looking at the code, it seems to be the "gate area". But what this is
used for, I'm not really sure. I did a little searching but found no
good explanations of it. So I added Keith to the CC since most of the
updates to this was submitted by him :-)
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question on memory map of process on i386
2005-08-03 23:28 question on memory map of process on i386 Christopher Friesen
2005-08-04 3:56 ` Steven Rostedt
@ 2005-08-04 4:22 ` Keith Owens
2005-08-04 6:58 ` Christopher Friesen
1 sibling, 1 reply; 4+ messages in thread
From: Keith Owens @ 2005-08-04 4:22 UTC (permalink / raw)
To: Christopher Friesen; +Cc: Linux Kernel Mailing List
On Wed, 03 Aug 2005 17:28:38 -0600,
"Christopher Friesen" <cfriesen@nortel.com> wrote:
>
>On i386, /proc/<pid>/maps shows the following entry:
>
>ffffe000-fffff000 ---p 00000000 00:00 0
>
>This page of memory is way up above TASK_SIZE (which is 0xc0000000), so
>how is it visible to userspace?
>
>Just to complicate things, I seem to find the vma for this page using
>find_vma_prev().
>
>Can anyone explain what's going on?
The gate page is a section of code that is generated as part of the
kernel build. At run time, the gate page is mapped into all the user
space processes. There is also a virtual dynamic .so (vdso) file that
is created by the kernel and picked up by the linker, the vdso maps the
kernel entries in the gate page. Run this command and look for "gate".
ldd -v `which cat`
Once all the dots are joined by the linker, a program can use the vdso
to directly access the gate page, even though the vdso and the
underlying page belongs to the kernel. This direct access does not
incur any of the overhead associated with a syscall, so it can be very
fast.
What is in the gate page varies from one architecture to another, glibc
hides the arch differences from the program. Some sample uses for the
gate page -
i386: select between int 0x80 or sysenter to enter the kernel.
ia64: select between break 0x100000 or epc to enter the kernel, epc is
significantly faster. On ia64, the gate page also contains the
signal delivery trampoline.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: question on memory map of process on i386
2005-08-04 4:22 ` Keith Owens
@ 2005-08-04 6:58 ` Christopher Friesen
0 siblings, 0 replies; 4+ messages in thread
From: Christopher Friesen @ 2005-08-04 6:58 UTC (permalink / raw)
To: Keith Owens; +Cc: Linux Kernel Mailing List
Keith Owens wrote:
> The gate page is a section of code that is generated as part of the
> kernel build. At run time, the gate page is mapped into all the user
> space processes. There is also a virtual dynamic .so (vdso) file that
> is created by the kernel and picked up by the linker, the vdso maps the
> kernel entries in the gate page. Run this command and look for "gate".
Okay, I suspected it might be something like this.
Why does find_vma() fail for that page though? This confuses some code
that I wrote. Do I have to teach my stuff about get_gate_vma() and
in_gate_area()?
Chris
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-08-04 6:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-03 23:28 question on memory map of process on i386 Christopher Friesen
2005-08-04 3:56 ` Steven Rostedt
2005-08-04 4:22 ` Keith Owens
2005-08-04 6:58 ` Christopher Friesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox