[lkml]   [2006]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC, PATCH 7/24] i386 Vmi memory hole
Gerd Hoffmann wrote:
>>> The complications in my patch come
>>> from the fact that the vsyscall page has to be relocated dynamically,
>>> requiring, basically run time linking on the page and some tweaks to get
>>> sysenter to work. If you don't use vsyscall (say, non-TLS glibc), then
>>> you don't need that complexity. But I think it might be needed now,
>>> even for Xen.
>> I believe both Xen and execshield move vsyscall out of fixmap, and then
>> map into userspace as normal vma.
> Yep, my patch (attached below for reference) moves the vsyscall page
> into user address space, just below PAGE_OFFSET. Works basically the
> same way the vsyscall page is mapped in the ia32 emulation of the x86_64
> architecture. Address stays fixed, thus the relocation magic isn't needed.
> Once the vsyscall page is moved out of fixmap it's easy to make fixmap
> movable and thus have a runtime-resizable address space hole at the top
> of address space. Patch is attached too, although that one is more
> proof-of-concept, it doesn't make much sense as-is. It has a kernel
> command line option to specify the top of address space so you can play
> around with it ...
> Both patches are against -rc3 and most likely still apply just fine,
> havn't tested that though.

Your patch looks a lot cleaner and less hackish than mine. But I wonder
if it still works with kernels that support the sysenter method of
calling into the kernel. Look at the following code:

movl TSS_sysenter_esp0(%esp),%esp
pushl $(__USER_DS)
pushl %ebp
pushl $(__USER_CS)

SYSENTER_RETURN is a link time constant that is defined based on the
location of the vsyscall page. If the vsyscall page can move, this can
not be a constant. The reason is, this "fake" exception frame is used
to return back to the EIP of the call site, and sysenter does not record
the EIP of the call site.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-03-15 09:39    [W:0.043 / U:0.148 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site