Re: [PATCH 07/39] x86/entry/32: Enter the kernel via trampoline stack

From: Thomas Gleixner
Date: Thu Jul 19 2018 - 16:52:14 EST


On Wed, 18 Jul 2018, Brian Gerst wrote:
> > +.Lcopy_pt_regs_\@:
> > +#endif
> > +
> > + /* Allocate frame on task-stack */
> > + subl %ecx, %edi
> > +
> > + /* Switch to task-stack */
> > + movl %edi, %esp
> > +
> > + /*
> > + * We are now on the task-stack and can safely copy over the
> > + * stack-frame
> > + */
> > + shrl $2, %ecx
>
> This shift can be removed if you divide the constants by 4 above.
> Ditto on the exit path in the next patch.

No, the

> > + /* Allocate frame on task-stack */
> > + subl %ecx, %edi

needs the full value in bytes ....

Thanks,

tglx