From: Keith Owens <kaos@ocs.com.au>
To: "Christopher Friesen" <cfriesen@nortel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: question on memory map of process on i386
Date: Thu, 04 Aug 2005 14:22:39 +1000 [thread overview]
Message-ID: <7276.1123129359@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Wed, 03 Aug 2005 17:28:38 CST." <42F15326.6000402@nortel.com>
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.
next prev parent reply other threads:[~2005-08-04 4:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2005-08-04 6:58 ` Christopher Friesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7276.1123129359@kao2.melbourne.sgi.com \
--to=kaos@ocs.com.au \
--cc=cfriesen@nortel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox