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

From: Michael Matz
Date: Thu Oct 14 2021 - 08:44:31 EST


Hello,

On Wed, 13 Oct 2021, Borislav Petkov wrote:

> > > In short: Ammars initial claim:
> > >
> > > > Linux x86-64 syscall only clobbers rax, rcx and r11 (and "memory").
> > > >
> > > > - rax for the return value.
> > > > - rcx to save the return address.
> > > > - r11 to save the rflags.
> > > >
> > > > Other registers are preserved.
> > >
> > > is accurate and I will clarify the psABI to make that explicit.
> >
> > Many thanks for this very detailed explanation! Ammar, I'll take your
> > patch.
>
> Great, why are we dealing with some funky document when the law is in
> glibc sources?!

In theory, theory and practice are the same, in practice, they are not.

Usually it's good to resolve a conflict towards what the document says, or
intended to say. But glibc of course provides a huge amount of pressure
to resolve toward it ;-)

(laws are also changed toward practice when the latter overtakes :) )


Ciao,
Michael.