Thread (48 messages) 48 messages, 10 authors, 2020-09-01

Re: [PATCH v1 0/4] [RFC] Implement Trampoline File Descriptor

From: Andy Lutomirski <luto@kernel.org>
Date: 2020-07-28 17:16:49
Also in: linux-arm-kernel, linux-fsdevel, linux-integrity, linux-security-module, lkml

Possibly related (same subject, not in this thread)

On Tue, Jul 28, 2020 at 9:32 AM Madhavan T. Venkataraman
[off-list ref] wrote:
Thanks. See inline..

On 7/28/20 10:13 AM, David Laight wrote:
quoted
From:  madvenka@linux.microsoft.com
quoted
Sent: 28 July 2020 14:11
...
quoted
The kernel creates the trampoline mapping without any permissions. When
the trampoline is executed by user code, a page fault happens and the
kernel gets control. The kernel recognizes that this is a trampoline
invocation. It sets up the user registers based on the specified
register context, and/or pushes values on the user stack based on the
specified stack context, and sets the user PC to the requested target
PC. When the kernel returns, execution continues at the target PC.
So, the kernel does the work of the trampoline on behalf of the
application.
Isn't the performance of this going to be horrid?
It takes about the same amount of time as getpid(). So, it is
one quick trip into the kernel. I expect that applications will
typically not care about this extra overhead as long as
they are able to run.
What did you test this on?  A page fault on any modern x86_64 system
is much, much, much, much slower than a syscall.

--Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help