lkml.org 
[lkml]   [2015]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/INCOMPLETE 00/13] x86: Rewrite exit-to-userspace code

* Ingo Molnar <mingo@kernel.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


\
 
 \ /
  Last update: 2015-06-17 13:21    [W:0.242 / U:2.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site