[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150617111451.GA9335@gmail.com>
Date: Wed, 17 Jun 2015 13:14:51 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Andy Lutomirski <luto@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Frédéric Weisbecker <fweisbec@...il.com>,
Rik van Riel <riel@...hat.com>,
Oleg Nesterov <oleg@...hat.com>,
Denys Vlasenko <vda.linux@...glemail.com>,
Borislav Petkov <bp@...en8.de>,
Kees Cook <keescook@...omium.org>,
Brian Gerst <brgerst@...il.com>
Subject: Re: [RFC/INCOMPLETE 00/13] x86: Rewrite exit-to-userspace code
* Ingo Molnar <mingo@...nel.org> wrote:
> Basically there would be a single C function we'd call, which returns a
> condition (or fixes up its return address on the stack directly) to determine
> between the SYSRET and IRET return paths.
This we could do by returning the syscall result in RAX, and the SYSRET/IRET
choice in RDX - that's the natural return parameter for 128-bit return values in
the 64-bit C function ABI, and it's clobbered so it's available 'for free'.
We could do something similar for the IRQ entry/return code as well: there's no
reason why IRQ flag tracking has to be maintained in assembly. We could move all
but the IRQ stack switching code to C.
We can safely flip around the IRQ stack setting with the enter_from_user_mode
call, so that IRQ stack switching becomes part of the register saving and kernel
mode preparatory preamble.
This would allow further optimizations in the IRQ code as well: for example we
could inline enter_from_user_mode() and prepare_exit_to_usermode().
Thanks,
Ingo
--
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