Re: [PATCH v2 1/3] x86/entry: Clear extra registers beyond syscall arguments for 64bit kernels

From: Linus Torvalds
Date: Mon Feb 05 2018 - 17:22:24 EST


On Mon, Feb 5, 2018 at 2:10 PM, Andy Lutomirski <luto@xxxxxxxxxx> wrote:
> At the risk of over-optimizing a dead horse, what about:
>
> xorl %ebx, %ebx
> movq %ebx, %r10
> xorl %r11, %r11
> movq %ebx, %r12
>
> etc.
>
> We'll have a cycle of latency from xor to mov, but I'd be rather
> surprised if the CPU can't hide that.

Ugh. xor really is nice because it breaks all dependencies.

Really, it's much more likely that we can just hide the xors in the
pushes. Small, simple, easy.

But I'm not timing it.

Linus