[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <536488C2.8040106@zytor.com>
Date: Fri, 02 May 2014 23:12:18 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Lutomirski <luto@...capital.net>
CC: Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>
Subject: Re: [PATCH v2] x86: Return to kernel without IRET
On 05/02/2014 09:32 PM, Linus Torvalds wrote:
> On Fri, May 2, 2014 at 4:53 PM, Andy Lutomirski <luto@...capital.net> 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?
>
That would be a security hole if another userspace thread could muck
with the stack.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists