[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUXjFYd7ZC958WoNk1mnPCw2kw5jt-Ywo309EObnuqFAg@mail.gmail.com>
Date: Mon, 27 Jan 2014 14:46:40 -0800
From: Andy Lutomirski <luto@...capital.net>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Al Viro <viro@...iv.linux.org.uk>, Peter Anvin <hpa@...or.com>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
"the arch/x86 maintainers" <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] de-asmify the x86-64 system call slowpath
On Mon, Jan 27, 2014 at 2:43 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Mon, Jan 27, 2014 at 2:32 PM, Al Viro <viro@...iv.linux.org.uk> wrote:
>>
>> do_signal() is also a place where arbitrary changes to regs might've
>> been done by tracer, so regs->cs might need to be checked in the same
>> place where we validate regs->rip ;-/
>
> Fair enough. But it would still be really easy, and make the common
> case signal delivery a bit faster.
>
> Now, sadly, most signal delivery is then followed by sigreturn (the
> exceptions being dying or doing a longjmp), so we'd still get the
> iretq then. But it would cut the iretq's related to signals in half.
>
> We *could* try to do sigreturn with sysret and a small trampoline too,
> of course. But I'm not sure how far I'd want to take it.
I once spent a while thinking about how to do this. The best I could
come up with was to use something like 'ret 128' for the trampoline.
(The issue here is that there's no good place to shove a global
variable with the missing register values, fs and gs aren't really
available for these games, and the red zone is in the way.)
I think that sysret for sigreturn is probably not very interesting.
On the other hand, sysret for #PF might be a huge win, despite being
even scarier.
(Or someone could politely ask Intel for a couple of non-serializing
msrs that set the values of rcx and whatever other registers get
clobbered by sysret.)
--Andy
--
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