Re: [PATCH v2] x86: Return to kernel without IRET

From: Linus Torvalds
Date: Sat May 03 2014 - 00:32:57 EST


On Fri, May 2, 2014 at 4:53 PM, Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
> On my box, this saves about 100ns on each interrupt and trap that
> happens while running in kernel space. This speeds up my kernel_pf
> microbenchmark by about 17%.

Btw, would you mind _trying_ to do a similar trick for the "return to
user space" case?

At least as a proof-of-concept, having a code sequence in user mode
trampoline that does

popq %rsi
popq %r11
retq $128

and building up a stack in user space at '%rsp-128' that has the
values or rsi/r11/rip should allow us to use 'sysret'. Hmm?

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