lkml.org 
[lkml]   [2014]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/asm] sched/x86_64: Don't save flags on context switch
On 11/03/2014 01:11 PM, Andy Lutomirski wrote:
> On Tue, Oct 28, 2014 at 4:14 AM, tip-bot for Andy Lutomirski
> <tipbot@zytor.com> wrote:
>> Commit-ID: 2c7577a7583747c9b71f26dced7f696b739da745
>> Gitweb: http://git.kernel.org/tip/2c7577a7583747c9b71f26dced7f696b739da745
>> Author: Andy Lutomirski <luto@amacapital.net>
>> AuthorDate: Wed, 1 Oct 2014 11:28:25 -0700
>> Committer: Ingo Molnar <mingo@kernel.org>
>> CommitDate: Tue, 28 Oct 2014 11:11:30 +0100
>>
>> sched/x86_64: Don't save flags on context switch
>>
>> Now that the kernel always runs with clean flags (in particular,
>> NT is clear), there is no need to save and restore flags on
>> every context switch.
>
> Just to make myself a little more comfortable with this...
>
> There is one potentially relevant flag: AC. I think this is still OK.
> If we schedule with STAC set, then we've already screwed up, I think.
> Even preempt schedules from interrupt context, so if we schedule due
> to preemption or #PF in the middle of uaccess, AC should be saved and
> cleared by whatever interrupt caused the reschedule, right?
>
> And do we ever have TF set during a context switch? I hope not.
>
> Also, what's with 'jmp exit_intr' at the end of retint_kernel? Why
> isn't that 'jmp retint_kernel'?
>

AC is saved by interrupts and cleared by IRET. We execute CLAC in all
the interrupt entry paths.

-hpa




\
 
 \ /
  Last update: 2014-11-03 23:41    [W:0.053 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site