Re: [PATCH] tools/nolibc: x86: Remove `r8`, `r9` and `r10` from the clobber list

From: Borislav Petkov
Date: Wed Oct 13 2021 - 10:21:02 EST


On Wed, Oct 13, 2021 at 04:07:23PM +0200, Willy Tarreau wrote:
> Yes I agree with the "potentially" here. If it can potentially be (i.e.
> the kernel is allowed by contract to later change the way it's currently
> done) then we have to save them even if it means lower code efficiency.
>
> If, however, the kernel performs such savings on purpose because it is
> willing to observe a stricter saving than the AMD64 ABI, we can follow
> it but only once it's written down somewhere that it is by contract and
> will not change.

Right, and Micha noted that such a change to the document can be done.
And we're basically doing that registers restoring anyway, in POP_REGS.

I'm not the least bit convinced it is worth enforcing that stricter
register saving, though.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette