Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

Brian Gerst
2015-04-24T17:33:09Z

On Fri, Apr 24, 2015 at 12:25 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Fri, Apr 24, 2015 at 5:00 AM, Brian Gerst <brgerst@gmail.com> wrote:
>>
>> So actually this isn't a preemption issue, as the NULL SS is coming
>> from an interrupt from userspace (timer tick, etc.).
>
> It *is* a preemption issue, in the sense that the interrupt that
> clears SS also then returns to user space using an "iret" that will
> properly restore it.
>
> So the only case we need to worry about is the preemption case, where
> the interrupt has caused a task switch (typically because it woke
> something up or it was the timer interrupt and the timeslice of the
> previous task is up), and we switch to another context that returns to
> user space using "sysret" instead.

To clarify, I was thinking of the CONFIG_PREEMPT case. A nested
interrupt wouldn't change SS, and IST interrupts can't schedule.

--
Brian Gerst