Re: [PATCH 03/39] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler

From: Andy Lutomirski
Date: Thu Jul 12 2018 - 16:49:20 EST




> On Jul 11, 2018, at 4:29 AM, Joerg Roedel <joro@xxxxxxxxxx> wrote:
>
> From: Joerg Roedel <jroedel@xxxxxxx>
> We want x86_tss.sp0 point to the entry stack later to use
> it as a trampoline stack for other kernel entry points
> besides SYSENTER.

Makes sense: sp0 will be the entry stack. But:

>
>
> /* Offset from the sysenter stack to tss.sp0 */
> - DEFINE(TSS_entry_stack, offsetof(struct cpu_entry_area, tss.x86_tss.sp0) -
> + DEFINE(TSS_entry_stack, offsetof(struct cpu_entry_area, tss.x86_tss.sp1) -
> offsetofend(struct cpu_entry_area, entry_stack_page.stack));
>

The code reads differently. Did you perhaps mean TSS_task_stack?

Also, the âtop of task stackâ is a bit weird on 32-bit due to vm86. Can you document *exactly* what goes in sp1?