lkml.org 
[lkml]   [2002]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] linux-2.5.43_vsyscall_A0
From
On Tue, Oct 22, 2002 at 10:12:08PM -0700, Elladan wrote:
>
> Try 2:
>
> Create a second mapping of the vsyscall page in some special location
> above the normal page. Make a new sysctl, which globally invalidates
> the page that the standard mapping is on. Basically, this disables
> vsyscalls for everyone when turned on.
>
> Now, obviously this won't work without some trick. What we do now is,
> we make the page fault handler path for vsyscalls (to be added anyway)
> work like so:
>
> If the pc is within the allocated vsyscall page(s), then:
>
> If the pc is on the entrypoint to a vsyscall function, check whether the
> process is being traced. If so, turn this into a somewhat normal
> looking syscall so it can be virtualized (or do something else, if you
> want - have userspace jump somewhere, etc).
>
> If not traced, or if the pc is not at the entrypoint, reset the pc to be
> on the second vsyscall copy, with the same offset, and return to
> userspace.
>
> This lets us do a global vsyscall disable, but (I hope) fixes up the
> problem of userspace going to sleep inside a vsyscall. The process
> wakes up, faults, and gets shunted off to identical code in another
> location, which should have the same behavior.
>
> Downside: vgettimeofday takes a performance penalty for everyone in the
> special case where UML is running with full time virtualization, because
> of the page fault. This is the very unusual case, so who cares?
>
> Downside 2: Would this actually work? It's a bit scary sounding...

One caveat to this, I suppose, is that the vsyscall itself would need to
be position-independant code (which might not be overhead, if done very
carefully), or else the code would have to be modified inside the
sysctl() at invalidation time. Both of which make the implementation
ugly.

-J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.068 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site