lkml.org 
[lkml]   [2014]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] x86_64: A real proposal for iret-less return to kernel
On 05/21/2014 03:41 PM, Andy Lutomirski wrote:
>>
>> I think you are onto something here.
>>
>> In particular, the key observation here is that inside the kernel, we
>> can never *both* have an invalid stack *and* be inside an NMI, #MC or
>> #DB handler, even if nested.
>
> Except for espfix :)

Argh. Yes, I got that wrong... it isn't really about being inside NMI,
#MC or #DB, but rather being on those respective stacks. If you are on
the espfix stack you are on your way back to userspace OR (and this gets
really, really ugly) you took an NMI/MC/DB after a SYSCALL executed in
16-bit mode, but even then you are in the kernel entry/exit code and
re-enabling NMI is fine.

>> Now, does this prevent us from using RET in the common case? I'm not
>> sure it is a huge loss since kernel-to-kernel is relatively rare.
>
> I don't think so. The most common case should be plain old interrupts
> and I suspect that #PF is a distant second.
>
> In any event, plain old interrupts and #PF are non-IST interrupts and
> they should be unconditionally safe for RET

-hpa




\
 
 \ /
  Last update: 2014-05-22 01:21    [W:0.084 / U:1.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site