The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Andy Lutomirski <luto@amacapital.net>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH v2] x86: Return to kernel without IRET
Date: Fri, 02 May 2014 23:12:18 -0700	[thread overview]
Message-ID: <536488C2.8040106@zytor.com> (raw)
In-Reply-To: <CA+55aFwmhOGRv0Z7Sqgk08pTOYDJg4C9GB_XNHRAtiCLFrHG1g@mail.gmail.com>

On 05/02/2014 09:32 PM, Linus Torvalds wrote:
> On Fri, May 2, 2014 at 4:53 PM, Andy Lutomirski <luto@amacapital.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



  reply	other threads:[~2014-05-03  6:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02 23:53 [PATCH v2] x86: Return to kernel without IRET Andy Lutomirski
2014-05-03  4:03 ` H. Peter Anvin
2014-05-03 11:24   ` Steven Rostedt
2014-05-03 22:19     ` H. Peter Anvin
2014-05-03 23:51       ` Andy Lutomirski
2014-05-04  0:31         ` Andy Lutomirski
2014-05-04  2:15           ` H. Peter Anvin
2014-05-04  2:14         ` H. Peter Anvin
2014-05-05 15:47       ` Andy Lutomirski
2014-05-03  4:32 ` Linus Torvalds
2014-05-03  6:12   ` H. Peter Anvin [this message]
2014-05-03 13:54     ` Linus Torvalds
2014-05-03 19:00       ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=536488C2.8040106@zytor.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox