Re: [PATCH tip-pti 2/2] x86/entry: interleave XOR register clearing with PUSH/MOV instructions

From: Andi Kleen
Date: Tue Feb 06 2018 - 18:54:31 EST


> The reason for that complexity is purely the system call fastpath case
> that no longer exists, I think.
>
> Am I missing something?

Yes merging the macros should be fine without fast path.

But for push, on older CPUs (older AMD, most Atoms, really old Intel big core)
sub+mov is a lot faster than push because push has additional dependencies
causing pipeline bubbles. So you would make these cases slower if you
use PUSH.

That is no different between fast path and slow path.

-Andi

PS it was never fully clear to me why we removed the fast path. After all it
could still be useful on the future CPUs with Spectre hardware fixes.